lg0gs / react-native-tiktok Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hey @Lg0gs, I am getting the below issue when I run the build from XCode. Can you help me to sort out this one
'TikTokOpenSDKShareRequest' has different definitions in different modules; first difference is definition in module 'TikTokOpenSDK.TikTokOpenSDKShare' found property
ShareSheet looks good.
Can I use it on both android and ios?
Is it possible to use this to share original sounds to TikTok? Or on the roadmap?
This is most likely not an issue, i just need some help sorry guys.
I did everything acc to docs. I fixed some errors using #14, #8 and took guidance of #5
Now its built, but calling auth() does not do anything. The callback console log doesnt run at all. Can someone please help how to debug what's wrong?
When i open the app, I get a warning saying:
WARN Module Tiktok requires main queue setup since it overrides init
but doesn't implement requiresMainQueueSetup
. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
I am using an Expo Development Build. I already have TikTok installed and logged in on my iPhone
share callback always returns NETWORK_ERROR on iOS. Haven't test it on Android yet.
Hello,
I am using react-native-tiktok v1.1.1, and react-native v0.63.4.
I am having issues on android when attempting to share a video to TikTok.
My app has passed the TikTok review and is currently Live in production.
I called init(key) with the client key. Auth() works and I can successfully obtain the code, but when i try to share a video i run into the following issue:
I am using react-native-image-crop-picker for obtaining the media path, so there shouldn't be an issue with the path that is being passed to the share method:
Picker.openPicker({ mediaType: 'video', }).then((media) => { share(media.path, (code) => { console.log(code); }); });
I also added the auth and share event listeners, but the share listener doesn't get the opportunity to trigger because of this issue.
Have you encountered this issue before and do you know any workarounds? Thank you
WARNING:: The specified Android SDK Build Tools version (29.0.2) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Task :app:checkDebugAarMetadata FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
16 actionable tasks: 2 executed, 14 up-to-date
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.bytedance.ies.ugc.aweme:open-sdk:0.0.1.5.
Searched in the following locations:
- file:/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/react-native/android/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- file:/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/jsc-android/dist/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- https://repo.maven.apache.org/maven2/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- https://dl.google.com/dl/android/maven2/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- https://www.jitpack.io/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
Required by:
project :app > project :react-native-tiktok
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.bytedance.ies.ugc.aweme:open-sdk:0.0.1.5.
Searched in the following locations:
- file:/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/react-native/android/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- file:/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/jsc-android/dist/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- https://repo.maven.apache.org/maven2/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- https://dl.google.com/dl/android/maven2/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
- https://www.jitpack.io/com/bytedance/ies/ugc/aweme/open-sdk/0.0.1.5/open-sdk-0.0.1.5.pom
Required by:
project :app > project :react-native-tiktok
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 8s
at makeError (/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/execa/index.js:174:9)
at /Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/yuvrajsingh/Projects/innovation/upwork/loveTheIdea/omniApp/heatmap/node_modules/@react-native-community/cli/build/index.js:192:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Hello,
I'm using:
RN: 0.71.2
react-native-tiktok: 1.1.1
And when I try to compile the android app, I get this error:
Could not determine the dependencies of task ':app:processStagingDebugResources'.
Could not resolve all task dependencies for configuration ':app:stagingDebugRuntimeClasspath'.
Could not find com.bytedance.ies.ugc.aweme:opensdk-oversea-external:0.2.0.2.
Searched in the following locations:
- https://oss.sonatype.org/content/repositories/snapshots/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://repo.maven.apache.org/maven2/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- file:/<<PROJECT_REPO_DIR>>/node_modules/jsc-android/dist/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://dl.google.com/dl/android/maven2/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://www.jitpack.io/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
I have tried already with all of this repo's versions and none are working.
Please your help, I don't know if I am missing something!!
Thanks
The following build commands failed:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'react-native-tiktok' from project 'Pods')
CompileSwift normal x86_64 /Users/myname/Documents/GitHub/my-project/node_modules/react-native-tiktok/ios/Tiktok.swift (in target 'react-native-tiktok' from project 'Pods')
(2 failures)
I've followed all the installation instruction (including adding a swift bridge file), but I'm still unable to build. I've tried removing the node_modules and pods and doing a fresh install, but with no success. Could anyone point in me in the right direction on how to resolve this?
Hey, thank you for this library!
I'm running into an isssue when trying to use auth
:
Attempt to present <UINavigationController: 0x7fc6458b7c00> on <Tiktok: 0x7fc64526fa80> (from <Tiktok: 0x7fc64526fa80>) whose view is not in the window hierarchy.
React Native: 0.68.2
.
This is my AppDelegate.mm
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[TikTokOpenSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
RCTAppSetupPrepareApp(application);
RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];
UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:nil];
rootView.backgroundColor = [UIColor whiteColor];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
I've tried forcing the TikTokOpenSDK
version to be 5.0.0
but that didn't help.
Do you have any ideas for what it could be?
Trying to share a video to TikTok on iOS but only get SHARING_FAILED. Followed the instructions for AppDelegate.m and info.plist and got a TikTok AppID.
Do I need to add something more to AppDelegate.m to make sharing work? Or do I need to authenticate first?
What are the general steps to make share work?
Thanks!
Hello @Lg0gs
Thank you for your great packages
I faced an issue while building on Android.
Task :app:processDebugMainManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
193 actionable tasks: 3 executed, 190 up-to-date
E:\Work\tiktok\android\app\src\debug\AndroidManifest.xml:20:13-60 Error:
Attribute provider#androidx.core.content.FileProvider@authorities value=(com.myapp.provider) from [:react-native-image-crop-picker] AndroidManifest.xml:20:13-60
is also present at [:react-native-tiktok] AndroidManifest.xml:25:13-64 value=(com.myapp.fileprovider).
Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:18:9-26:20 to override.
E:\Work\tiktok\android\app\src\debug\AndroidManifest.xml:25:17-55 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:react-native-image-crop-picker] AndroidManifest.xml:25:17-55
is also present at [:react-native-tiktok] AndroidManifest.xml:31:17-60 value=(@xml/file_provider_paths).
Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml to override.FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
- What went wrong:
Execution failed for task ':app:processDebugMainManifest'.Manifest merger failed with multiple errors, see logs
- Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================2: Task failed with an exception.
What went wrong:
java.lang.StackOverflowError (no error message)Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================
- Get more help at https://help.gradle.org
BUILD FAILED in 1m 22s
Any help is much appreciated
On iOS it seems the callback is never called and it seems it's an issue directly with the swift/objc implementation
request.send(self, completion: { resp in
guard let strongSelf = weakSelf else { return }
// STEP 3: Parse and handle the response
if resp.errCode.rawValue == 0 {
let responseCode = resp.code
// Upload response code to your server and obtain user access token
// ...
} else {
// User authorization failed. Handle errors
// ...
}
})
It never gets to the guard let strongSelf...
line.
Complete code
@objc
func auth(_ callback: @escaping RCTResponseSenderBlock) {
// STEP 1: Create the request and set permissions
let scopes = ["user.info.basic,video.list"] // list your scopes
let scopesSet = NSOrderedSet(array: scopes)
let request = TikTokOpenSDKAuthRequest()
request.permissions = scopesSet
// STEP 2: Send the request
weak var weakSelf = self
request.send(self, completion: { resp in
guard let strongSelf = weakSelf else { return }
// STEP 3: Parse and handle the response
if resp.errCode.rawValue == 0 {
let responseCode = resp.code
// Upload response code to your server and obtain user access token
// ...
} else {
// User authorization failed. Handle errors
// ...
}
})
}
Hello,
I have noticed that the Tiktok auth view doesn't include login using different providers (e.g facebook, google etc.).
Does that mean, if I continued with google, I won't be able to authorise by using google provider with this package current tiktok SDK?
Hi @Lg0gs
I am getting this response { code: '', status: 10006 } on Android for Auth.
Can you please help!
Below are the versions-
"react-native-tiktok": "1.0.1"
"react": "16.13.1"
"react-native": "0.63.4"
Hello,
First of all, thank you for this great library!
I've run into an issue, where I don't seem to be getting the callback after a successful share to TikTok on iOS.
The code:
share(url, (code: string) => {
console.log("Came back from TikTok share", code);
});
The sharing itself works perfectly, but I never get the callback log.
On Android I've implemented the additional logic with event listener and get the callback logs:
but not when:
1. What could I be missing on iOS?
2. Is the behaviour that I am getting on Android correct and is it the expected behaviour on both Platforms?
Any help is much appreciated. Thank you!
Hey, thank you for this library!
I'm working on a Tiktok integration through your library and the authentication process works perfectly when the TikTok app is installed on the iOS device BUT nothing happens when the TikTok app is not installed on an iOS device:
`-canOpenURL: failed for URL: "tiktokopensdk://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)"
[Presentation] Attempt to present <UINavigationController: 0x10c832800> on <Tiktok: 0x106c2e800> (from <Tiktok: 0x106c2e800>) whose view is not in the window hierarchy.
`
Can you help me?
Best Regards
Hello all ! First thanks @Lg0gs for this amazing library.
Here is the issue I am meeting when I am trying to test sharing feature in prebuild environment on real device (iOS 16.4.1):
[PhotoKit] PHExternalAssetResource: Unable to issue sandbox extension for /...
. My device opened tiktok but it loaded 2 seconds and send me back to my app (I tried removing the scheme in info plist to not force the callback when the sdk gave a response/error but nothing happens, I am staying on the home page of tiktok).
I also tried with all kind of paths, directly from the image picker of expo, nothing happened.
If anyone has met this issue before with this lib or maybe with another one sharing content.
Thanks !!
It'd be great if this library worked with expo managed workflow. Do you have any idea how to get it to work with it?
I've tried adding it to the managed workflow and then creating a new dev client but it's the AppDelegate section that I really don't know how to get it working.
I use Share function to share video to tiktok but tiktok app open only, not navigate to post screen. I do this with local file path like var/...../video.mp4. And my app in Under review
Hi @Lg0gs
I am getting error while installing pod.
Installing TikTokOpenSDK (5.0.14)
[!] Error installing TikTokOpenSDK
[!] /usr/bin/curl -f -L -o /var/folders/1b/tcpqxh9d6nnc3mbmc97lmx6c0000gn/T/d20220704-5051-1lon6o5/file.zip https://sf16-muse-va.ibytedtos.com/obj/tiktok-open-platform/TikTokOpenSDK.xcframework-5.0.14.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (35) error:02FFF036:system library:func(4095):Connection reset by peer
Below are the versions-
"react-native-tiktok": "1.0.1"
"react": "16.13.1"
"react-native": "0.63.4"
When I try to build my app I get this error
* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.bytedance.ies.ugc.aweme:opensdk-oversea-external:0.2.0.2.
Searched in the following locations:
- file:/Users/aykutsaki/.m2/repository/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- file:/Users/aykutsaki/Desktop/fizz/client/node_modules/react-native/android/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://maven.google.com/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- file:/Users/aykutsaki/Desktop/buzz/client/node_modules/jsc-android/dist/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://dl.google.com/dl/android/maven2/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://jcenter.bintray.com/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- https://www.jitpack.io/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
- file:/Users/aykutsaki/Desktop/fizz/client/node_modules/@notifee/react-native/android/libs/com/bytedance/ies/ugc/aweme/opensdk-oversea-external/0.2.0.2/opensdk-oversea-external-0.2.0.2.pom
Required by:
project :app > project :react-native-tiktok
It cannot find the dependency even though maven url included
react-native-tiktok > android > build.gradle
buildscript {
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
}
}
}
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('Tiktok_compileSdkVersion', 30)
buildToolsVersion safeExtGet('Tiktok_buildToolsVersion', '30.0.2')
defaultConfig {
minSdkVersion safeExtGet('Tiktok_minSdkVersion', 16)
targetSdkVersion safeExtGet('Tiktok_targetSdkVersion', 30)
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
disable 'GradleCompatible'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" }
google()
jcenter()
}
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.bytedance.ies.ugc.aweme:opensdk-oversea-external:0.2.0.2'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.