not_fubar_yet
not_fubar_yet

Reputation: 362

ios universal links not opening iOS app. react-native 0.73 firebase auth

im using firebase auth sendSignInLinkToEmail() with universal links, not dynamic links. When i get an email, i click the email sign in link on my iPhone, but it opens my website, instead of opening my iOS App.

the links looks like https://app.mydomain.com/__/auth/links?link=https://mydomain.firebaseapp.com/__/auth/action?apiKey%3DAIza...C8_X8%26mode%3DsignIn%26oobCode%3DQC...FzuA%26continueUrl%3Dhttps://app.mydomain.com%26lang%3Den

mydomain and myteamid are replaced accordingly.

why is the link not deep linking and opening my iOS app?

Setup

  1. "react-native: "0.73.0"

  2. firebase,

    • Email link (passwordless sign-in Enabled.
    • added authorized domains: mydomain.com
    • ios settings > team id = myteamid
  3. react-native code

     const actionCodeSettings = {
        url: 'https://app.mydomain.com',
        handleCodeInApp: true,
        iOS: {
          bundleId: 'com.mydomain.main'
        },
        android: {
          packageName: 'com.mydomain.main',
          installApp: true,
          minimumVersion: '1'
        },
        linkDomain: 'app.mydomain.com'
      }
      await sendSignInLinkToEmail(auth, email, actionCodeSettings)
    
  4. Appdelegate.mm, followed: Universal Deep Linking in react native 0.73

  5. myapp.entitlements

      <key>com.apple.developer.associated-domains</key>
      <array> <string>applinks:app.mydomain.com</string></array>
    
  6. following: https://firebase.google.com/docs/auth/ios/email-link-migration

    5.1. apple-app-site-association verified app.mydomain.com using https://branch.io/resources/aasa-validator/

    {
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "myteamid.com.mydomain.main",
                "paths": [
                    "NOT /__/auth/action/",
                    "NOT /__/auth/handler/",
                    "NOT /_/*",
                    "/*"
                ]
            }
        ]
      }
    }
    

    5.2. Configure your project to use the new links. ran the script, Response 200 and

      ProjectConfig {
        smsRegionConfig: {},
        multiFactorConfig_: MultiFactorAuthConfig {
          state: 'DISABLED',
          factorIds: [],
          providerConfigs: []
        },
        mobileLinksConfig: { domain: 'HOSTING_DOMAIN' }
      }
    

Upvotes: 0

Views: 28

Answers (0)

Related Questions