|
|
#533 (permalink) |
|
Senior Member
Join Date: May 2006
Location: Seattle, WA
Posts: 245
|
I'm up to 3.0 on my 1st Gen touch and I've got the latest testing version of katg.com installed. It asked me about if I wanted to recieve push messages (I forget the wording).
Do I need to do anything else to receive push messages? Are you sending out broadcast messages to everyone or it is on an individual basis? |
| (Offline) |
|
|
|
#534 (permalink) | |
|
Senior Member
Join Date: Mar 2008
Location: Detroitish
Posts: 1,386
|
Quote:
|
|
| (Offline) |
|
|
|
#539 (permalink) |
|
Senior Member
Join Date: Mar 2008
Location: Detroitish
Posts: 1,386
|
This isn't done and it's barely passable as workable code, but it runs and gives you the device tokens from the feedback service.
Code:
#!/usr/bin/env python2.6
import socket, ssl, json, struct
def uniquify(seq):
set = {}
map(set.__setitem__, seq, [])
return set.keys()
theCertfile = 'dist_cert.pem'
theHost = ('feedback.push.apple.com', 2196)
#theCertfile = 'dev_cert.pem'
#theHost = ('feedback.sandbox.push.apple.com', 2196)
ssl_sock = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM), certfile=theCertfile)
ssl_sock.connect(theHost)
f = ssl_sock.read(2048) #Not sure what size this should be, I think 2 MB should be enough
ssl_sock.close()
array = f.split(' ')
array.pop(0)
tokenstring = ''
tokenarray = []
for hextoken in array:
if len(hextoken) == 37:
unpacked = struct.unpack('!BH34B', hextoken)
for value in unpacked:
converted = hex(value)[2:]
if (len(converted) % 2) == 1:
converted = '0' + converted
tokenstring = tokenstring + converted
tokenstring = tokenstring[0:64]
elif len(hextoken) == 32:
unpacked = struct.unpack('!BH29B', hextoken)
for value in unpacked:
converted = hex(value)[2:]
if (len(converted) % 2) == 1:
converted = '0' + converted
tokenstring = tokenstring + converted
tokenarray.append(tokenstring)
tokenstring = ''
print uniquify(tokenarray)
Last edited by hayroob; 06-22-2009 at 11:51 AM. |
| (Offline) |
|
|
|
#540 (permalink) |
|
Senior Member
Join Date: Jan 2006
Posts: 131
|
Haha alright. I never meant to be a douche or anything. I was thinking maybe $2 or $5. But alright, I'll wait for the actual release. I'm sorry for wasting time, it's my fault for typing my udid wrong, I didn't know about those apps that could email them for you.
|
| (Offline) |
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|