MDM: APNS notification does not reach iPhone

折月煮酒 提交于 2020-01-10 20:14:46

问题


A notice does not reach a terminal. Please let me know. Hello. Thank you.

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 

回答1:


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.



来源:https://stackoverflow.com/questions/10545246/mdm-apns-notification-does-not-reach-iphone

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