React Native Deeplink Issue

I am working in React Native and trying to use Deeplink. When app is installed code is working fine but when app is not installed not redirecting to App Store in Safari instead of that in Chrome that is working fine in safari when i click i got this error message

"safari cannot open the page because the address is invalid"

this is my apple-app-site-association file code

{ "applinks": { "apps": [], "details": [ { "appID": "CS666P223.com.seecard", "paths": [ "", "/recover/", "/settings/*" ] } ] } , "webcredentials": { "apps": [ "CS666P223.com.seecard" ] } }

and this is my code in next

"use client"

export default function Home() {

// Helper function for device detection // const isiOS = () => /iPhone|iPad|iPod/i.test(navigator.userAgent); const isAndroid = () => /Android/i.test(navigator.userAgent);

const isiOS = () => { const userAgent = navigator.userAgent || navigator.vendor; return ( /iPhone|iPad|iPod/.test(userAgent) || (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) ); };

const openAndSaveCard = () => { try { // let fallbackLink = '';

  if (isiOS() || isAndroid()) {

    const card_id = "3434bee9675ee44b3dc65";
    const card_owner_id = "34349675ee44b3dc43";

    const card_for_saved = {
      "cardId": card_id,
      "ownerId": card_owner_id
    };

    console.log("=-=-card_for_saved",card_for_saved)
    const encodedData = encodeURIComponent(JSON.stringify(card_for_saved));
      window.location.href = `saveseecard://open?id=${encodedData}`;
      const androidAppStoreLink = 'https://play.google.com/store/apps/details?id=com.seecard';
      const iosAppStoreLink = 'https://apps.apple.com/np/app/seecard/id6502513661';
      fallbackLink = isAndroid() ? androidAppStoreLink : iosAppStoreLink;
      const timeout = setTimeout(function () {
          if (document.hasFocus()) {
            window.location.href = fallbackLink;
          }
      }, 2000);

      window.addEventListener('blur', () => {
          clearTimeout(timeout);;
      });
      
  } else {
    alert("Your device doesn't support deep linking for this app.");
  }
} catch (e) {
  console.log("Error:", e);
}

};

return ( <div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]"> <main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">

      <div className="cIcon ml-10 purpleBg" 
      // onClick={() => { openAndSaveCard() }}
      onClick={openAndSaveCard}
      >
      <p className="container-text">Save Card</p>
      </div>
      


  </main>
</div>

); }

You should check with the support resources provided by the 3rd party to get assistance with their software.

Unless another developer in the forums has experience with the third-party and can provide assistance.

Upon a brief review, it appears that your AASA file is utilizing an outdated format. This format underwent a change since iOS 13. I recommend updating the file to adopt the new format. For further information, please refer to the video from WWDC 2019: https://developer.apple.com/videos/play/wwdc2019/717/.

I must acknowledge that I am not familiar with React Native. Regarding the delegate in React Native, it seems that you are not employing DeepLinking or Universal Links. Instead, it appears that you are using a link to the app store. Are you attempting to create Smart Banners? For more information, please refer to the documentation: https://developer.apple.com/documentation/webkit/promoting-apps-with-smart-app-banners.

If you wish to troubleshoot Universal Links, please refer to the following guide: https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links/.

Albert Pascual
  Worldwide Developer Relations.

I have done all things. even i have updated apple-app-site-association file which have old format. Now everything is ok but still getting error in safari "safari cannot open the page because the address is invalid". But in chrome everything is working fine. I have issue only with fallback when app is not installed this should open app store in Safari. If app is installed then from safari it works open the app and perform the given action.

Have you implemented Smart Banners on your website?

https://developer.apple.com/documentation/webkit/promoting-apps-with-smart-app-banners

What link is giving you the "safari cannot open the page because the address is invalid"? Have you tried to test it from Notes and long press to see if the app is registered? If the app is not installed, smart banners are great to customize the experience.

Albert Pascual
  Worldwide Developer Relations.

React Native Deeplink Issue
 
 
Q