简体   繁体   English

Trigger.io:在Android上使用网络浏览器打开网址

[英]Trigger.io: Open url with web browser on Android

I have created a button "Share on Twitter" which opens up the url to share on twitter in mobile web browser this works fine on iOS but does nothing on Android. 我创建了一个“在Twitter上共享”按钮,该按钮打开了要在移动网络浏览器中在Twitter上共享的URL,这在iOS上工作正常,但在Android上却没有任何作用。

Is there something I am missing or don't know about? 有什么我想念或不知道的东西吗?

    var send = 'http://twitter.com/share';
    var url =  'http://example.com/';
    var text = "Example Text";
    var openURL = send + "?url=" + url + "&text=" + text;
    window.open(openURL, '_blank'); // opens url

Nothing happens on Android but works fine on iOS. 在Android上没有任何反应,但在iOS上运行良好。

In Trigger apps external pages will by default open in the devices browser, this means you can simply run 在触发器应用程序中,默认情况下,外部页面将在设备浏览器中打开,这意味着您只需运行

window.location = 'http://google.com'

to open an external url in the browser. 在浏览器中打开外部网址。

If you want a link the user can click then 如果您想要一个链接,用户可以单击

<a href="http://google.com>Click here</a>

Will also open in the devices browser. 还将在设备浏览器中打开。

If you want the user to browse an external website within your app you can use the tabs module to open a modal browser window the user can close and return to your app. 如果希望用户浏览应用程序中的外部网站,则可以使用选项卡模块打开模式浏览器窗口,用户可以关闭并返回到您的应用程序。 See https://trigger.io/docs/current/api/modules/tabs.html 参见https://trigger.io/docs/current/api/modules/tabs.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM