mercredi 25 février 2015

Unable to 'share' URL on Facebook and Twitter native apps on Firefox OS

This is the first time that I am exploring the share functionality for sharing a URL on Facebook / Twitter native apps and I would appreciate some help to get this functionality working.


I checked and noticed that the boilerplate app doest actually work in this case. Issues with snapshots.


Basically the issue is that these social networking apps are not getting the URLs that are sent through Web Activities.


Has anyone faced this issue before? How do I resolve this?


Here is the Firefox OS app code that I have so far (pretty much similar to boilerplate app):


JS:



"use strict";
(function () {

var share = document.querySelector("#share");
if (share) {
share.onclick = function () {
new MozActivity({
name: "share",
data: {
url: "http://www.google.com"
}
});
};
}
})();


HTML:



<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
</head>

<body>
<main>
<button id="share">Share URL</button>
</main>

<script type="text/javascript" src="js/webapp.js"></script>
</body>

</html>


How do I get this working?


Aucun commentaire:

Enregistrer un commentaire