Nexmo-PHP-lib icon indicating copy to clipboard operation
Nexmo-PHP-lib copied to clipboard

Message length problem

Open mikevrind opened this issue 10 years ago • 1 comments

Hello,

I'm currently using this lib to connect to the Nexmo API. But I'm having some issues with the length of a text message.

I have a message that contains 160 chars, but still get split up into 3 separate SMS messages. According to the Nexmo website, 160 characters should fit into 1 message. But why doesn't Nexmo send just 1 message?

mikevrind avatar Jul 24 '14 14:07 mikevrind

An SMS can have 140 bytes (140 * 8 bits) not 160 characters. You can have 160 characters when using a 7 bit character set, however most if not all smartphones default to 16 bit unicode so the character limit will be 70 and 160 chars will be sent as 3 messages. This isn't down to Nexmo, most if not all phones will split long messages into parts before sending. https://en.wikipedia.org/wiki/Short_Message_Service#Message_size

You'll have to handle concat- flags sent by Nexmo, not exposed in NexmoMessage. https://docs.nexmo.com/index.php/sms-api/handle-inbound-message

jbtibor avatar Jul 23 '15 23:07 jbtibor