1

I have setup a deep link in android react native. I wanted to skip the options menu when click on the link, for that I have added .well-known/assetlinks.json file over my domain address. I can see no errors when I verify using this , no error is shown.

assetlinks.json file:

[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
 "namespace": "android_app",
 "package_name": "<package-name>",
 "sha256_cert_fingerprints": [<SHA>]
 }
}]

Response of digitalassetlinks

{
 "statements": [
 {
   "source": {
    "web": {
      "site": "<domain>."
    }
  },
  "relation": "delegate_permission/common.handle_all_urls",
  "target": {
    "androidApp": {
      "packageName": "<package-name>",
      "certificate": {
        "sha256Fingerprint": "<SHA>"
      }
    }
  }
}
],
"maxAge": "59.999586063s",
"debugString": "********************* ERRORS 
*********************\nNone!\n********************* INFO MESSAGES *********************\n* 
Info: The following statements were considered when processing the request:\n\n---\nSource:

AndroidManifest:

<intent-filter android:label="@string/app_name" android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="http" android:host="domain" />
            <data android:scheme="https" />
</intent-filter>

MainActivity.java

public class MainActivity extends ReactActivity {

/**
 * Returns the name of the main component registered from JavaScript.
 * This is used to schedule rendering of the component.
 */
@Override
protected String getMainComponentName() {
    return "<package-name>";
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
        @Override
        protected ReactRootView createRootView() {
            return new RNGestureHandlerEnabledRootView(MainActivity.this);
        }
    };
}

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // ATTENTION: This was auto-generated to handle app links.
    Intent appLinkIntent = getIntent();
    String appLinkAction = appLinkIntent.getAction();
    Uri appLinkData = appLinkIntent.getData();
    }
}

FYI: When did the recommended exercise for IOS, it's working fine.

高鵬翔
  • 1,997
  • 2
  • 8
  • 21
Mukul Aggarwal
  • 1,515
  • 20
  • 16

1 Answers1

0

Interestingly, I come to know that domain name should include www So, previously when i tried with xyz.com it's not working with the above configuration and when I change to domain in Android manifest to www.xyz.com, it worked.

But, still I don't know why it worked for www.

Mukul Aggarwal
  • 1,515
  • 20
  • 16