react-native-tiktok icon indicating copy to clipboard operation
react-native-tiktok copied to clipboard

iOS:: Fails during auth process if TikTok App is not installed

Open danielavelasquezc opened this issue 2 years ago • 2 comments

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

danielavelasquezc avatar May 08 '23 13:05 danielavelasquezc

@danielavelasquezc Hi, can you try something like that?

import DeviceInfo from 'react-native-device-info';

const isTikTokInstalled = async () => {
  const installedApps = await DeviceInfo. getInstallerPackageName();
  return installedApps.some(app => app.bundleId === 'com.zhiliaoapp.musically');
}

// Usage
const tiktokInstalled = await isTikTokInstalled();
console.log(tiktokInstalled); // true or false

Lg0gs avatar May 09 '23 07:05 Lg0gs

The problem is launching the tiktok website. It doesn't work. I can detect if the app is installed or not but if it's not installed nothing happen.

danielavelasquezc avatar May 16 '23 18:05 danielavelasquezc