This package aims to help you Sign in with TikTok using new TikTok SDK.
using either Yarn:
yarn add react-native-tiktok-v2
or npm:
npm install react-native-tiktok-v2
In iOS:
$ cd ios/ && pod install
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];
}
Before you can run the project, follow the TikTok OpenSDK for Android - Quickstart.
NOTE: Just do Step 2 when you have build relevant issues.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library