Running iOS notifications in Github Action is not possible #169255
Unanswered
alexandercerutti
asked this question in
Actions
Replies: 1 comment 7 replies
-
Hi, I've run into similar issues with APNs device token registration on GitHub Actions macOS runners (especially ARM/M2). From my experience, here are a few things to check: Simulator Limitations in CI
Network Ports
Troubleshooting Tips
SummaryThis is a common limitation of cloud CI runners for iOS APNs testing. For full E2E push notification tests, a physical or self-hosted Mac is often required. Hope this helps! |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Question
What GitHub Actions topic or product is this about?
Misc
Discussion Details
Hello,
since the release of Xcode 14 two years ago, iOS Simulators started supporting iOS notifications through the usage of APNs (so, network and not only
.apns
file pushing).The changelog cites the following:
I setup an e2e test made of several components:
The test builds and runs the iOS app and automates some things (notifications permission requires tapping consent - so UITests are great to automate this), then checks if the notification is arrived by watching the springboard.
It runs perfectly on my Macbook Pro M1 2021 (also with a GH self-hosted runner, ofc). With the same configuration I tried moving it to a Github Action in order to allow running on triggers.
I tried both the images
macos-15
(Intel - on which it will never work) andmacos-15-xlarge
(arm64 M2 Apple silicon machines), which both bring Xcode 16, but no notification is sent.Debugging is very hard in this sense, as the simulator doesn't allow any custom log to get printed (
xcodebuild
clones your simulator and doesn't print anything - you cannot even read them later).I created some logs network requests to be printed by the server in order to understand which was the point the whole test was getting stuck on.
Apparently, notification popup appears and it gets tapped, so the permission is given.
However, the device token is not generated and, therefore, neither the
AppDelegate
functiondidRegisterForRemoteNotificationsWithDeviceToken
ordidFailToRegisterForRemoteNotificationsWithError
gets called.This makes me think the machines lack of some permissions, the hardware is not enough, or it fails at doing some requests to APNS (I guess it could be the most plausible reason, as I think the simulator should register and then APS should be able to communicate with it).
I tried to run an action on
macos-15-xlarge
withnrukavkov/open-ports-check-action@v1
to check for ports 443, 5223 and 80 forapi.sandbox.push.apple.com
and only 443 is reachable (which seems fine?).However, this Apple Support page states how 5223 is needed (but I'm not sure it is for
api.sandbox.push.apple.com
, mostly not).Do someone knows anything more about this and do you have any ideas how can I test and understand further about this?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions