|
发表于 2017-9-29 15:27:36
|
显示全部楼层
CSP - or: handleOpenURL doesn't work
The Whitelist plugin will prevent inline JS from executing, unless you whitelist the url scheme. Please see this SO issue for details.
Meteor / getLastIntent (Android only)
When running a meteor app in the cordova environment, handleOpenURL doesn't get called after a cold start, because cordova resets the javascript world during startup and our timer waiting for handleOpenURL gets vanished (see #98). To get the intent by which the app was started in a meteor cordova app you need to ask for it from the meteor side with getLastIntent like this.
Meteor.startup(function() {
if (Meteor.isCordova) {
window.plugins.launchmyapp.getLastIntent(function(url) {
if (intent.indexOf('mycoolapp://' > -1)) {
console.log("received url: " + url);
} else {
return console.log("ignore intent: " + url);
}
}, function(error) {
return console.log("no intent received");
});
return;
}
});
当运行Cordova应用程序时,handleOpenURL在冷启动后不会被调用,因为cordova在启动期间重置了JavaScript环境,为了获得应用程序在cordova应用程序中启动的intent参数,您需要通过getLastInten获取。
|
|