blackberry webworks - How to access FB share in BB10? -
i have tried share on facebook not able share anything. code have used is:-
in javascript
fb.init({ appid: 'some id', cookie: true, status:true, xfbml:true, oauth:true }); function posttofeed() { // calling api ... var obj = { method: 'feed', link: 'http://www.example.com', picture: imagetoshare, name: 'name', caption: 'this link shared through application.', description: '' }; function callback(response) { //document.getelementbyid('msg').innerhtml = "post id: " + response['post_id']; } fb.ui(obj, callback); }
in config file
<access uri="http://connect.facebook.net" />
thanks in advance.
if want share app facebook can quite using cards.
i wrote blog post on here: http://devblog.blackberry.com/2013/02/twitter-and-facebook-cards/
basically, you're using blackberry invocation framework invoke card, , passing info card.
function invokefacebook() { blackberry.invoke.invoke({ target: "facebook", action: "bb.action.share", type: "text/plain", data: "i’m eating tacos alex." }, onsuccess, onerror); }
if want share image swap out 'data' attribute with:
uri: 'file://' + pathtofile,
there's sample app on our github repo: https://github.com/ctetreault/bb10-webworks-samples/tree/master/invoke/invoker
blackberry-webworks
No comments:
Post a Comment