xcodebuild未签名IPA-缺少推送通知权利(在XCode中直接对应用程序进行签名时有效) [英] xcodebuild Unsigned IPA - Missing Push Notification Entitlement (Work when signing directly the App in XCode)

查看:175
本文介绍了xcodebuild未签名IPA-缺少推送通知权利(在XCode中直接对应用程序进行签名时有效)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文: XCODE 12.0.1

我在Ionic中使用推送通知".配置确定.我在签名和功能中添加了推送通知功能.我构建了我的应用程序,并做了 npx cap open ios ,然后做了 Product>存档,然后要求我对应用程序进行签名,然后对它进行签名,然后单击确定.当我测试通知时,一切正常.

问题:我需要为我的客户端生成带有xcodebuild 的 unsigned IPA.他想亲自签字.但是,当我生成 xcarchive (未签名的IPA)时,他告诉我,签名后,通知不起作用,当他尝试将其上载到App Store时,他收到了以下消息:

缺少推送通知权利-您的应用似乎已在Apple推送通知服务中注册,但应用签名的权利不包括"aps-environment"权利.如果您的应用程序使用Apple Push Notification服务,请确保在Provisioning Portal中为您的Push ID启用了您的App ID,并在使用包含"aps-environment"权利的Distribution Provisioning配置文件对您的应用程序进行签名后重新提交.Xcode不会在构建时自动从供应配置文件复制aps环境权利.此行为是故意的.要使用此权利,请在项目编辑器的功能"窗格中启用推送通知",或将权利手动添加到您的权利文件中.有关更多信息,请参见这个文件看起来像这样:

 <?xml version ="1.0"encoding ="UTF-8"?<!DOCTYPE plist PUBLIC-//Apple//DTD PLIST 1.0//EN";"http://www.apple.com/DTDs/PropertyList-1.0.dtd">< plist version ="1.0">< dict><密钥>应用程序标识符</密钥>< string> ** TEAMID *.* APP-ID *</string>< key> aps-环境</key><字符串>生产</字符串>< key> com.apple.developer.applesignin</key>< array>< string>默认</string></array>< key> com.apple.developer.team-identifier</key>< string> **团队ID **</string>< key>获取任务允许</key>< false/>< key>钥匙串访问组</key>< array>< string> TeamID.*</string>< string> com.apple.token</string></array></dict></plist> 

但是我可以在正常签名"在 embedded.mobileprovision 文件上的ipa,有 entitlements 部分,其中包含以下几行...我不明白为什么这个工具起作用了

解决方案

我终于解决了我的问题.我用于生成xcarchive的命令行是错误的.通过在没有"SIGNING"标志的情况下测试此行,我才很幸运.参数:

xcodebuild -workspace ios/App/App.xcworkspace -allowProvisioningUpdates -scheme App -sdk iphoneos -configuration Release -destinationgeneric/platform = iOS -archivePath output/ios/App.xcarchive archive >

我在某些中型"页面中找到了这些参数,但我不知道为什么要使用它们.

Context : XCODE 12.0.1

I'm using Push Notifications in Ionic. The configuration is OK. I added the Push Notification Capability in Signing and Capabilities . I build my app and I do npx cap open ios, and I do Product > Archive and then it asks me to sign the app, I sign it, and OK. When I test Notifications, everything works well.

Problem : I need to generate unsigned IPA with xcodebuild for my client. He wants to sign it himself. But when I generate the xcarchive (unsigned IPA), then he tells me that after signing it, Notifications don't work, and he received this message when he tried to upload it on App Store :

Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the 'aps-environment' entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the 'aps-environment' entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

How I generate the xcarchive : xcodebuild -workspace ios/App/App.xcworkspace -allowProvisioningUpdates -scheme App -sdk iphoneos -configuration Release -destination generic/platform=iOS -archivePath output/ios/App.xcarchive archive CODE_SIGNING_REQUIRED="NO" CODE_SIGNING_ALLOWED="NO"

Signing manually or automatically don't solve the problem.

Do you know why I get these errors when using xcodebuild (App Store Error, Push Notification Error) ?

It looks a little bit like this problem : Missing Push Notification Entitlement: While Resigining ipa

Do you know if i'm using xcodebuild the wrong way?

EDIT 1 : If I use this software https://github.com/maciekish/iReSign , to resign my xcarchive, it works... But clients won't agree to use some mystical softwares. I tried to compare my "normally XCODE signed" .ipa with the .ipa signed by this software. The only thing that differs is that there is an entitlements.plist file in the folder in the second case. And this file looks like this :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>**TEAMID*.*APP-ID*</string>
    <key>aps-environment</key>
    <string>production</string>
    <key>com.apple.developer.applesignin</key>
    <array>
        <string>Default</string>
    </array>
    <key>com.apple.developer.team-identifier</key>
    <string>**TEAM ID**</string>
    <key>get-task-allow</key>
    <false/>
    <key>keychain-access-groups</key>
    <array>
        <string>TeamID.*</string>
        <string>com.apple.token</string>
    </array>
</dict>
</plist>

But I can find this in the "normally signed" ipa on the embedded.mobileprovision file, there is the entitlements section containing these lines... I can't understand why this tool made it work

解决方案

I finally solved my problem. The command line I used for generating the xcarchive was wrong. I just had luck by testing this line without the "SIGNING" parameters :

xcodebuild -workspace ios/App/App.xcworkspace -allowProvisioningUpdates -scheme App -sdk iphoneos -configuration Release -destination generic/platform=iOS -archivePath output/ios/App.xcarchive archive

I found these parameters in some Medium page, and I don't know why I was using them.

这篇关于xcodebuild未签名IPA-缺少推送通知权利(在XCode中直接对应用程序进行签名时有效)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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