![](/img/trans.png)
[英]Worklight(6.1v) hybrid app - need to open other application from my app
[英]How to open the pre installed app from the another hybrid application using worklight and ionic framework
我需要打開在另一個混合應用程序的按鈕單擊事件觸發時應在移動設備中安裝的位智應用程序。 我對此一無所知。
對於此要求,我必須使用Worklight 6.3和離子框架。
任何幫助表示贊賞。
您的要求與Ionic無關。
您也沒有提到這是用於Android還是iOS。
無論如何,您可以查看以下“常規”混合項目: https : //www.dropbox.com/s/6fgtjhzgvl6p9n0/OpenExternalApplication.zip?dl=0
它包含在iOS中打開現有(已安裝)應用程序(Waze)所需的本機代碼。
部分代碼:
- (void)openApp:(CDVInvokedUrlCommand*)command {
NSString *wazeAppURL = @"waze://";
NSString *mapsAppURL = @"maps://";
BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:wazeAppURL]];
NSString *url = canOpenURL ? wazeAppURL : mapsAppURL;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
NSString *responseString =
[NSString stringWithFormat:@"OK"];
CDVPluginResult *pluginResult =
[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:responseString];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.