Steven Parkes
unread,Jun 15, 2012, 6:50:23 PM6/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sacha1996, zx...@googlegroups.com
As documented, iOS devices will not use a body parameter in a url with an sms scheme. All it will use is the number.
It's possible for an app to use MFMessageComposeViewController to create an SMS with a body. The zxing iOS code does not do this. It creates a URL with an sms scheme and a body and (I presume) asks the OS to open it, which will throw away the body. You'd need an app that interprets the URL itself and sets the body or if you want to use Barcodes, it needs to be updated to do that.
On Jun 15, 2012, at 12:37 PM, sacha1996 wrote:
> Hi,
>
> I discovered a problem with the (message) body of the sms action.
> I made a QR-Code with number:1234 and body: hello. So this is encoded as smsto:1234:hello in a QR-Code , but when scanning it with Zxing only the number 1234 comes in the SMS app of the iPhone, but the body is empty.
> Do you know why or what's wrong in the code? Is there are way to get the body too?
>
> Code in SMSAction.m:
> #ifdef SMS_URL_INCLUDE_BODY
> #undef SMS_URL_INCLUDE_BODY
> #endif
>
> @implementation SMSAction
>
> @synthesize body;
>
> + (NSURL *)urlForNumber:(NSString *)number withBody:(NSString *)body {
> NSString *urlString =
>
> #ifdef SMS_URL_INCLUDE_BODY
> (body && [body length]) ?
> [NSString stringWithFormat:@"sms:%@?body=%@", number, [body stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] :
>
> #endif
> [NSString stringWithFormat:@"sms:%@", number];
> return [NSURL URLWithString:urlString];
>
> }
>
> Please help
>
> Thanks!