我已经在android react原生中设置了一个深层链接。我想跳过选项菜单时,点击链接,因为我已经添加了.well-known/assetlinks.json文件超过我的域地址。当我使用this验证时,我看不到任何错误,没有显示任何错误。
assetlinks.json文件:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "<package-name>",
"sha256_cert_fingerprints": [<SHA>]
}
}]数字资产链接的响应
{
"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();
}
}仅供参考: IOS的推荐练习是什么时候进行的,运行良好。
发布于 2020-06-04 22:09:31
有趣的是,我知道域名应该包括www,所以,以前当我尝试使用xyz.com时,上面的配置不起作用,当我在安卓清单中将域名改为www.xyz.com时,它起作用了。
但是,我仍然不知道为什么它在www上起作用。
https://stackoverflow.com/questions/62165119
复制相似问题