jeudi 3 juillet 2014

How To Share Text in Apps on FirefoxOS


Vote count:

0




I'm developing an app for FirefoxOS. This app needs a button that, when pressed, shares some text in social networks and email.


In some documentation I found this code:



var share = document.querySelector("#share");
if (share)
{
share.onclick = function ()
{
var sharing = new MozActivity({
name: "share",
data:
{
//type: "url", // Possibly text/html in future versions,
number: 1,
url: "http://robertnyman.com"
}
});
}
}


It kind of works and I successfully shared pictures. But I cannot share text at all.


As you can see, there's a type parameter that's commented and it says that it'll be available in future versions.


Do you guys have any idea of how to include text in the data variable that will be shared?


Thanks everyone!



asked 17 secs ago






Aucun commentaire:

Enregistrer un commentaire