离子科尔多瓦AngularJs:为什么离子Facebook分享作品服务(浏览器),但不能弹出显示在Android设备? [英] Ionic Cordova AngularJs : Why Facebook share works in Ionic serve (browser) but not pop-up display in Android Device?

查看:106
本文介绍了离子科尔多瓦AngularJs:为什么离子Facebook分享作品服务(浏览器),但不能弹出显示在Android设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过以​​下code,它与离子伺候(浏览器)的作品,当我点击Facebook的分享按钮,我获得一个脸谱窗口弹出的和我没有任何可以分享DATAS的问题。

With the following code, it works with "ionic serve" (browser), when I click on the "Facebook share button", I obtain a "Facebook window pop-up" and I can share datas without any problems.

当我在我的Andr​​oid设备测试,我点击了人人网分享按钮,没有任何的发生!我获得在控制台中没有错误使用铬://检查/#设备

When I test on my Android Device, I click on the "Facebook Share button", nothing's happen ! And I obtain no error in the console with "chrome://inspect/#devices"


  1. 我的脸谱弹出是阻塞的设备?

  2. 为什么没有在设备上?显示

  3. 任何想法?

在我的控制器

window.fbAsyncInit = function() {
  FB.init({
    appId  : 'xxxMyIdxxx',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
};

(function() {
  var e = document.createElement('script');
  //e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
  e.src="https://connect.facebook.net/en_US/all.js";
  e.async = true;
  document.getElementById('share_button').appendChild(e);
}());

$scope.shareFacebook = function(){

  var titleShareFb = "myTitle1";
  var imgShareFb = "http://www.example.com/img/1.jpg";

  //e.preventDefault();
  FB.ui({
    method: 'feed',
    name: titleShareFb,
    link: 'http://www.example.com',
    picture: imgShareFb,

    caption: 'myCaption1',
    description: 'myDescription1',
    message: ''
  });
}; //end of $scope.shareFacebook = function(){

在我看来

<div id="cssShareFacebook">
    <img ng-click="shareFacebook()" id="share_button" src="http://www.example.fr/img/facebookShare.png">
</div>

感谢您

推荐答案

你在这里,我可以找到最好的解决方法:

here you are the best solution that I can found :

我用这个源(你可以做什么,仔细看,你不能做什么)
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/blob/master/README.md

在离子阵线,我称之为网址

$scope.urlFacebook = function(){
  var urlFb = "http://www.troubadourstory.fr/App/fb_share/" + $scope.point._id;
  window.plugins.socialsharing.share(null, null, null, urlFb);   
};

在后面我用HTML元这样

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" class="">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="imagetoolbar" content="no">
    <title>J'ai visité "<%= dataPoi.Poi.title %>" avec l'application mobile Troubadour Story !</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache,must-revalidate">
    <meta http-equiv="expires" content="0">
    <meta property="og:image" content="<%= dataPoi.Poi.picture %>" height="150px" width="150px">
    <meta name="keywords" content="<%= dataPoi.Poi.title %>">
    <meta name="description" content='Présenté par "<%= dataPoi.Poi.user.username %>" : <%= dataPoi.Poi.content %>'>
  </head>

你可以测试你的HTML元网址此链接
https://developers.facebook.com/tool​​s/debug

希望,这可以帮助; - )

Hope, this, can help ;-)

这篇关于离子科尔多瓦AngularJs:为什么离子Facebook分享作品服务(浏览器),但不能弹出显示在Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆