1
Ionicフレームワークを使用してAndroid APPを作成しています。私のアプリから外部アプリを起動したいと思います。 Appから外部アプリを起動する
は私が<access origin="speedtest:*" launch-external="yes"/>
私は私のapp.js
function onDeviceReady() {
var scheme;
// Don't forget to add the org.apache.cordova.device plugin!
if(device.platform === 'iOS') {
scheme = 'speedtest://';
}
else if(device.platform === 'Android') {
scheme = 'org.zwanoo.android.speedtest';
}
$scope.btnClick = function() {
appAvailability.check(
scheme, // URI Scheme
function() { // Success callback
window.open('speedtest://', '_system', 'location=no');
console.log('Speedtest is available');
},
function() { // Error callback
//alert("not available");
window.open('https://play.google.com/store/apps/details?id=org.zwanoo.android.speedtest', '_system', 'location=no');
console.log('Speedtest is not available');
}
);
}
}
次の行では、次のコード
<button class="button button-positive" ng-click="btnClick()"> Launch Speed Test</button>
を使用していますconfig.xmlのアクセスも-orginを含みます動作しておらず、コンソールにエラーがスローされません。
window.open('speedtest://', '_system', 'location=no');
私をご案内ください。
トライホワイトリストの
チェックアプリケーション - https://cordova.apache.org/docs/en/latest/guide/appdev/whitelist/index .html –