Starting Xcode 14, iOS Simulator is able to communicate with APNs in order to register for notification in the sandbox environment. I created a sample test for this.
A dumb iOS application that registers for notifications. It has UITests to automatize the tap on the consent popup (it is not possible to ask for the permission via CLI sadly).
Once the application registers, the AppDelegate method didRegisterForRemoteNotificationsWithDeviceToken
is called and the device token is sent to a local server application (node.js).
The test itself creates an iOS 18.6 Simulator with xcrun simctl
, builds such app and run the tests through through CLI with xcodebuild
.
Running this on my personal Macbook Pro M1 2021 goes well every time, so I wanted to bring it on Github Actions (arm64 macOS machines), in order to test the works on a open source library I'm building (hapns).
Contacting Github support led me to test this on a macOS image running inside a VM inside a Veertu Anka container on my personal Macbook Pro, due to an VM architectural limit suspicion.
The results were the same: iOS simulator isn't able to receive the device token. Not even didFailToRegisterForRemoteNotificationsWithError
is called (tested through some network probes-requests that communicate to the server which checkpoints the process reached).
So, as asked, I've setup a repro-case to be run in the VM and I've collected VM diagnostics ready to be tested and attached.
Does anyone know if there is some unspecified (or specified but buried in the documentation) limit for this? Thanks.
Github discussion link for further details, repro-case and so on: https://github.com/actions/runner-images/issues/12747