allo
allo

Reputation: 83

Universal link is not working with react native IOS

I'm trying to integrate universal linking in my react native project, it works properly in android while in IOS it's not working, but deep linking it working properly.

when I tried to open the https url ex: https:example.com it is opening is safari it's not redirected to the IOS app

{
 "applinks": {
 "apps": [],
 "details": [
  {
    "appID": "<Team_ID>.xxx.xxxxx.xxxx.xx.xx",
    "paths": [
      "NOT /_/*",
      "/*"
    ]
  }
 ]
}}

I have added the following code to AppDelegate.m

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

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

also I have enable Associated Domains in apple developer

 my entitlement

any idea if something is missing?

I'm using react native v0.63.3

Upvotes: 0

Views: 1437

Answers (1)

cyberpolin
cyberpolin

Reputation: 355

Please first of all make sure:

  1. your apple-app-site-association file is under <domain>/.well-known/apple-app-site-association route and is accesible.
  2. Then use this format to make the file: https://developer.apple.com/documentation/xcode/supporting-associated-domains
  3. finally wait 5 minutes after the apple-app-site-association has been updated and delete the app from your simulator and install it again, then you can test.

Upvotes: 0

Related Questions