1

This code is working good on android device like Samsung Galaxy Tab and S3 etc. After selecting a contact, it appears TheTitle -> TheURL.

But it's not working at iOS device like iPhone 6 plus and iPhone 5. After selecting a contact, the TheTitle -> TheURL does not appear, it's just blank.

How can I fix this?

var TheTitle = "post Title Text", TheURL = "blog.com/url-post.html";

$('#myID').after('<a class="button-share whatsapp" data-action="share/whatsapp/share" href="whatsapp://send?text=' + TheTitle + ' -> ' + TheURL + '" target="_blank">WhatsApp</a>');
Kamarul Anuar
  • 312
  • 4
  • 16

1 Answers1

1

Solved.

Text value must encode at iOs Whatsapp.

var TheTitle = "post Title Text", 
    TheURL = "blog.com/url-post.html",
    nuklear = TheTitle + ' ›› ' + TheURL,
    bomb = encodeURIComponent(nuklear);
$('#myID').after('<a class="button-share whatsapp" data-action="share/whatsapp/share" href="whatsapp://send?text=' + bomb + '" target="_blank">WhatsApp</a>');

Tested: working on Android and iOS

Kamarul Anuar
  • 312
  • 4
  • 16