app-launcher-android-ios
1.0.1 • Public • Published
npm i app-launcher-android-ios
import * as launcher from 'app-launcher-android-ios';
launchExternalApp(iosSchemaName: string, androidPackageName: string, httpUrl: string,
httpUrliOS: string, httpUrlAndroid: string) {
let app: string;
if (this.isIos()) {
app = iosSchemaName;
} else if (this.isAndroid()) {
app = androidPackageName;
} else {
// 일반 브라우져로 open
// this.iab.create(httpUrl);
return;
}
this.appAvailability.check(app).then(
() => {
// 앱 실행
if (this.isIos()) {
launcher.uriLaunch(app);
}
else if (this.isAndroid()) {
launcher.packageLaunch(app);
}
},
() => {
// 앱이 없으면 마켓으로 이동
if (this.isIos()) {
this.iab.create(httpUrliOS);
}
else if (this.isAndroid()) {
this.iab.create(httpUrlAndroid, '_system');
}
}
);
}
Readme
Keywords
nonePackage Sidebar
Install
npm i app-launcher-android-ios
Weekly Downloads