Issue Description
Trying to share a url through whatsapp using the openUrl function, for example below is the url:
https://itunes.apple.com/ae/app/whatsapp-messenger/id310633997?mt=8
after opening the whats app application and select a contact the text field is empty with no data poopulated to be shared.
If the = symbol is removed the whatsapp text field is with the full data.
Steps to Reproduce
1- Create a new simple classic project
2- Replace in the app.js file the below test-case code
3- Run on device with whatsapp installed
4. Click the share button
5. Select a contact in whatsapp
6. The textfield is empty.
Test Case
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var share_button = Ti.UI.createButton({
title: "share"
});
win.add(share_button);
win.open();
share_button.addEventListener("click", function(){
var url = "https://itunes.apple.com/ae/app/whatsapp-messenger/id310633997mt\=8";
var whatsappUrl = 'whatsapp://send?text='+url;
Ti.Platform.openURL(whatsappUrl);
Ti.API.Info("https://itunes.apple.com/ae/app/whatsapp-messenger/id310633997?mt\=8");
});
Hi, This is a issue with the whatsapp api that we cannot do a generic fix to. basically, for the property *'text'*, if you wish to include a url, you have to use http encoding. for this example, it'll be:
var url = "https://itunes.apple.com/ae/app/whatsapp-messenger/id310633997mt%3D8";
The encoding for '=' is %3D. Remember, this is only necessary for this condition: *any url for 'text=' for whatsapp* You don't have to do encoding for'whatsapp://send?text='
Closing ticket with reference to the previous comments.