ios – QR code and deeplink to open website or app – React Native


I have a react native application that reads a QR code that calls a deeplink (https://reactnavigation.org/docs/deep-linking/) that should show options to open an app or the website, it works fine on Android, but the same doesn’t works on iOS, it shows the website but not the app even with it installed.

I set the RCTLinking on AppDelegate.m, set the url types on InfoPlist as well:

The QR code is based on the link https://formulario.153cidadao.com.br/assedio?cidade=2

AppDelegate:

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:    (NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  return [super application:application openURL:url options:options] || [RCTLinkingManager   application:application openURL:url options:options];
}

// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
  BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
  return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
}

InfoPlist:

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>https://formulario.153cidadao.com.br/assedio?cidade=2</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>https</string>
            </array>
        </dict>
    </array>

Have you guys found something similar or know if there is something missing? I’m reading the documentation, but didn’t found any info regarding this issue.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img