在Android / iOS的执行与离子外部应用 [英] executing external apps on Android/iOS with Ionic

查看:178
本文介绍了在Android / iOS的执行与离子外部应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序离子我尝试只是每按一下按钮执行各种应用程序。下面的函数launchs在Android和iOS的Skype。通过Skype的URI为Androis是 com.skype.raider 和iOS版 SKYPE://

In my Ionic app I try to execute various apps just per button click. The following function launchs Skype on Android and iOS. The URI from Skype for Androis is com.skype.raider and for iOS is skype://

function launchSkype() {
    var scheme;

    if (device.platform === 'iOS') {
        scheme = 'skype://';
    } else if (device.platform === 'Android') {
        scheme = 'com.skype.raider';
    } else if (device.platform === 'wp') {
        scheme = 'skype:';
    } else if (device.platform === 'windows8') {
        scheme = 'skype:';
    }

    navigator.startApp.check(scheme, function(message) { /* success */
        navigator.startApp.start(scheme, function(message) {
        }, function(error) { /* error */
            alert("Skype could not be started!");
        });
    }, function(error) {
        alert("Skype is not installed!");
    });
}

找到相应的应用程​​序的意图链接(URI),并在Android / iOS的运行这些是非常重要的。 我在寻找的iOS 的URI链接的困难。在Android上,很容易找到。在谷歌播放各自的应用程序ID是在地址栏中找到。

It's important to find the Intent links (URI) of the respective applications and run these on Android/iOS. I have difficulties in finding the URI links of iOS. On Android, it is easy to find. On Google Play the respective App ID is to find in the address bar.

我的问题是,我在哪里可以找到的iOS应用程序的应用ID发动?我会利用其他应用程序相同的功能。我只是需要的ID。

My question is, where can I find the app ids of iOS applications for launching? I'll have the same function exploited for other apps. I just need the ids.

我需要例如,对于$ P $这些(本机)应用程序的执行pcisely的ID:

I need eg for precisely the Ids of these (native) app for the execution:


  1. URI本土电子邮件应用程序的(的Andr​​oid / iOS版)

  2. URI本地地址簿的(的Andr​​oid / iOS版)

  3. 的本地URI我的文档(的Andr​​oid / iOS版)

编辑:

所以,我找到一个名为Android的一个应用程序的包名称查看器这给所有安装的应用程序包的名称。是否有适用于iOS类似的东西?随着应用程序,我已经找到了以下包名称:

So, i find a app for android named Package Name Viewer which give the package name of all installed apps. Is there something similar for iOS? With the app I have found the following package name:


  1. com.android.email

  2. com.android.contacts

  3. com.sec.android.app.myfiles

  1. com.android.email
  2. com.android.contacts
  3. com.sec.android.app.myfiles

第二点,所以 com.android.contacts 不直接显示在Android上的联系人。哪个环节会显示直接在设备上存储的联系人是否正确?

The second point, so com.android.contacts doesn't show directly to the contacts on Android. Which link would be correct that displays directly stored contacts on the device?

推荐答案

的iOS不允许这种行为。已经有努力,试图绕过这一点,并根据这个StackOverflow的答案 [1]你可以尝试看看如果URI可以打开

iOS does not allow this behaviour. There has been efforts to try to circumvent this, and as according to this stackoverflow answer[1] you can just try to see if the URI can be opened

从对方的回答引:


      
  • 如果应用程序是已知的,以处理特定类型的网址

  •   
  • 通过使用[[UIApplication的sharedApplication] canOpenURL:[NSURL URLWithString:@thisapp://富]

  •   

您可以从这里 应用程序和URL方案的列表。

You can get a list of apps and URL schemes from here.

这篇关于在Android / iOS的执行与离子外部应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆