问题
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://co?from=username@example.com&to=helpdesk@example.com&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?
回答1:
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.
回答2:
hi I have face the same issue .after lots of searching i found this \u2029
来源:https://stackoverflow.com/questions/42741510/new-line-in-gmail-app-for-ios-using-url-scheme