With Xcode 10.3 (haven’t tried a different Xcode version yet) I’m not able to enable Push Notifications Capabilities in an OnPostProcessBuild() method.
I tried several different attempts on a local builds to examine the XCode project:
I tried ProjectCapabilityManager.AddPushNotifications() and PBXProject.AddCapability(guid, PBXCapabilityType.PushNotifications). But when opening the XCode Project, Push Notifications Capabilites are not set. Whereas the Background Mode Capability (which is needed for Push Notifications as well) gets set correct.
I also tried changing the Info.plist by adding a UIBackgroundModes Array and into that a remote-notification String.
I also created a fresh empty Unity Project and created the XCode project from within. Then I diffed the whole XCode project with and without Push Notifications enabled in XCode’s Capabilites section.
There changed two things: the UIBackgroundModes Array with the remote-notification string gets added to the Info.plist. And also something changed in a binary file of XCode.
So my suspicion is, that UCB does not handle this binary change I observed?
Currently I would say that UCB cannot be used if the iOS project does need Push Notifications.
Or is there any other way to activate Push Notifications Capability with UCB?
Thank you for any help.