Piroro-hs / react-native-twitter

A Twitter API client library for React Native. Currently not maintained as my main motivation of creating this library was to use the User Streams API.
MIT License
39 stars 20 forks source link

Documentation on using auth #8

Closed vijayst closed 7 years ago

vijayst commented 7 years ago

An example of using auth will be very helpful. On clicking the sign-in button, I have the following code triggered:

auth({
  consumerKey: CONSUMER_KEY,
  consumerSecret: CONSUMER_SECRET
}, 'retweeter://main')
.then(credentials => {
});

My deep linking is working fine with my AndroidManifest:

<intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data 
            android:scheme="retweeter"
            android:host="main"
        />
</intent-filter>
vijayst commented 7 years ago

I was able to get the above working with the example in the repo. I missed marking the activity as SINGLE TASK. Closing the issue.

vijayst commented 7 years ago

I also had the "Destroy activities after the user leaves" developer setting to true in my device. As a result, setState in the promise was not working as the component was unmounted!