简体   繁体   English

如何使用Worklight和Ionic框架从另一个混合应用程序中打开预安装的应用程序

[英]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.

相关问题 Worklight(6.1v)混合应用程序-需要从我的应用程序中打开其他应用程序 - Worklight(6.1v) hybrid app - need to open other application from my app 有什么方法可以使用Worklight 6.2或phonegap混合应用程序从android和ios中的另一个应用程序启动一个应用程序吗? - Is there any way to launch one application from another application in android and ios using worklight 6.2 or phonegap hybrid applications? 如何从离子应用程序打开另一个应用程序? - How to open another app from ionic app? 如何使用Worklight和Cordova插件从混合应用程序中的通知中获取数据 - How to get data from notifications in hybrid app using Worklight and Cordova plugin 使用离子框架的Android Hybrid App中文本看起来模糊且便宜 - Text looks Blurred and cheap In Android Hybrid App using ionic framework 如何从Ionic框架中的预构建应用程序中提取控制器和视图? - how to extract controllers and views from the pre-built app in the Ionic framework? 使用Cordova和Ionic框架并为移动,平板电脑和台式机编写CSS的混合应用程序 - Hybrid application using Cordova and Ionic framework and writing CSS for Mobile, Tablet and Desktop 如何在离子应用程序中打开Facebook外部应用程序 - how to open facebook external application in ionic app 离子混合应用程序-从服务器关闭窗口 - ionic hybrid app - close window from server 使用基于Cordova框架开发的混合应用程序打开默认邮件应用程序 - Open default mail app from a hybrid app developed with a framework based on cordova
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM