ns plugin add @nativescript/twitter
Go to Twitter Apps to create your app so that you can obtain API key and secret, note:
Here is how callbacks would look like:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>yourscheme></string>
</array>
</dict>
</array>
import { Twitter, TwitterSignIn } from '@nativescript/twitter'
Twitter.callback = 'yourscheme://'
Twitter.init(TWITTER_COMSUMER_KEY, TWITTER_CONSUMER_SECRET)
TwitterSignIn.logIn()
.then(session => {
// session.authToken
// session.authTokenSecret
})
.catch(e => {})
Apache License Version 2.0