title: MDM - APNS not working
body: <p>We are implementing MDM solution in house. We have registered as MDM vendor and followed the steps from this <a href="http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning">site</a> and got the final APNS certificate. We also installed a MDM profile in the device which points to our back end server which is capable of receiving/sending payloads to the device. </p>
  
  <p>Then we used <a href="https://github.com/notnoop/java-apns">java-apns</a> library to send a sample notification. Below is the sample code for the same.</p>
  
  <pre><code>    ApnsService service =
              APNS.newService()
              .withCert("test.p12", "xxxxxxx")
              .withProductionDestination()
              .build();
      String pushMagic = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx";
  
      String mdmPayload = APNS.newPayload().mdm(pushMagic).build();
      service.push(pushMagic, mdmPayload);
  </code></pre>
  
  <p>Above execution goes through successfully. But device doesn't receive any notifications. Can someone throw some light on this? Thanks in advance.</p>
  
  <p><strong>Update:</strong>
  Found couple of issues in our implementation. push API takes device token and payload. We were incorrectly using pushmagic as token in push API. Also devices send the device token in base64 format during initial check-in. So it needs to be converted to hexa format and used in push API.</p>
  
  <p>With these two changes, we are one step ahead. Now feedback service is returning a message saying that the corresponding device is inactive. We tried reinstalling the profile and used the latest push magic and device token. Still Feedback service is returning the same message. </p>