I'm trying to send some text accompanied by an URL using WhatsApp's custom URL scheme. There's apparently only one valid parameter for this purpose:
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
NSString *encodedURLString = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(
You're approaching it correctly, but it appears that the URL is being double-encoded. Make sure both the message and URL is only encoded once.
Using your same encoding method, you can do something like so:
NSString *urlAbsoluteString = @"Hello World! http://yayvisitmysiteplease.com?funky=parameter&stuff"; NSString *encodedURLString = ...
That should give you the URL to execute:
That makes its way into WhatsApp just like you'd expect. (I verified to make double sure.)