[SOLVED] iOS Universal link not working in background state

Issue

In react native the iOS Universal links are working perfectly when the app is in kill/quiet state I tested it with safari but when the app is in background state it only opens the app not working in background state my listener is not working.

Linking.addEventListener('url', async (link) => {
    console.log('Linking-addEventListener-link', link);
})

Solution

Try below One

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

Answered By – Mobile Team iOS-RN

Answer Checked By – Dawn Plyler (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.