[英]How to redirect to an Ionic app's base URL?
I am building an app using the Ionic platform. 我正在使用Ionic平台构建应用程序。
I have a requirement which follows the following flow: 我有一个遵循以下流程的要求:
app home -> external link ---> unknown process flow ---> app home app home->外部链接--->未知流程---> app home
A redirection on the client is triggered in the process of the external link process flow, this is where I need to provide the app's home page. 在外部链接流程中触发客户端重定向,这是我需要提供应用程序主页的位置。
What URL should I be using to redirect to the app's home page. 我应该使用哪个URL重定向到应用程序的主页。
Things I have tried: 我尝试过的事情:
I used 我用了
window.location.origin + "/#/app/home"
window.location.origin +“ /#/ app / home”
which worked for development. 为发展而努力。
However this fails in the actual app. 但是,这在实际应用中失败。
I basically need to provide a URL that loads the app's home page to the web view. 我基本上需要提供一个URL,以将应用程序的主页加载到Web视图。
I think this plugin does exactly what you need: 我认为这个插件完全可以满足您的需求:
https://github.com/EddyVerbruggen/Custom-URL-scheme/blob/d1432ecfff63678a3155804839dda21607706e72/README.md https://github.com/EddyVerbruggen/Custom-URL-scheme/blob/d1432ecfff63678a3155804839dda21607706e72/README.md
Old question, but unanswered. 旧问题,但未回答。
I was working on this... Run your app then run chrome remote, there, you should see the url. 我正在做这个...运行您的应用程序,然后运行chrome remote,在那里,您应该看到url。 Basically, with ionic this is what I figured out how to redirect to base url
基本上,使用ionic,这就是我想出的方法如何重定向到基本URL
$scope.goHome = function() {
window.open('file:///android_asset/www/index.html#/app/home', '_self')
}
You're going to need to figure out folder escaping (if you have any) but this can get you going. 您将需要弄清楚文件夹转义(如果有),但这可以助您一臂之力。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.