简体   繁体   English

Chrome自定义标签

[英]Chrome Custom Tabs

Today I tried (unsucessfully) to implent the Chrome Custom Tabs in my app, the idea was to try to use them and fallback to a webview in case, but I am stuck to opening them: here is what I tried 今天,我尝试(未成功)在我的应用程序中启用Chrome自定义标签 ,其目的是尝试使用它们并退回到Web视图,以防万一,但是我坚持打开它们:这是我尝试过的

var intent = Ti.Android.createIntent({
        action: Ti.Android.ACTION_VIEW,
        data: 'http://www.google.com',
        packageName: 'com.android.chrome'
    });
    intent.putExtra('android.support.customtabs.extra.SESSION', null);
    Ti.Android.currentActivity.startActivity(intent);

What it does is simply opening the page on chrome (so, the same thing that I can do with Ti.Platform.openURL but only for android); 它的作用只是在chrome上打开页面(因此,我可以使用Ti.Platform.openURL进行相同操作,但仅适用于android); am I missing something? 我错过了什么吗? Do someone know of a module/widget ala Ti.safariDialog ? 有人知道模块/小工具ala Ti.safariDialog吗?

The implementation guide uses putBinder where you use putExtra so I guess that's the issue. 实施指南在您使用putBinder地方使用了putExtra所以我想这就是问题所在。 Titanium currently doesn't expose putBinder so you'd have to request that to be added in a JIRA ticket Titanium当前不公开putBinder因此您必须请求将其添加到JIRA票证中

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

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