BlueBubblesApp / bluebubbles-server

Server for forwarding iMessages to clients within the BlueBubbles App ecosystem
https://bluebubbles.app
Apache License 2.0
541 stars 47 forks source link

SMS support clarification / help #663

Closed d4tocchini closed 3 months ago

d4tocchini commented 3 months ago

What is the current state of SMS support? Particularly, I'm wondering how to receive 'new-message' webhook events from (& consequently respond to) non iMessage phone numbers. My usecase is for the API/webhook, not necessarily the UI, though that would be nice too.

I noticed incoming SMS messages are not emitting webhooks, and I'm a bit confused giving the following PRs:

109 Add enable SMS option so the listeners can emit SMS

114 Add toggle for SMS support

245 Removes SMS restrictions

#100 Adds withSMS params to messages enpoints

The first 2 of these cryptically refer to:

          My branch

Originally posted by @zlshames in https://github.com/BlueBubblesApp/bluebubbles-server/issues/114#issuecomment-739509496

Is there a branch I should be looking at as the above mentioned branches have been deleted since? Is there a canonical branch to checkout the SMS Toggle feature?

I totally understand if SMS is not currently supported, if so, any pointers on how to do so would be a huge help!

d4tocchini commented 3 months ago

I noticed the service field available in the chat/new API endpoint in chatRouter.ts. If I set service to SMS, the server always responds with 500 internal server error.

zlshames commented 3 months ago

The BlueBubbles server only supports SMS forwarding. Which is used when you have a phone number linked to your iMessage account. When that's the case, SMS messages can go to your Mac which the BlueBubbles server can forward to clients. And clients can send SMS via the server. But you need a linked phone number.

Native SMS support in the client app is not yet supported. If you have a phone number linked and want to use SMS forwarding, don't use the service field, just set the SMS prefix for the Chat GUID when sending a message. For example: SMS;-;<address>

d4tocchini commented 3 months ago

I had tried the SMS;-; prefixed GUIDs, turns out my issue was with the linked iPhone.

I was able to get SMS Forwarding working by:

  1. on the iPhone of the linked phone number, enabling Text Message Forwarding for the mac running BlueBubbles
  2. ensuring the iPhone was connected to Internet or cellular

If the iPhone is not online, the SMS messages will be queued and eventually fail to send unless the iPhone comes back online before the timeout. I didn't realize that this was also how the Messages app on MacOS functioned.

Are the iPhones the clients you refer to here that send SMS?:

SMS messages can go to your Mac which the BlueBubbles server can forward to clients. And clients can send SMS via the server.

What would be the functional difference between SMS forwarding & Native SMS? I mean, is it possible for the Messages app to send SMS without forwarding through an iPhone? That would be black magic!

@zlshames, thanks for the tips!

zlshames commented 3 months ago

Native SMS wouldn't require the server at all technically. You'd be able to set BlueBubbles as your SMS app on Android too. But we don't do that