我需要创建一个深度链接,允许用户从外部单击它(如电子邮件或浏览器),然后将其重定向到
my-app.blablabla.com://path-to-route
.我已经创建了一个有效的深度链接,但它总是在我的应用程序主页中重定向用户(比如
my-app.blablabla.com://
)。有没有一种方法可以通过深连接的路径?事先谢谢。
附言:我也试过在app.component.ts中找到推荐人,但总是这样。
PPS:是
path-to-route
根本不考虑。如果应用程序存在或不存在,则在主页中打开。
我用的是安古拉2和科尔多瓦。
这是Cordova配置:
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="20405" android-versionName="2.04.05" id="my-app.blablabla.com" ios-CFBundleShortVersion="20405" ios-CFBundleVersion="2.04.05" version="20405" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Myapp</name>
<description>
My app
</description>
<author email="luca.taccagni@hotmail.it" href="http://www.myapp.it">
Luca Taccagni
</author>
<content src="index.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="BackupWebStorage" value="local" />
<preference name="permissions" value="none" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="android-windowSoftInputMode" value="stateVisible|adjustResize" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-installLocation" value="auto" />
<preference name="SplashScreen" value="resources/browser/screen/Default-Portrait-736h@3x.png" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="3000" />
<platform name="browser">
<preference name="SplashScreen" value="res/browser/screen/Default-Portrait-736h@3x.png" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="SplashScreenBackgroundColor" value="green" />
<preference name="ShowSplashScreen" value="true" />
<preference name="SplashScreenWidth" value="600" />
<preference name="SplashScreenHeight" value="300" />
</platform>
<platform name="ios">
</platform>
<platform name="android">
<icon density="mdpi" src="www/res/icon/android/icon-48-mdpi.png" />
<icon density="hdpi" src="www/res/icon/android/icon-72-hdpi.png" />
<icon density="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" />
<splash density="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" />
<splash density="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" />
<splash density="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" />
</platform>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
<param name="onload" value="true" />
</feature>
<universal-links>
<host name="abc123.app.goo.gl" scheme="https" />
<host name="myapp.firebaseapp.com" scheme="https">
<path url="/__/auth/callback" />
</host>
</universal-links>
<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="data:*" />
<allow-intent href="geo:*" />
<allow-navigation href="about:blank" />
<allow-navigation href="https://myapps.bla.it/*" />
<allow-navigation href="http://myapps.bla.it/*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<hook src="hooks/buildApp.js" type="before_prepare" />
<preference name="DisallowOverscroll" value="true" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-browsertab" spec="^0.2.0" />
<plugin name="cordova-plugin-buildinfo" spec="^2.0.1" />
<plugin name="cordova-plugin-customurlscheme" spec="^4.3.0">
<variable name="URL_SCHEME" value="my-app.blablabla.com" />
<variable name="ANDROID_SCHEME" value="https" />
<variable name="ANDROID_HOST" value="my-app.blablabla.com" />
<variable name="ANDROID_PATHPREFIX" value="/" />
<!-- already tried to put something here -->
</plugin>
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
<plugin name="cordova-plugin-ios-safari" spec="git+https://github.com/morungos/cordova-plugin-ios-safari.git" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-universal-links-plugin" spec="^1.2.1" />
</widget>