MDM:APNS 通知无法到达 iPhone [英] MDM: APNS notification does not reach iPhone
问题描述
通知未到达终端.请告诉我.你好.谢谢你.
A notice does not reach a terminal. Please let me know. Hello. Thank you.
iPhone 4S iOS 5.1我编写了以下 ruby 脚本.它从 MDM 服务器执行.但是,通知不会到达iPhone终端.请告诉我.."mobileconfig" 的设置已完成,主题和设备令牌已被放置到 MDM 服务器.它检查是否也可以获取正确的信息,确认在 APNs 中对 iPhone 终端进行消息或徽章的更新.只有 MDM 的 APN 不会到达 iPhone 终端.我想解决这个问题.如果你愿意,请帮助我.
iPhone 4S iOS 5.1 I wrote the following ruby script. And it performed from the MDM server. However, a notice does not reach an iPhone terminal. Please let me know. A setup by ."mobileconfig" was completed and the topic and the device token have been PUT to the MDM server. It checked that the right information was also acquirable, It is confirmed that renewal of a message or a badge is made to an iPhone terminal in APNs. Only APNs of MDM does not reach an iPhone terminal. I would like to solve this problem. If you please, please help me.
#!/usr/bin/ruby -Ku
require 'openssl'
require 'socket'
(msg = []) << "dd0b64b77ebcac2092d6fe644d4db04e39d577c0228cf2187d8f87966aff8234"
device = msg.pack("H*")
socket = TCPSocket.new('gateway.sandbox.push.apple.com',2195)
#socket = TCPSocket.new('gateway.push.apple.com',2195)
context = OpenSSL::SSL::SSLContext.new('SSLv3')
context.cert = OpenSSL::X509::Certificate.new(File.read('nj_dev_apns-dev.pem'))
context.key = OpenSSL::PKey::RSA.new(File.read('nj_dev_apns-dev-key-noenc.pem'))
ssl = OpenSSL::SSL::SSLSocket.new(socket, context)
ssl.connect
payload = <<-EOS
{
#"mdm":"{<PushMagic>}"
{"mdm":"7C68976X-E70D-485Q-8CA7-7AC48F2F5F4A"}
}
EOS
(message = []) << ['0'].pack('H') << [32].pack('n')
<< device << [payload.size].pack('n') << payload
ssl.write(message.join(''))
ssl.close
socket.close
推荐答案
我的建议是先尝试生产 APNS ,所以使用这个 url:gateway.push.apple.com,如果你是使用 IPCU 生成 mobileconfig,那么在MDM 有效负载不要选择使用开发 APNS 服务器"选项.另请参阅此.
My suggestion is first try production APNS , so use this url:gateway.push.apple.com, and if you are using IPCU to generate mobileconfig,then in MDM payload don't select the option "Use Development APNS Server". And see this also.
这篇关于MDM:APNS 通知无法到达 iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!