无法将 mdm 有效负载和命令发送到设备 [英] Not able to send the mdm Payload and Command to device

查看:25
本文介绍了无法将 mdm 有效负载和命令发送到设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 iOS 开发 mdm 以进行测试.我已经在设备上安装了配置文件并且我已经获得了设备令牌 PushMagic 现在我想发送 mdm 有效负载 {"mdm":"PushMagicValue"}

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"}

为此我使用了代码

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...

推荐答案

Apple 现在以 base64 编码格式发送设备令牌,为此我们必须使用带有设备令牌的 base64 函数而不是 message.token('CgeMZKRl2cqZAmGQ0VNCvySXAsaMPqeHga9ZUC3kqpM=')

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=')

我用过

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

这成功了......

这篇关于无法将 mdm 有效负载和命令发送到设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆