I'm building an iOS app for managing GitHub notifications. I'd like to add a push notification feature for when a user is mentioned or a comment comes in on thread their participating on. I've come up with 2 ways to implement the notification but I don't like either option so far:
* Each individual app polls the /notifications endpoint. This would take the server component out of picture but would require background app refreshing. Polls endpoint -> checks if it's different, if so send notification.
* When the user authenticates in the app, their access token and device id are sent to a server. The server loops through an array of users objects hitting the /notifications endpoint with their credentials. When a notification is detected, a push notification is sent to that device. This could become very unwieldy.
I could be looking at this wrong, open to suggestions.
Good luck.