我一个接一个地遵循这里的步骤。但是第7步有个问题。
步骤7:
<universal-links>
<host name="DYNAMIC_LINK_DOMAIN" scheme="https" />
<host name="AUTH_DOMAIN" scheme="https">
<path url="/__/auth/callback"/>
</host>
</universal-links>添加config.xml时,"cordova run android“不起作用。
Config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.twobuddy.hybrtnkk" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>NeKadarKaldi</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<preference name="AndroidLaunchMode" value="singleTask" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-x-socialsharing" spec="^5.4.0" />
<plugin name="cordova-plugin-buildinfo" spec="^2.0.1" />
<plugin name="cordova-plugin-browsertab" spec="^0.2.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<plugin name="cordova-plugin-customurlscheme" spec="^4.3.0">
<variable name="URL_SCHEME" value="com.twobuddy.hybrtnkk" />
<variable name="ANDROID_SCHEME" value=" " />
<variable name="ANDROID_HOST" value=" " />
<variable name="ANDROID_PATHPREFIX" value="/" />
</plugin>
<universal-links>
<host name="DYNAMIC_LINK_DOMAIN" scheme="https" />
<host name="AUTH_DOMAIN" scheme="https">
<path url="/__/auth/callback"/>
</host>
</universal-links>
<plugin name="cordova-universal-links-plugin" spec="^1.2.1" />
<engine name="ios" spec="^4.5.4" />
<engine name="android" spec="^7.0.0" />
</widget>发布于 2018-08-23 16:33:37
尝试使用通用链接插件的修改版本。在这里可以找到https://github.com/walteram/cordova-universal-links-plugin
用cordova plugin add https://github.com/walteram/cordova-universal-links-plugin.git安装它
这对我有用!
我在这里找到了答案https://github.com/nordnet/cordova-universal-links-plugin/issues/133
发布于 2019-09-09 16:49:25
我正在使用PhoneGap构建。问题是通用链接标签没有复制到AndroidManifest.xml中.所以解决办法是
顶部的小部件标记中的添加
xmlns:android="http://schemas.android.com/apk/res/android"添加下面的代码在config.xml中的任何地方,我喜欢在插件之前或者在unvirsal标记旁边。
<config-file target="AndroidManifest.xml" parent="/manifest/application/activity">
<intent-filter 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:host="****-***.firebaseapp.com" android:pathPrefix="/__/auth/callback" android:scheme="https" />
</intent-filter>
</config-file>现在,当应用程序是使用phonegapbuild或本地cordova CLI构建时,它会复制本应在清单文件中的通用链接数据。当应用程序运行并调用firebase.auth().getRedirectResult()时,它不会产生任何错误,比如
8月/被用户取消。重定向在最后定稿之前被用户取消了。
用户使用cordova CLI构建应用程序,请在运行cordova构建android之后,确保清单文件中的activity下面有上面的意图过滤器标签。
https://stackoverflow.com/questions/51001567
复制相似问题