Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native iOS open message app with default text

enter image description here

Code:
Linking.openURL('sms:'+number+'?body=Hi');

I try to open message app with mobile no and content.but mobile no and content combine together in to section.How to fix this issue?any help will be appricated.thanks in advance

like image 544
arun rajesh Avatar asked Dec 06 '22 14:12

arun rajesh


1 Answers

The working syntax on iOS (as at 11.2) appears to be sms:123&body=mybody, note the & as a separator rather than ?.

Be warned though this & separator is contrary to RFC5724 (and Android), so somewhat likely to change in future iOS versions.

Also, interestingly Apple has this to say (emphasis added):

The format for URLs of this type is sms:<phone>, where <phone> is an optional parameter that specifies the target phone number of the SMS message. This parameter can contain the digits 0 through 9 and the plus (+), hyphen (-), and period (.) characters. The URL string must not include any message text or other information.

like image 59
Rob Hogan Avatar answered Feb 09 '23 06:02

Rob Hogan