I'm having a little trouble getting my WatchKit App to pre-compose an SMS message to multiple recipients (via the Apple Watch message app).
let messageBody = "hello test message"
let urlSafeBody = messageBody.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet())
if let urlSafeBody = urlSafeBody, url = NSURL(string: "sms:8888888888&body=(urlSafeBody)") {
WKExtension.sharedExtension().openSystemURL(url)
My question is, if you have multiple phone numbers you want to send the message to from the watch, how do you delimit the values?
The SMS Links documentation entry does not explain delimiting to multiple recips from an NSURL.
I have tried:
NSURL(string: "sms:8888888888,9999999999&body=(urlSafeBody)")
and
NSURL(string: "sms:8888888888;9999999999&body=(urlSafeBody)")
but the message always shows up composed only to the first number.
Any help appreciated!
UPDATE:
iOS: Launching Messages app with multiple recipients was linked in comments indicating that only one recipient is allowed in NSURL. This means I am trying to figure out any other way to send an SMS via watchkit... Not possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…