Cordova:android 和 ios 平台可以有不同的应用程序 ID 吗? [英] Cordova: Is it possible to have different app IDs for android and ios platforms?

查看:8
本文介绍了Cordova:android 和 ios 平台可以有不同的应用程序 ID 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个 ID 为 com.StackOverflowExample.MyQuestion 的 Cordova 应用程序,它是我使用 CLI(cordova create)使用 Cordova 3 创建的.我为我的应用添加了 iOS 和 Android 平台,并将应用提交给 Apple 和 Google Play.然而,现在,在将我的应用程序提交到 Play 之后,我似乎把我用来签署我的 APK 文件的密钥库的密码放错了位置.我已经尝试了所有方法,但我无法恢复它.

Let's say I have a Cordova application with an id of com.StackOverflowExample.MyQuestion, which I created with Cordova 3 using the CLI (cordova create). I have added iOS and Android platforms for my app, and have submitted the app to Apple and to Google Play. Now, however, after submitting my app to Play, I seem to have misplaced my password for the keystore I used to sign my APK file. I have tried everything, and there is no way I will recover it.

由于 Google Play 不允许我在与之前由不同密钥库签名的 APK 相同的应用 ID 下对提交给 Play 的后续 APK 进行签名,因此我知道我需要创建一个新的应用 ID 并在 Android 中重新开始.我知道这需要我的用户下载一个新的应用程序,但我现在别无选择.

Because Google Play does not allow me to sign a subsequent APK submitted to Play under the same app ID as a prior APK signed by a different keystore, I know I need to create a new app ID and start over in Android. I realize this will require my users to download a new application, but I have no other choice at this point.

我想要避免的是,这个问题会蔓延到 Apple,在那里我已经创建了我的所有证书、配置文件、密钥、签名请求等,并上传了一个 IPA,其包标识符与我提交给 Google Play 的第一个 APK 的应用 ID.

What I would like to avoid, is having this problem spill over into Apple, where I have already created all of my certificates, provisioning profiles, keys, signing requests, etc. and uploaded an IPA with a bundle identifier the same as the app ID of the first APK I submitted to Google Play.

默认情况下,在使用 CLI 时,Cordova 会使用您在运行 cordova create 时提供的单个应用 ID 添加您指定的任何平台.

By default, when using the CLI, Cordova adds whatever platforms you specify using a single app ID, which you supply when you run cordova create.

我想知道的是:是否可以在运行 cordova platform add 时在 custom 下添加新平台app ID,因此,不同平台在同一个 Cordova 应用程序中有不同的 app ID?

What I'd like to know is: Is it possible, when running cordova platform add to add a new platform under a custom app ID, and, as a result, to have different platforms have different app IDs within the same Cordova application?

推荐答案

现在已经内置到 CLI 中了(终于):

This is now built into CLI (finally):

在你的 config.xml 文件中-

In you your config.xml file-

例子:

<widget
    android-packageName="com.example.android"
    ios-CFBundleIdentifier="com.example.ios">

来源:

https://github.com/apache/cordova-lib/blob/master/cordova-common/src/ConfigParser/ConfigParser.js#L99

这篇关于Cordova:android 和 ios 平台可以有不同的应用程序 ID 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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