The iMessage/APNS initial registration protocol sends the hardware serial number of the device it runs on to Apple as part of getting its client certificate.
They're formulaic, so you can come up with valid ones that aren't your own, but good luck doing that in a way that scales well and doesn't run your app afoul of the DMCA.
Would be nice if the Usage section was a bit beefed out. Now one either have to look at code or install it to find out how to specify a contact to send message to. Seems like good stuff though.
Cool. I immediately wanted to check out how it works to find out it works by sending some bits to Messages.app through applescript. The most relevant portion seems to be:
if is_i response
puts "Sending \'#{str}\' to chat number #{response}"
`osascript -e 'tell application "Messages" to send \"#{str}\" to item #{response.to_i} of text chats'`
else
puts "Sending \'#{str}\' to buddy \'#{response}\'"
`osascript -e 'tell application "Messages" to send \"#{str}\" to buddy \"#{response}\"'`
end
Though I must say I kinda like the way they've done it in OS X 10.9, where I can respond inline even when I'm on another desktop.
The best thing about this is probably that you can send messages when you're logged in to your OSX box remotely. Though for that to be handy it misses a real "chat" feature, in which the app can also playback the messages you've received.
I immediately thought it would be cool to make some of my cronscripts send some messages to myself when something interesting happens. Sadly, the form used in this utility does not lend itself to sending to self, Messages.app returns an error when you try.
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- taken from:
-- http://stackoverflow.com/questions/11812184/how-to-send-an-imessage-text-with-applescript-only-in-provided-service
-- thanks to users @Senseful and @DigiLord
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
Now I can do:
$ imessage XXXXXXXXXX "gofinance: stock AAPL went up, possibly because of imessage..."
Was naively hopeful that someone had finally reversed the iMessage protocol. Much to my chagrin, it's 'just' an Applescript wrapper. Nice work, nonetheless!
http://www.cs.utexas.edu/~wcook/Drafts/2006/ashopl.pdf