Skip to content

Commit 759949d

Browse files
author
PierreCapo
committed
✨ add a prop to pass Twitter api data directly
1 parent 8933315 commit 759949d

File tree

6 files changed

+381
-21
lines changed

6 files changed

+381
-21
lines changed

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Finally, it is recommended to wrap those components into PureComponent because s
2222

2323
### Instagram
2424

25+
**WARNING** as of summer 2020, Instagram has added a firewall to prevent scripts to access its unofficial API.
26+
It's planned in the migrate and use the official Instagram API.
27+
2528
| Light | Dark |
2629
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
2730
| <image src="https://github.com/PierreCapo/react-native-socials/raw/master/images/screenshot_instagram.png" /> | <image src="https://github.com/PierreCapo/react-native-socials/raw/master/images/screenshot_instagram_dark.png" /> |
@@ -61,16 +64,17 @@ Unlike Instagram, the **Twitter API is not open**. It is needed that you registe
6164

6265
Props:
6366

64-
| Name | Type | Default | Description |
65-
| --------------------- | ---------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66-
| id | string | **Required** | Twitter post id |
67-
| consumerKey | string | **Required** | OAuth 1.0 Twitter key that is granted when you [register your app on Twitter Portal](https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a) |
68-
| consumerSecret | string | **Required** | OAuth 1.0 Twitter secret that is granted when you [register your app on Twitter Portal](https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a) |
69-
| darkMode | bool | false | Toggle dark mode |
70-
| language | string enum | "en" | Pick language for metadata of the post |
71-
| onHashTagPress | (hashtag:string) => void | Redirect to webpage | Overrides default behavior when pressing an hashtag in a Tweet |
72-
| onUserMentionPress | (userMention:string) => void | Redirect to webpage | Overrides default behavior when pressing a user mention in a Tweet |
73-
| onLinkPress | (link:string) => void | Redirect to webpage | Overrides default behavior when pressing a link in a Tweet |
74-
| cornerRadius | string 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 |
75-
| containerBorderRadius | number | 0 | Border radius of the container of the UI element |
76-
| onTweetPress | (tweetId:string) => void | Redirect to webpage | Overrides default behavior when pressing the tweet |
67+
| Name | Type | Default | Description |
68+
| -------------------------- | ---------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
69+
| id | string | **Required** | Twitter post id |
70+
| consumerKey | string | **Required** | OAuth 1.0 Twitter key that is granted when you [register your app on Twitter Portal](https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a) |
71+
| consumerSecret | string | **Required** | OAuth 1.0 Twitter secret that is granted when you [register your app on Twitter Portal](https://developer.twitter.com/en/docs/basics/authentication/oauth-1-0a) |
72+
| darkMode | bool | false | Toggle dark mode |
73+
| language | string enum | "en" | Pick language for metadata of the post |
74+
| onHashTagPress | (hashtag:string) => void | Redirect to webpage | Overrides default behavior when pressing an hashtag in a Tweet |
75+
| onUserMentionPress | (userMention:string) => void | Redirect to webpage | Overrides default behavior when pressing a user mention in a Tweet |
76+
| onLinkPress | (link:string) => void | Redirect to webpage | Overrides default behavior when pressing a link in a Tweet |
77+
| cornerRadius | string 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 |
78+
| containerBorderRadius | number | 0 | Border radius of the container of the UI element |
79+
| onTweetPress | (tweetId:string) => void | Redirect to webpage | Overrides default behavior when pressing the tweet |
80+
| useCustomTweetExtendedData | Object | null | Use 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 commit comments

Comments
 (0)