Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Line in Gmail App for iOS using URL Scheme

Tags:

ios

url-scheme

We are working on an iOS app and we happen to be using the Gmail app's URL Scheme to compose a new email for the user. We figured out most of it, however we are having some trouble adding new lines in the body of the email. So far our URL looks like this:

googlegmail://[email protected]&[email protected]&subject=TITLE&body=What%20ever%20they%20include%20for%20the%20body

We have already tried using %0D%0A, as well as a few other options, however none of those seem to work. Is there any way to add a new line through the URL or is that just not possible?

like image 885
Marianapolis Tech Innovations Avatar asked Mar 11 '17 22:03

Marianapolis Tech Innovations


1 Answers

I have only used this scheme once before and I didn't need the ability to create new lines, but after taking a look at it, I'm as stumped as you are. My guess is that this isn't possible using this method. It seems to me that it only focuses on putting spaces between words.

One thing I would recommend looking into is the Gmail API for iOS. You will most likely have much more luck with this and there's also the upside of having more control over your messages. You can easily install it with CocoaPods and it doesn't take long to set up at all.

like image 177
Tom Nurse Avatar answered Sep 20 '22 03:09

Tom Nurse