Swiftpack.co - Package - shusain93/OSXMessageProxy

MessageProxy: An Open Source iMessage API


This API is primarily designed to be used with AndromedaB (open source!) however it is still possible to use independently. This project uses GCDWebserver for network requests. You can more or less deduce the API from the ViewController.swift in the code blocks.

This setup reads the SQL database that the OSX iMessage app uses and so theoretically Apple will break it every time they update iMessage. Further, to send I am using keyboard shortcuts so you need both a sufficiently fast computer to be able handle UI automation (i.e. if it freezes all the time it'll be very unreliable). To combat the troubles of UI scripting, I have set it up to verify a message has been sent and if it fails it will notify over the notification setup your built in IFTTT. There are a few bugs in this: iOS 10 iMessage separates links at the start and end of your messages into brand new, separate ones and so the exact message text can't be found and so worst case scenario you end up accidentally spamming the same message 3 times and getting an error message back.

You will need to run this on a computer which can act as a server and will never sleep. If your server sleeps/goes offline not only will you not know about your texts, they will be delivered through iMessage and you won't be able to access any of them while you are away. If you get fired because my server failed create an issue and don't blame me.


  1. Getting and sending messages
  2. GROUP CHATS! This includes named and unnamed iMessage group chats (i.e. Person 1, person 2, person 3 AND "The Sushi Brigade")
  3. Loading of attachments of any type. todo: allow sending!
  4. A socket server so that clients can connect and get fast live message updates
  5. Notify devices over IFTTT. todo: setup Firebase GCM


To achieve notifications for the AndromedaB application I have setup IFTTT notifications through the maker API. You need to generate a token here. Download the latest release. Download both the zip file and the latest StartIMProxy.command and move the unzipped application and the script into a new folder somewhere other than where you unzipped the application otherwise auto update doesn't work. Launch the application using the StartIMProxy.command (the script must be in the same folder as the application). Fill in your token from IFTTT and also add a protection key. This protection key is just a password/API key for your server so don't ever share it otherwise nasties can steal your messages! Keep the application in the same folder as StartIMProxy.command and don't rename the application without also first changing the script. You will use this short script (you can double click, may have to chmod +x it first) to launch and keep the server running all the time because it's not 100% perfect and still needs a watchdog to keep it alive 24/7. When you run the script (***never run through the app!***) you should see some text go by fast and then eventually Ready at http://x.x.x.x:8735 in both the console and in the UI. If you see this, your server is running correctly however you still need to configure port forwarding for both ports (API server is by default 8735 and socket server is 8736, both TCP) and potentially a domain. You will need to accept the permissions request for contacts because otherwise you will have no names for anyone (duh)

Once you've got the server running, configure an IFTTT maker recipe with the event name as imessageRecieved (note that this is spelled wrong, sorry. I spelled it the first time so now it's legacy)

  1. Value1: this is the from field
  2. Value2: this is the message content
  3. Value3: this is an advanced field which contains a search keyword which if included as the link field of a Pushbullet link push in the format http://i.eu/{{Value3}}/ (copy and paste!) it will automatically launch the application to the correct conversation if clicked as a notification. http://i.eu will never resolve to anything (on char TLDs are banned) but it has the advantage of being very short so it won't take up much space in the notification tray.

Here is an example configuration. You can set this up however you like but this works well for me (3739 times well) config for ifttt

Building from source

This project uses Cocoapods and Swift Package Manager (sorry, the socket server is only available through SPM) but I have committed them to the repo so if you clone it should work directly. Launch the xcworkspace. Xcode will give you an error about code sign most likely but that's not hard to fix. After you've done this, it should build successfully. You can make whatever changes you feel like however if you intend to keep any major modifications as this project develops you will need to make a fork of this project so you can merge changes.


Stars: 51
Help us keep the lights on



1.2.2 - Oct 29, 2017

Tiny bug fix which caused issues in High Sierra. Added foundational support for firebase centralized database (nothing usable yet but hey the code itself is there...). Also added support for El Capitan if you are using an older server.

There's a new StartIMProxy.command available. Click here to download the latest version of the script. This fixes issues with some logging. You will still see a bunch of Address Book / [Account] / CoreData warnings or errors in the console however these don't matter and are seemingly benign. Don't report them. The real logged data is in ~/OSXMessageProxyLogs. This is the actually application log.

for whatever reason autoupdate isn't very reliable. You may have to try updating a few times if "install and relaunch" doesn't restart the server app Sorry. I have no idea why honestly.

1.2.1 - May 11, 2017

With this release (and a compatible v1.2.1+ client) single recipient messages will send instantly once on the server and should send with 100% first time success. Group messages will still take their old ~10 seconds to send because they need to use the slower UI automation. This should work OOB if you have everything updated.

Mid week update, found some time to work on this project. Might not get an update this weekend, finals and all that.

Report bugs with this auto sending issue by creating an issue report here on Github.

1.2 - May 7, 2017


I have fixed the issue in this latest update among some other things listed below. This appears to be an issue with Sparkle.

Fixed a bug with spaces in attachment names, fixed the app icon, and fixed the proxy script logging improperly.

Added socket support, default on port 8736. This is primarily for Andromeda however it is technically useable everywhere. Requires v1.2+ for both client and server. The API for this part of the server is explained in SocketServer.swift

1.1.1 - May 3, 2017

Fixed an odd, rare bug where the server will crash when the name of a conversation is invalid and also added a minor future proofing API feature of the /isUp endpoint. If you access /isUp?t= the server will return the version it is currently running. This is useful so that client applications can be sure that the server is reasonably up to date or optionally force the user to update the server before proceeding. I also fixed the autoupdating misbehaving and trying to update to itself by actually reading the documentation.

Also, I'm trying the first update of this application through Sparkle. YOU MUST HAVE ALREADY MOVED THE APPLICATION OUT OF THE LOCATION YOU UNZIPPED IT AT OTHERWISE THE SYSTEM WILL BLOCK THE UPDATE. Make a folder, move the server app and the script somewhere and then you'll be able to update. If you still can't update and you've already tried moving it create an issue on GitHub and include the log files for today's date in ~/MessageProxy/. These logs will only be present if you are running with StartIMProxy.command which you ought to be doing anyways.

1.1 - Apr 30, 2017

Quite a few bug fixes, changed configuration system -- no more digging into the app bundle to set API keys. Nice, more functional really, GUI.

Two big crash bug fixes. Remember to save save your keys from the previous version if you are updating so that you don't have to re setup the Android app. Once you've set this up once you should be able to do any update safely without losing your keys.