[英]How to open the pre installed app from the another hybrid application using worklight and ionic framework
I have a requirement to open the waze application which should be installed in mobile device when the another hybrid app's button click event is fired. 我需要打开在另一个混合应用程序的按钮单击事件触发时应在移动设备中安装的位智应用程序。 I don't have any idea on this.
我对此一无所知。
For this requirement i have to use worklight 6.3 & ionic framework. 对于此要求,我必须使用Worklight 6.3和离子框架。
Any help is appreciated. 任何帮助表示赞赏。
Your requirement has got nothing to do with Ionic. 您的要求与Ionic无关。
You also did not mention if this is for Android or iOS. 您也没有提到这是用于Android还是iOS。
Anyway, you can look at the following "regular" Hybrid project: https://www.dropbox.com/s/6fgtjhzgvl6p9n0/OpenExternalApplication.zip?dl=0 无论如何,您可以查看以下“常规”混合项目: https : //www.dropbox.com/s/6fgtjhzgvl6p9n0/OpenExternalApplication.zip?dl=0
It contains the needed native code to open an existing (already installed) app (Waze) in iOS. 它包含在iOS中打开现有(已安装)应用程序(Waze)所需的本机代码。
Part of the code: 部分代码:
- (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.