ostinelli / apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
MIT License
480 stars 96 forks source link

support generic notifications with the goal of supporting mdm. #34

Closed idyll closed 8 years ago

idyll commented 8 years ago

This PR addresses #32.

Unfortunately the Apple documentation for this is private. I have tried to make this generic to support arbitrary payloads as I think there are some other types.

idyll commented 8 years ago

@ostinelli is there a specific change you'd like to this PR in order to accept it?

ostinelli commented 8 years ago

Yes, this is hacking Apnotic::Notification. It should be a complete new class. If an attribute (payload) "Replaces ALL subsiquent values with the payload specified" (cit) then there's probably a design issue.

Let me know if you want to change this, or I can help.

idyll commented 8 years ago

The MDM notification documentation isn't public AFAIK - or I'd just share it - but really my goal here was to allow a simple way to just override what the notification does.

If that makes sense in a new class I can pull it out. What would you call it? GenericNotification?

ostinelli commented 8 years ago

In this case I'd wait for documentation to become public and official. Closing for now, we can reopen and reconsider as soon as it becomes official.

idyll commented 8 years ago

It's been "official" since iOS 4. It's just private for whatever reason.

And unfortunately having an aps key is invalid in an MDM notification so using custom_payload to try to get around the limitations of the current model isn't sufficient.

ostinelli commented 8 years ago

The only thing I need is a public statement that this is a public feature supported and here to stay (at least for a while). Documentation is obviously a powerful statement, but a talk / apple article would do too. I basically want to ensure that what we implement cannot break without notice.

idyll commented 8 years ago

This isn't the same documentation that I am using, but here's more info:

https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/MobileDeviceManagementProtocolRef/3-MDM_Protocol/MDM_Protocol.html#//apple_ref/doc/uid/TP40017387-CH3-SW3

That at least shows the structure of the push.

jeremybdk commented 7 years ago

Hello, @ostinelli have you considered reopening the issue? MDM Push notification is the only way to get a device to checkin with your server when you use MDM, it's been like this since iOS 4 and it seems that it's going nowhere :)

I would love to be able to use your gem for MDM.