2

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 
rlandster
  • 7,294
  • 14
  • 58
  • 96
Tsurumaru Makoto
  • 229
  • 6
  • 20
  • were you able to build the ruby mdm solution>? do you have any code that you could share, was it open sourced by any chance? I am lookin to build one, but not having too much luck trying to find open source code that does this and dont want to reinvent the wheel – Vrashabh Irde Oct 16 '13 at 06:54

1 Answers1

4

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.

Community
  • 1
  • 1
User97693321
  • 3,336
  • 7
  • 45
  • 69
  • _in MDM payload don't select the option "Use Development APNS Server"._ Took me a whole day to figure out this! – user454322 Dec 17 '13 at 06:55