Greetings everyone,
we have a problem testing remote notifications to our app runing in an iOS simulator, which should be possible for quite a while now. (https://nilcoalescing.com/blog/TestingRemotePushOniOSSimulator/)
We made sure of the following prerequisites
- The system requirements (recent XCode, recent MacOS, Silicone Processor) are met
- The app build is set to testing
- The app is in fact generating a devicetoken and sendig it to our backend
- We are sending our requests to the api.sandbox.push.app.com environment
Nonetheless, we always receive a status 400, error "BadDeviceToken" response from the APNS service.
Doing the same with a physical device works like a charm, ie the message is received without any problems.
We also tried sending the same device token to a production environment, but got the same 400/BadDeviceToken error. Also the simulator-generated token does not look distorted, ie it's also just a HEX string with the same length as the working token of the physical device.
Is there anything else we need to check for this to work?
While we would need to see the actual token to examine and see if there is problem with it, if you are seeing the simulator token to be the same length as a physical device, there could be a mistake when converting it. We expect the simulator tokens to be longer HEX strings. Make sure your code serializing the token data into a HEX string is not assuming a certain length.