Friday, May 10, 2024
27
rated 0 times [  30] [ 3]  / answers: 1 / hits: 24588  / 6 Years ago, thu, february 15, 2018, 12:00:00

I have been trying to trigger the Intent Share in the Android browser from javascript using the navigator.share.



Following is an example code:



$(#printTest).click(function(e){
if (navigator.share === undefined){
alert('Undefined!');
}
else{
alert('Sharing!');
navigator.share({title: 'Example Page', text: 'https://example.com'});
}
});


When I try to click on the button from chrome in ubuntu, it opens a window for sharing(which shows no apps to select though). But the same is not working on any android mobile browser. I have tested in Chrome for Android version 64 and Chrome for Android Dev also. All of the shows the alert 'Undefined' even after enabling the flag chrome://flags/#enable-experimental-web-platform-features.


More From » android-intent

 Answers
9

navigator.share will only work on websites with https and not HTTP


[#55137] Tuesday, February 13, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jailynbethanies

Total Points: 686
Total Questions: 119
Total Answers: 99

Location: Cook Islands
Member since Thu, May 21, 2020
4 Years ago
;