Social
Sdílení přes external link:
(pokud necheš použít plugin, nebo není dostupný)
var shareType = document.getElementById("selSocial").value;
var url = "";
if (shareType == "Facebook")
url = "https://www.facebook.com/sharer/sharer.php?u=" + article.detailData.Url;
if (shareType == "Twitter")
url = "https://twitter.com/home?status=" + article.detailData.Url;
if (shareType == "Google+")
url = "https://plus.google.com/share?url=" + article.detailData.Url;
if (shareType == "E-mail")
url = "mailto:?subject=" + article.detailData.Title + "&body=" + article.detailData.Url;
if (url != "")
window.open(url, '_blank', 'location=yes');
Sdílení přes plugin (klikneš na tlačítko a otevře se ti nativní výběr přes co chceš sdílet)
Plugin:
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin
vše podle návodu, akorát mi nefunguje volání přes
window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);
tak používám:
window.plugins.socialsharing.share(null, article.detailData.Title, null, article.detailData.Url);