Search code examples
iosmacosapple-push-notificationssandbox

Other services like Apple push notification


I am planning to develop an application for macOS.In my application some tasks are done with the help of STPrivilegedTask (https://cocoapods.org/pods/STPrivilegedTask) and accessing system info using sysctl command. The tasks that are done using STPrivilegedTask not working when app sandboxing is turned on. I want to use push notification in my application. Apple says in their developer documentation push notification are only available for the apps that are distributed through the App store.(https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1)

APNs is available to apps distributed through the iOS App Store, tvOS App Store, and Mac App Store, as well as to enterprise apps. Your app must be provisioned and code signed to use APNs

Is it possible to use apple push notification for an macOS app without sandboxing? Is there is any other free or paid services are available that can be used instead of APNS for a macOS application?


Solution

  • I think you got it a bit wrong here. APNS is the service that will communicate with the device in order to send push notification. Any other 3rd party libs are using APNS in the end, they just offer custom handling or other features (like deep-link, tracking of push notifications etc).

    I don't know about macOS but on iOS you can receive push notifications for apps that are not distributed trough AppStore. For example you can create an enterprise account, which is a bit more expensive than a normal one(like stated on docs) and you can sign the app with the certificates & profiles from that account and the push notifications will work for sure.

    The push notifications work in sandbox & production mode on apps that are not submitted to AppStore. The only difference in these is the way you distribute them, using enterprise certificates (you can install the app in any number of devices) or normal certificate (you can install the app on max 100 devices).

    And the final point, there's no other way to receive push notifications other than APNS. You could try to implement a copy of this process but with no success, at least on non-rooted devices, simply because you'd have to create a socket-like communication between app & a server, which would run in background, but the OS will kill your process pretty soon & bye bye socket.