问题描述
我已经使用CORS在cordova Webview应用程序中实现了深层链接。与我的网站地址的任何链接都可以打开我的应用程序。在测试Deeplink时,将在我的应用程序中打开确切的URL,但在生产中,没有打开确切的URL。它只是打开应用程序的主页。
寻求任何帮助。下面的代码!
config.xml
<universal-links>
<host name="www.stalksnspice.com" scheme="https">
<path url="*" event="openSignInPage" />
</host>
</universal-links>
index.js
onDeviceReady: function() {
app.receivedEvent('deviceready');
// Here,we redirect to the web site.
var targetUrl = "https://www.stalksnspice.com/";
var bkpLink = document.getElementById("bkpLink");
bkpLink.setAttribute("href",targetUrl);
window.location.replace(targetUrl);
//Deep linking/Universal Url Code
universalLinks.subscribe('openSignInPage',app.onopenSignInPage);
},onopenSignInPage: function(eventData) {
console.log('Did launch app from the link: ' + eventData.url);
var targetUrl = eventData.url;
var bkpLink = document.getElementById("bkpLink");
bkpLink.setAttribute("href",targetUrl);
window.location.replace(targetUrl);
},
index.html
<body>
<a id="bkpLink" href="https://www.stalksnspice.com"></a>
<div class="app">
<div id="deviceready" class="blink">
<p class="event listening"></p>
<p class="event received"></p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)