Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20107] iOS: openUrl to share data through whats app is not sharing the data if there is a "=" equal symbol in the shared data

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionNot Our Bug
Resolution Date2015-12-15T03:01:52.000+0000
Affected Version/sRelease 5.1.0, Release 5.0.0, Release 5.1.1
Fix Version/sn/a
ComponentsiOS
LabelsiOS, whatsapp
Reporter Ricardo Ramirez
AssigneeEric Merriman
Created2015-12-07T22:32:20.000+0000
Updated2017-03-24T18:58:24.000+0000

Description

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");

});

Comments

  1. Chee Kiat Ng 2015-12-15

    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='
  2. Lee Morris 2017-03-24

    Closing ticket with reference to the previous comments.

JSON Source