Search code examples
devicetokenapple-push-notificationsmdm

MDM Device token issue


I have setup simple demo for MDM server. I can successfully recover initial plist with messagetype, pushmagic token, APNs token(32byte as base46) and unlocktoken. My issue is when I tried to decode APNs token using base64_decode php function, it returns with junk/garbage character. Can any help if I need to use anyother php function to decode APNs token?

Thanks, Viral.


Solution

  • The token is just what it is: a token. What you're getting with base64_decode is just a byte-array, you cannot see any meaningful data in it or print it as a string. Just store it in binary form in your database. You need this token later on to identify the target device when you send a pending command notification to the APNS. It is the actually the same as a push-token for an app.

    The content of the notification for the device is described in 1, and the APNS protocol in [2].

    References

    1. Apple Inc, Mobile Device Management Protocol Reference
    2. Apple Push Notification Service