help with UCB for iOS with remote push notifications enabled

The crazy thing is I’ve done this twice before but it has been so long since then that I’ve completely forgotten how and where I found out. Is there a step by step guide on how to?

I have UCB working fine for iOS. And remote push notifications work fine when building locally (both with development and distribution profiles). The problem I run into with enabling push notifications for my ios cloud build is that when I try to pair my provisioning profile with the p12 of my certificate it says its a mismatch. Which certificate(s) do I export?

As of now, I have my distribution provisioning profile has Push Notifications in it’s Enabled Services. But when I use my distribution certificate with that and register for push notifications in my game I get

Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment'

All my certificates and provisioning profiles are valid. My provisioning profiles are also marked to allow push notifications. And like I said before, remote push notifications work with my provided profiles locally on both dev and distribution.

Thanks for your time and I hope this could help others as well!

The .p12 came from your developper or distribution certificate.
You must export the private key on your mac you use to generate the certificate.
If you use an AdHoc provisioning profile you must export the private key of your distribution certificate.

Here are instructions for building iOS with UCB Unity ID which includes information about provisioning and certificates

Let me know if you need any other info!

  • Sophia

I must be doing something wrong. I followed the tutorial and my ios cloud builds work fine. They always had even before I added remote push notifications. But I still get the same error when trying to register for remote push notifications.

Now, I get the same error when I test on my local build. But that was due to my Capabilities not having “Push Notifications” toggled on. Then it works fine provided my backend is using my Development Push Certificate.

So my hunch is that I need to somehow turn my iOS build’s xcode capabilities Push Notifications’ toggle in unity cloud to on?

Ok! I actually got it working thanks to this thread. Just follow the directions and in my case, change “development” to “production” in the entitlement file.

2 Likes