Not able to send the mdm Payload and Command to device

旧城冷巷雨未停 提交于 2020-01-03 05:27:07

问题


I am developing mdm for iOS for testing purpose. I have installed the profile on the device and I have got the Device Token, PushMagic and now I want to send the mdm payload {"mdm":"PushMagicValue"}

and for this I am using the code

from APNSWrapper import *

wrapper = APNSNotificationWrapper('PushCert.pem', False)
message = APNSNotification()
message.token('CgeMZKRl2cqZAmGQ0VNCvySXAsaMPqeHga9ZUC3kqpM=')
message.appendProperty(APNSProperty('mdm', 'D60DAB80-A41D-4689-9F14-004E29431742'))
wrapper.append(message)
wrapper.notify()
print 'Done'

The problem is that my test server sends this message without any errors but I am not able to see any response on my device logs. Please tell me where I am wrong and how to make it work Any help will be appreciated...


回答1:


Apple now sends the Device Token in base64 encoded format for this we have to use the base64 function with the device token instead of message.token('CgeMZKRl2cqZAmGQ0VNCvySXAsaMPqeHga9ZUC3kqpM=')

I used

message.tokenBase64("6CORK2VBuJCPi1Y8oB3PRyoIiSf7Aq5sD7noZ/Awxao=")

and this did the trick ....



来源:https://stackoverflow.com/questions/19356033/not-able-to-send-the-mdm-payload-and-command-to-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!