我正在使用 AngularJS 和 Trigger.io 来开发适用于 iOS 和 Android 的移动应用程序。
当我尝试打开如下所示的链接时:
<a ng-href="#/offers/{{featured_offer.Id}}"></a>
它在 iOS 上运行良好,但在 Android 上我在触发器控制台中收到此消息,并且链接未导航至:
[WARNING] Attempted to open a URL which could not be handled: unsafe:content://io.trigger.forge722b6464a0e211e2ba9d12313d00dc45/src/index.html#/offers/8
我怎样才能让它在 Android 中像在 iOS 中一样工作?
最佳答案
看起来 Angular 添加了 unsafe: 到它无法识别的 url schemes,我想你想包括类似的东西:
app.config(function($compileProvider){
$compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|content):/);
});
将 content: 添加到接受的 url 方案中。
关于android - Angular Js 和 Trigger.io - 无法点击适用于 iOS 的 Android 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16130902/