react-native-tiktok-v2
v0.1.6
Published
This package with tiktok v2
Readme
react-native-tiktok-v2
This package aims to help you Sign in with TikTok using new TikTok SDK.
Installation
1. Install the library
using either Yarn:
yarn add react-native-tiktok-v2or npm:
npm install react-native-tiktok-v22. Link
In iOS:
$ cd ios/ && pod install3. Configure your project
3.1 iOS
Before you can run the project, follow the TikTok OpenSDK for iOS - Quickstart. You can skip the "Install the SDK" step.
NOTE: The above link (Step 3 and 4) contains Swift code instead of Objective-C which is inconvenient since react-native ecosystem still relies
on Objective-C. To make it work in Objective-C you need to do the following in /ios/PROJECT/AppDelegate.m:
- Create "projectName-Bridging-Header.h" file and add to this file:
@import TikTokOpenSDKCore;
@import TikTokOpenAuthSDK;- After that, import this file to your AppDelegate.mm:
#import "projectName-Bridging-Header.h"- Add the following:
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [TTKSDKURLHandler handleOpenURL:url];
}- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler
{
return [TTKSDKURLHandler handleOpenURL:userActivity.webpageURL];
}3.2 Android
Before you can run the project, follow the TikTok OpenSDK for Android - Quickstart.
NOTE: Just do Step 2 when you have build relevant issues.
Usage
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
