0.0.25 • Published 3 years ago

react-native-socials v0.0.25

Weekly downloads
393
License
MIT
Repository
github
Last release
3 years ago

React Native Socials

Install

The library is still in version 0, be cautious when you upgrade it! 🚧

yarn add react-native-socials

It is also needed to add react-native-video in your project because social components usually contains embeded videos. See react-native-video library for more information about the installation.

Finally, it is recommended to wrap those components into PureComponent because some of them can be costly to rerender (videos for instance).

Instagram

WARNING as of summer 2020, Instagram has added a firewall to prevent scripts to access its unofficial API. It's planned in the migrate and use the official Instagram API.

LightDark
import {Instagram} from "react-native-socials";

<Instagram id="B8U12TXAmK-" >

Props:

NameTypeDefaultDescription
idstringRequiredInstagram post id
darkModeboolfalseToggle dark mode
languagestring enum"en" - "de" - "fr" - "es" - "pt" - "it" -"ru"Pick language for metadata of the post
containerBorderRadiusnumber0Border radius of the container of the UI element

Twitter

LightDark
import {Twitter} from "react-native-socials";

<Twitter
consumerKey=""
consumerSecret=""
id="1251870993628434433"
>

Unlike Instagram, the Twitter API is not open. It is needed that you register your app (free version) to the Twitter portal to be able to fetch Twitter posts.

Props:

NameTypeDefaultDescription
idstringRequiredTwitter post id
consumerKeystringRequiredOAuth 1.0 Twitter key that is granted when you register your app on Twitter Portal
consumerSecretstringRequiredOAuth 1.0 Twitter secret that is granted when you register your app on Twitter Portal
darkModeboolfalseToggle dark mode
languagestring enum"en"Pick language for metadata of the post
onHashTagPress(hashtag:string) => voidRedirect to webpageOverrides default behavior when pressing an hashtag in a Tweet
onUserMentionPress(userMention:string) => voidRedirect to webpageOverrides default behavior when pressing a user mention in a Tweet
onLinkPress(link:string) => voidRedirect to webpageOverrides default behavior when pressing a link in a Tweet
cornerRadiusstring enum"small"Chose the corner radius of UI elements in a post. Typically a post taking the whole width of the screen should have "big" whereas a post in a card should use the "small" value
containerBorderRadiusnumber0Border radius of the container of the UI element
onTweetPress(tweetId:string) => voidRedirect to webpageOverrides default behavior when pressing the tweet
useCustomTweetExtendedDataObjectnullUse this prop when you have already fetched the Twitter data in the app, and you want to call the component with the Twitter data as prop that you already have fetched. This object needs to be exactly the response of the call to the Twitter API with the ?tweet_mode=extended parameter, like: https://api.twitter.com/1.1/statuses/show/1265128375707983872.json?tweet_mode=extended
0.0.25

3 years ago

0.0.23

4 years ago

0.0.24

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago