When I updated to Xcode 13.2.1 ios 15.2 I found my pushKit not working anymore. After testing, it is found that everything is normal in the debug state, the installation package made with Ad hoc does not work properly, I cannot get the token, and there is no response when I use the previous token to push. I tried to write a simple test code in AppDelegate, it works fine in ad hoc state, and the logic implemented is not significantly different from what I used before. So is there anything in the latest update that could cause this kind of problem?
Pushkit not work at Ad hoc mode
Sorry for the stupid miscommunication question...
It is possibly a bit too late to reply, but still.
1st of all, PushKit is definitely works fine with adhoc builds. I am pretty confident it is, as soon as I am using adhoc builds on a regular basis with one of my apps. The issue is not with the build type - should be in the code changes you made, profiles you're generating, certificates you're using or backend settings to push.
Possible issues I was also facing / tips I used:
- Make sure you're pushing to the same environment you're building for. You have to cover the case of pushing to production / sandbox apple services on your backend. I spend a number of hrs trying to figure the issue out before I realised I have to also fix my backend for prod.
- Make sure you have all checkboxes on, proper certificates are used/included in adhoc build profile and settings. Good point is to check which profiles are installed on your testing device and clean up, then try again.
- Although the backend is usually sending to different endpoints for sandbox/prod, AFAR registering to voip is the same on the app side for all possible cases. I can hardly imagine you can't get the token from adhoc build while dev build is fine (if again it is all set with certs/profiles/settings for your build). Simply NSLogging of some key points like "i got my token / print token / sent token to backend" can proof or disproof some of your assumptions here, just log events and look into device event log, might help you as well.
Also don't forget you have to report to CallKit on didReceiveIncomingPushWith, and the app is about to start crashing if you missed to do so, which might be hard to notice with adhoc build running in background mode.
Hope it helps a bit!