MDM Support #88

Closed
janporu-san opened this Issue Feb 25, 2013 · 9 comments

Comments

Projects
None yet
5 participants

Hi @notnoop,

it seems the library supports MDM. I build my mdm "wake up" push notification using a SimpleApnsNotification object. The Built payload looks like the following:

BUILT PAYLOAD: {"aps":{},"mdm":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}

However, I believe according to the documentation an MDM payload should only contain the following: {"mdm":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"}.

Is there a specific class to achieve the above? I looked through the Javadocs but couldn't come up with anything.

Regards.

Collaborator

froh42 commented Mar 2, 2013

Hi @janporu-san,

I haven't looked at MDM yet, could you provide a pointer to the documentation where you found the mdm payload definition? If java-apns behaves wrong (or it is unclrear how to set it up correctly) we'd want to add a test case that documens how to do MDM with it.

I've tried this with MDM, it's working absolutely fine.

Hi @karldmoore,

this could be an Apple specific issue. I have tried both from PHP code that I've written and from java-apns. I'd be happy if at some point you could privately contact me and possibly help me figure it out?

Thanks.

During the enrolment process a device will send you an update token request. This token needs to be converted to a hex string. Utilities has methods to encode and decode hex, this should be everything you need.

mokiSam commented Jun 14, 2013

Is there something special that has to be done with the pushMagic token? My device is rejecting apns messages because it says something is wrong with the pushMagic. I'm sending it in the exact format that the device gives to me on enrollment.

Not sure, the PushMagic value value can only be used to send mdm messages however not general APNS alerts e.g. used for APNS.newPayload().mdm("PushMagic").build();

@karldmoore i did convert device token to hex string and made MDMPayload from APNS.newPayload().mdm("PushMagic").build();
then i sent to APNS but in response i got a failure message
exception:com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
please tell me where i am wrong now ?

I would presume there is a problem with the certificate you are presenting to the server.

@karldmoore i have made it working.My device string was 82 bit hex string.Once i made made the device token to 64 bit hex string ,it has started working as expected.Thanks man :)

froh42 closed this May 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment