blackberry webworks facebook share

时光怂恿深爱的人放手 提交于 2019-12-07 22:17:28

问题


I want to embed fb and twitter share on my BB super app, but unfortunately BB doesn't support popups. Is there any way that I can embed fb and twitter share in my app, as we do it in blogs.

Check the code to get popup.

      function share(){

       var share = {
                method: 'stream.share',
                u: 'http://www.example.com'
            };

            FB.ui(share, function(response) { console.log(response); });*/
        /*  $('#iframeDiv').show();

            ServerCall(0,'html','shareFb.php',function(data)
            {
                //$('#Shareiframe').attr('src','http://m.facebook.com/sharer.php?u='+escape('http://www.astrochicks.com'));
                $('#iframeDiv').html(data);
            });
            */
    }
    /*SHARE TWITTER START*/
    var shareTweet = function()
    {
        f='http://twitter.com/share?url='+encodeURIComponent(window.location.href)+'&text='+encodeURIComponent(document.title);

        a=function()
        {
            //if(!window.open(f))
            //location.href=f; 
            window.open(f,'twitterShare','width=500,height=400');
        };
        a();

        /*if(/Firefox/.test(navigator.userAgent))
        {
        setTimeout(a,0)
        }
        else
        {

        }*/
    };

Can it be done using some hidden iframe inside main page??

Thanks


回答1:


You must include blackberry.invoke and blackberry.invoke.BrowserArguments in project

function openURL(url)
{

    var args = new blackberry.invoke.BrowserArguments(url);

    blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);

}



回答2:


You can also install InAppBrowser Plugin. This would open a browser window in the app when you call window.open()

Check here: https://cordova.apache.org/docs/en/3.0.0/cordova/inappbrowser/inappbrowser.html



来源:https://stackoverflow.com/questions/6210856/blackberry-webworks-facebook-share

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