react-native-twitter-sdk
v0.1.6
Published
Twitter SDK support for React Native apps.
Downloads
2
Maintainers
Readme
React Native TwitterSDK [iOS Only]
React Native TwitterSDK is a wrapper around the iOS Twitter SDK.
Installation
Using npm:
npm install --save react-native-twitter-sdk
Linking
Manually
Download and add Twitter Kit to your project:
- Download Twitter Kit and unzip under
~/Documents/TwitterSDK
directory on your Mac. - Drag contents to the root of your project in Xcode
- Make sure that
~/Documents/TwitterSDK
is in the Framework Search Path of your build target's Build Settings.
In XCode, in the project navigator:
- Right click Libraries
- Add Files to [your project's name]
- Go to
node_modules/react-native-twitter-sdk/ios
- Add the
.xcodeproj
file - Add the
libRNTwitterSDK.a
from the RNTwitterSDK project to your project's Build Phases ➜ Link Binary With Libraries
In XCode, in the project navigator, select your project.
- Add TwitterKit to "Embedded Binaries" in your Xcode project settings
- Add TwitterKit and TwitterCore to "Linked Frameworks and Libraries" in your Xcode project settings
Usage
Complete the following steps.
import { TwitterLoginManager } from 'react-native-twitter-sdk';
TwitterLoginManager.logIn()
.then(result => console.log(result))
.catch((error) => console.log(error));
Copyright and license
Code released under the MIT license.