【问题标题】:iOS Enterprise update integrationiOS 企业更新集成
【发布时间】:2017-10-27 13:11:03
【问题描述】:

案例:我正在为 Ionic 2 应用程序使用 iOS Enterprise Program。这种分发类型的问题之一是支持更新流。为了解决这个问题,我们在服务器端创建了简单的 JSON 来检查可用的更新。当更新可用时,用户会看到提示更新应用程序或退出的建议。

app.component.ts

    iosUpdateCheck() {
        this.http.get(`${this.config.iosEnterpriseEndpoint}latest.json`).map(res =>
          <{version: string}>res.json()).subscribe((res) => {

          if (res.version !== this.config.appVersionNumber) {
            this.message.alertCtrl.create({
              title: 'Update is available!',
              message: 'Please, update your terminal to proceed',
              buttons: [
                {
                  text: 'Update',
                  handler: () => {
                    console.log(this.TAG + 'iosUpdateCheck: update clicked');
//I tried just href also
                     window.window.open(`<a href=itms-services://?action=download-manifest&url=${this.config.iosEnterpriseEndpoint}manifest.plist />`,'_system');
                  }
                },
                {
                  text: 'Exit',
                  role: 'cancel',
                  handler: () => {
                    console.log(this.TAG + 'iosUpdateCheck: exit clicked');
                    this.platform.exitApp();
                  }
                },
              ]
            }).present();
          }
        });
      }

我还添加了config.xml&lt;allow-intent href="itms-services:*"/&gt;,但仍然出现同样的错误(抱歉截图,无法在 Safari 中复制错误链接): 如果我只使用一个链接,它可以正常工作,但不符合所追求的目标。

【问题讨论】:

  • 嘿,您找到解决方案了吗?我也面临同样的问题

标签: ios ionic-framework ionic2 ios-enterprise


【解决方案1】:

我认为这个 ionic-native 插件可能会对您有所帮助:Ionic Native Market plugin

安装:

ionic cordova plugin add cordova-plugin-market
npm install --save @ionic-native/market

不要将它添加到您的app.module

用法:

import { Market } from '@ionic-native/market';
constructor(private market: Market) { }

this.market.open('your.package.name');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多