When Tara and I were trying to fix some issue with Coursicle we wanted to automate texting some users from our phones so we could tell them they needed to resubmit the classes they were tracking. One part of this was just automating figuring out if a user had an iPhone or an Android, so we were hoping to use iMessage to determine that.

read more
Hi Cam,

I came across your iMessage Client repo just now. Cool stuff.

I was wondering if you had any suggestions on how I could automate the process of checking whether a phone number supports iMessage? This appears to be done each time you type a number in the “To” field when composing a new message.

Thanks so much,

Hey Joe, it’s been a while since I looked at that stuff, but if I remember correctly, the SQLite database messages.db where all of the chat information is stored, sets a flag based on whether the recipient is a valid iMessage user. So you should be able to strip the code down to just input the number, wait a second, then go check what’s in the messages database for the conversation. I will point out though if you’re trying to do this at scale running through lots of numbers, I’ve worked on that in the past, and iMessage services are heavily rate-limited and will ban the entire machine from iCloud services.

Hope that helps!