ZekeSnider / Jared

An easily extensible chat bot for iMessage written in Swift.
Apache License 2.0
471 stars 52 forks source link

Forward messages to and from SMS #79

Open Perifractic opened 1 year ago

Perifractic commented 1 year ago

I would like to receive iMessage messages on an old 2G cellphone. This is for a YouTube video experiment. I need to be able to reply via SMS as well, and have Jared send my reply back to the recipient via iMessage.

sendblue.co referred me to Jared. They can provide the Twilio numbers so I have one “alias” SMS number for each iMessage contact. That way I could even add those contacts to my old phone’s address book.

But my question is exactly how I would set all this up. I’ve looked at the webhooks but they seem to require a reply within 10 seconds which wouldn’t happen. And I’m a bit stumped as to how the API works in relation to sendblue and Twilio.

If you were me how would you achieve it?

Thanks!

ZekeSnider commented 1 year ago

I'm not familiar with sendblue or Twilio APIs, but generally your best bet would be to use web hooks and the REST API. Jared exists independently of those systems, so your link between them would be those SMS numbers in this case.

I’ve looked at the webhooks but they seem to require a reply within 10 seconds which wouldn’t happen.

You can setup a handler to listen to the webhook events and enqueue them in your own system (a message queue of some sort). Then when you're ready to handle them, call the REST API to send iMessages as necessary. I'm sure Twilio has webhook events you can listen to as well, so your handler would essentially be a mux between the two systems.