BlackBerry WebWorks to invoke popping BB10 Share panel/screen

*爱你&永不变心* 提交于 2020-01-07 04:24:06

问题


How can u get my webworks app to pop open the blackberry 10 share panel?

Ex: open a website in the browser, click the overflow button and then click share

Thank you!


回答1:


You'll want to look at the invokeTargetPicker API.

Essentially, you create a request

var request = {
  action: 'bb.action.SHARE',

  // for a file
  uri: 'file://' + path,

  // for text you'd use 'data'
  data: 'I am awesome',

  target_type: ["APPLICATION", "VIEWER", "CARD"]
};

Then you call the API

blackberry.invoke.card.invokeTargetPicker(request, "Your Title",

    // success callback
    function() {
        console.log('success');
    },

    // error callback
    function(e) {
        console.log('error: ' + e);
    }
);

API Documentation is available here: https://developer.blackberry.com/html5/apis/blackberry.invoke.card.html#.invokeTargetPicker

I wrote a sample app, which you can test out on our GitHub repo: https://github.com/ctetreault/BB10-WebWorks-Samples/tree/master/ShareTargets




回答2:


This should be an option that appears on any link, image or Text: "Share". Is the item not present in the Cross Cut menu shown?



来源:https://stackoverflow.com/questions/14897826/blackberry-webworks-to-invoke-popping-bb10-share-panel-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!