|
|
#481 (permalink) |
|
Senior Member
Join Date: Mar 2008
Location: Detroitish
Posts: 1,386
|
Here's a build with push enabled and I'm looking for testers. whywontyoudie.com/06-13-09-KATG.com.app.zip I'm gonna try to find people tonight, but let me know when/if you're interested in giving push a test run
|
| (Online) |
|
|
|
#482 (permalink) |
|
Senior Member
Join Date: Mar 2008
Location: Detroitish
Posts: 1,386
|
and for hypercrypt and other devs here's some early push code written in python which I love so very much more than obj-c
Code:
#!/usr/bin/env python2.6
import socket, ssl, json, struct, urllib, time, sys
from xml.dom.minidom import parse, parseString
# Needs python 2.6 - for 2.5 replace ssl and json (with simplejson)
# Export your "Apple Development Push Services" certificate from your Keychain (important: select it from the "My Certificates" category in the sidebar). Export the certificate as a "Personal Information Exchange (.p12) file. You shouldn't give the exported file a password (well you could but YMMV).
# Convert the .p12 file you just exported into a pem file:
# openssl pkcs12 -in certificates.p12 -out certfile.pem -nodes -clcerts
# Replace the device token with YOUR applications device token.
# For testing don't forget to quit the app (you wont see the push notification dialogs while the app is running).
# Tested on iPod 1st Generation with 3.0b2 - yes it all works.
for arg in sys.argv:
if arg.startswith('--'):
Message = arg[2:]
print 'Sending: ' + Message
url = 'whereever your xml is'
filehandle = urllib.urlopen(url, data)
time.sleep(5)
xml = filehandle.read()
xmldoc = parseString(xml)
nodeArray = xmldoc.getElementsByTagName('deviceToken')
tokens = []
for node in nodeArray:
try:
deviceToken = node.firstChild.toxml()
tokens.append(deviceToken)
except:
continue
for deviceToken in tokens:
thePayLoad = {
'aps': {
'alert':Message,
'sound':'default',
'badge':1,
},
}
theCertfile = 'cert.pem'
theHost = ('gateway.push.apple.com', 2195)
data = json.dumps(thePayLoad)
deviceToken = deviceToken.replace(' ','').decode('hex')
theFormat = '!BH32sH%ds' % len(data)
theNotification = struct.pack(theFormat, 0, 32, deviceToken, len(data), data)
ssl_sock = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM), certfile=theCertfile)
ssl_sock.connect(theHost)
ssl_sock.write(theNotification)
ssl_sock.close()
print 'Done Transmitting'
openssl pkcs12 -in certificates.p12 -out certfile.pem -nodes -clcerts |
| (Online) |
|
|
|
#483 (permalink) | |
|
Senior Member
Join Date: Apr 2006
Posts: 888
|
Quote:
i'm excited about the iphone app as anyone but let's not forget our manners. Screenshots look freaking amazing too btw! all you guys working on it deserve blowjobs. ... if you're a hottie and would like to donate your time to the cause, pm me your boobies and i'll send you in the right direction. least i could do. |
|
| (Offline) |
|
|
|
#485 (permalink) |
|
Senior Member
Join Date: Jun 2006
Location: Napoli, Italy
Posts: 243
|
OK now I feel like a dummy! HElP! OK I'm on my Mac and clicked on the app. Said it's not supported on this architecture. So, I dragged it to my itunes library. It's in my itunes library. I can't find it in the library. It's not in the applications or music so where did it go? I tried to drag it again but it says it is already in the library.
Anyone with some advice. It's very rare that the computer teacher is beaten by the computer but there it is! Thanks! |
| (Offline) |
|
|
|
#486 (permalink) | |
|
Senior Member
Join Date: Nov 2006
Location: My Place: Liverpool. Born and raised in Berlin.
Posts: 771
|
Quote:
|
|
| (Offline) |
|
|
|
#488 (permalink) |
|
Senior Member
Join Date: Nov 2006
Location: My Place: Liverpool. Born and raised in Berlin.
Posts: 771
|
Pretty much any time. Got some time off work at the moment, so just relaxing and programming today and tomorrow. Whenever it suits you basically.
PS: I see that katgapp.com is down. Are you having a problem or do you no longer want / need it? Last edited by hypercrypt; 06-14-2009 at 11:20 AM. |
| (Offline) |
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|