是否可以在 ios 中使用相同的包 ID 进行开发和分发?

Is it possible to use same bundle ID for development and distribution in ios?

我在我的 android 和 ios 应用程序中使用 onesignal 插件推送通知,所以我想先在开发方面测试推送通知,然后我将把它上传到 ios应用商店。或者是否有任何最佳实践来实现 onesignal 推送通知首先进行测试然后分发。

个人意见,如果使用 APN,您不再需要单独 profiles/certificates 进行开发和生产。最近苹果做了一些改变。现在您只需要 'developer.apple.com' 帐户中的一个“.p8”推送通知证书。您将此 .p8 文件提供给您的后端团队。 Xcode 将自动管理您的生产和开发。

这是你必须做的才能让它发挥作用:

对于后端:

In your app delegate, inside the function where you get APNs token from apple. This APNs token will either be development or production. How does apple decide, which one to give? Well when you export an IPA/App locally, or upload it on test flight or on App store, Xcode will automatically give you production push notification APNs. When you install IPA/App locally using xcode to a phone connected to xcode or on simulator, Xcode will automatically give you development/staing push notification APNs token inside that function. And at that point you just have to send that token to your backend.

后端如何检查他们获得的用户令牌是生产令牌还是开发令牌?

Using your URL, if it is staging, it will consider it as development APNs token. If it is production URL, it will consider it as production APNs token.

您需要确定什么?

Make sure the Base URL is set to production if you are uploading app to test flight. Make sure the Base URL is set to development if you are running app locally on simulator or your phone connected to your xcode.