Facebook Login 登录 APP开发实现唤起 Facebook应用授权三方 Login 登录

1.首先到 Facebook Login 登录 官方申请接口

地址:https://developers.facebook.com/docs/facebook-login

获取到接口数据之后,在一门开发者后台输入接口信息

2.在一门开发者后台找 Facebook Login 登录功能模块

Facebook Login 登录

如图,在配置-配置移动版-找到Facebook登录功能

点击功能模块,会弹出模块配置界面;

Facebook Login 登录

在弹出的配置界面,点击勾选打包;

之后点击保存按钮;

3.点击【去配置Facebook】按钮,跳转页面到登录接口信息配置页面

Facebook Login 登录
Facebook Login 登录

如图所示,将在脸书开发中心申请好的APPID填写到这里,之后点击保存;

保存之后,点击左侧的【生成安装包】按钮,在线生成新版APK安装包;

4.在页面HTML网页上执行我们提供的JS映射接口

https://www.yimenapp.com/doc/demo_fblogin.cshtml

根据demo页面的JS代码自行在自己网页上构建撰写JS;

核心代码示例,详情参阅demo

jsBridge.fbLogin.login({
  //字符串数组,需要申请的权限
  //所有可用权限请查看 权限参考文档,部分权限需要 Facebook 审核后才可用
  permissions: [ "public_profile" ]
}, function(succ, data) {
  if (data.result == "success") {
    //data.accessToken.token
    //data.accessToken.userId
    //...
    //请使用 data.accessToken 参数调用服务器端 图谱 API 完成更多操作
    alert("登录成功:\n" + JSON.stringify(data));
  } else if (data.result == "cancel") {
    alert("已取消登录");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

这样我们在APP内点击对应的按钮即可实现APP拉起脸书APP,并获取到脸书返回的字符串;

之后将获取到的数据绑定到自己数据库,为用户ID一一对应客户的脸书ID。

这样就实现了APP唤起脸书实现三方授权登录了。

shareMedia 多媒体 APP开发接入 Facebook Share 分享SDK能力

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

shareMedia 多媒体 APP开发接入 Facebook Share 分享SDK能力

核心代码示例,详情参阅demo

jsBridge.fbShare.shareMedia({
  //可选的公共参数
  //...
  //可选,照片数组
  photos: [
    {
      url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
      caption: "图一的说明",
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/2.jpg",
      caption: "图二的说明",
      userGenerated: false
    }
  ],
  //可选,视频数组
  videos: [
    "https://flv4mp4.people.com.cn/videofile7/pvmsvideo/2022/2/25/GuiZhouPinDao-TuMin_5905588433c0cefc445c910f6e7f772d.MP4",
    "https://flv3.people.com.cn/dev1/mvideo/vodfiles/2020/06/24/da474a070de6618985811f72a523ba55_c.mp4"
  ]
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.shareMedia({
  //可选的公共参数
  //...
  //可选,照片数组
  photos: [
    {
      url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
      caption: "图一的说明",
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/2.jpg",
      caption: "图二的说明",
      userGenerated: false
    }
  ],
  //可选,视频数组
  videos: [
    "https://flv4mp4.people.com.cn/videofile7/pvmsvideo/2022/2/25/GuiZhouPinDao-TuMin_5905588433c0cefc445c910f6e7f772d.MP4",
    "https://flv3.people.com.cn/dev1/mvideo/vodfiles/2020/06/24/da474a070de6618985811f72a523ba55_c.mp4"
  ]
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.shareMedia({
  //可选的公共参数
  //...
  //可选,照片数组
  photos: [
    {
      url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
      caption: "图一的说明",
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/2.jpg",
      caption: "图二的说明",
      userGenerated: false
    }
  ],
  //可选,视频数组
  videos: [
    "https://flv4mp4.people.com.cn/videofile7/pvmsvideo/2022/2/25/GuiZhouPinDao-TuMin_5905588433c0cefc445c910f6e7f772d.MP4",
    "https://flv3.people.com.cn/dev1/mvideo/vodfiles/2020/06/24/da474a070de6618985811f72a523ba55_c.mp4"
  ]
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->

shareVideo 视频 APP开发接入 Facebook Share 分享SDK能力

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

shareVideo 视频 APP开发接入 Facebook Share 分享SDK能力

核心代码示例,详情参阅demo

jsBridge.fbShare.shareVideo({
  //可选的公共参数
  //...
  //描述
  contentDescription: "the description of the video",
  //标题
  contentTitle: "the title to display for this video",
  //预览图 the photo to be used as a preview for the video
  previewPhoto: {
    url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
    caption: "图片说明",
    userGenerated: false
  },
  //视频链接
  videoUrl: "https://flv4mp4.people.com.cn/videofile7/pvmsvideo/2022/2/25/GuiZhouPinDao-TuMin_5905588433c0cefc445c910f6e7f772d.MP4"
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.shareVideo({
  //可选的公共参数
  //...
  //描述
  contentDescription: "the description of the video",
  //标题
  contentTitle: "the title to display for this video",
  //预览图 the photo to be used as a preview for the video
  previewPhoto: {
    url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
    caption: "图片说明",
    userGenerated: false
  },
  //视频链接
  videoUrl: "https://flv4mp4.people.com.cn/videofile7/pvmsvideo/2022/2/25/GuiZhouPinDao-TuMin_5905588433c0cefc445c910f6e7f772d.MP4"
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.shareVideo({
  //可选的公共参数
  //...
  //描述
  contentDescription: "the description of the video",
  //标题
  contentTitle: "the title to display for this video",
  //预览图 the photo to be used as a preview for the video
  previewPhoto: {
    url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
    caption: "图片说明",
    userGenerated: false
  },
  //视频链接
  videoUrl: "https://flv4mp4.people.com.cn/videofile7/pvmsvideo/2022/2/25/GuiZhouPinDao-TuMin_5905588433c0cefc445c910f6e7f772d.MP4"
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->

sharePhoto 照片 APP开发接入 Facebook Share 分享SDK 实现APP分享到 Facebook 能力

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

sharePhoto 照片 APP开发接入 Facebook Share 分享SDK 实现APP分享到 Facebook 能力

核心代码示例,详情参阅demo

jsBridge.fbShare.sharePhoto({
  //可选的公共参数
  //...
  //照片数组
  photos: [
    {
      url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
      caption: "图一的说明",
      //照片是用户还是应用生成的 whether the photo represented by this object was generated by the user or by the application
      //布尔类型
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/2.jpg",
      caption: "图二的说明",
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/3.jpg",
      caption: "图三的说明",
      userGenerated: false
    }
  ]
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.sharePhoto({
  //可选的公共参数
  //...
  //照片数组
  photos: [
    {
      url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
      caption: "图一的说明",
      //照片是用户还是应用生成的 whether the photo represented by this object was generated by the user or by the application
      //布尔类型
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/2.jpg",
      caption: "图二的说明",
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/3.jpg",
      caption: "图三的说明",
      userGenerated: false
    }
  ]
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.sharePhoto({
  //可选的公共参数
  //...
  //照片数组
  photos: [
    {
      url    : "https://i.cdn.yimenapp.com/sys/1.jpg",
      caption: "图一的说明",
      //照片是用户还是应用生成的 whether the photo represented by this object was generated by the user or by the application
      //布尔类型
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/2.jpg",
      caption: "图二的说明",
      userGenerated: false
    },
    {
      url    : "https://i.cdn.yimenapp.com/sys/3.jpg",
      caption: "图三的说明",
      userGenerated: false
    }
  ]
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->

shareLink 链接 Facebook Share 分享 APP开发接入 Facebook Share 分享SDK功能

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

shareLink 链接 Facebook Share 分享 APP开发接入 Facebook Share 分享SDK功能

核心代码示例,详情参阅demo

jsBridge.fbShare.shareLink({
  //其他公共参数
  //...
  //话题 the ShareHashtag for this content
  hashtag   : "#UkraineCrisis",
  //链接 the URL for the content being shared
  contentUrl: "https://m.baidu.com",
  //引用 the quote to display for this link
  quote     : "Connect on a global scale."
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

/*
所有分享接口都支持的公共参数
{
    //链接 the URL for the content being shared
    //可选,字符串
    contentUrl: "https://m.baidu.com",
    //标记人 the list of Ids for taggable people to tag with this content
    //可选,字符串数组
    peopleIds : [],
    //位置 the Id for a place to tag with this content
    //可选,字符串
    placeId   : "",
    //页面 the Id of the Facebook page this share is associated with
    //可选,字符串
    pageId    : "",
    //the value to be added to the referrer URL when a person follows a link from this shared content on feed
    //可选,字符串
    ref       : "",
    //话题 the ShareHashtag for this content
    //可选,#号开头的字符串
    hashtag   : ""
}
*/

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.shareLink({
  //其他公共参数
  //...
  //话题 the ShareHashtag for this content
  hashtag   : "#UkraineCrisis",
  //链接 the URL for the content being shared
  contentUrl: "https://m.baidu.com",
  //引用 the quote to display for this link
  quote     : "Connect on a global scale."
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

/*
所有分享接口都支持的公共参数
{
    //链接 the URL for the content being shared
    //可选,字符串
    contentUrl: "https://m.baidu.com",
    //标记人 the list of Ids for taggable people to tag with this content
    //可选,字符串数组
    peopleIds : [],
    //位置 the Id for a place to tag with this content
    //可选,字符串
    placeId   : "",
    //页面 the Id of the Facebook page this share is associated with
    //可选,字符串
    pageId    : "",
    //the value to be added to the referrer URL when a person follows a link from this shared content on feed
    //可选,字符串
    ref       : "",
    //话题 the ShareHashtag for this content
    //可选,#号开头的字符串
    hashtag   : ""
}
*/

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbShare.shareLink({
  //其他公共参数
  //...
  //话题 the ShareHashtag for this content
  hashtag   : "#UkraineCrisis",
  //链接 the URL for the content being shared
  contentUrl: "https://m.baidu.com",
  //引用 the quote to display for this link
  quote     : "Connect on a global scale."
}, function(succ, data) {
  if (data.result == "success") {
    alert("成功:" + data.postId);
  } else if (data.result == "cancel") {
    alert("取消");
  } else if (data.result == "error") {
    alert("错误:" + data.message);
  } else {
    alert(JSON.stringify(data));
  }
});

/*
所有分享接口都支持的公共参数
{
    //链接 the URL for the content being shared
    //可选,字符串
    contentUrl: "https://m.baidu.com",
    //标记人 the list of Ids for taggable people to tag with this content
    //可选,字符串数组
    peopleIds : [],
    //位置 the Id for a place to tag with this content
    //可选,字符串
    placeId   : "",
    //页面 the Id of the Facebook page this share is associated with
    //可选,字符串
    pageId    : "",
    //the value to be added to the referrer URL when a person follows a link from this shared content on feed
    //可选,字符串
    ref       : "",
    //话题 the ShareHashtag for this content
    //可选,#号开头的字符串
    hashtag   : ""
}
*/

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->

setAdvertiserIDCollectionEnabled 启/停 收集广告主编号 APP开发接入Facebook 应用事件SDK

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

setAdvertiserIDCollectionEnabled 启/停 收集广告主编号 APP开发接入Facebook 应用事件SDK

核心代码示例,详情参阅demo

jsBridge.fbEvent.setAdvertiserIDCollectionEnabled({
  enabled: true
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbEvent.setAdvertiserIDCollectionEnabled({
  enabled: true
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbEvent.setAdvertiserIDCollectionEnabled({
  enabled: true
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->

setAutoLogAppEventsEnabled 启/停 自动记录事件 APP开发接入Facebook 应用事件SDK

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

setAutoLogAppEventsEnabled 启/停 自动记录事件 APP开发接入Facebook 应用事件SDK

核心代码示例,详情参阅demo

jsBridge.fbEvent.setAutoLogAppEventsEnabled({
  enabled: true
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbEvent.setAutoLogAppEventsEnabled({
  enabled: true
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
jsBridge.fbEvent.setAutoLogAppEventsEnabled({
  enabled: true
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->

logEvent 记录事件 Facebook 应用事件SDK APP开发接入Facebook 应用事件SDK能力

用做网页的技术做APP
一门提供标准化的jsbridge-mini.js库,您只需要在页面引用执行JS即可实现各种原生APP、原生PC的功能能力。

==================APP端==================
【APP端】(安卓版&苹果版)目前提供200+原生功能,2000+JS映射接口,用做网站的技术即可实现各种原生APP能力、APP demo地址https://www.yimenapp.com/doc/demo.cshtml下载教程:
♦ JS-SDK 引用方式:
♦ 普通网页 script 方式加载:下载最新版,请在页面上调用 jsBridge 接口之前引用 jsbridge-mini.js 库;
♦ js module 方式引用:npm install ym-jsbridge 具体请参考 npm package
一门APP开发平台通用JS

Facebook 应用事件_Facebook 应用事件SDK APP开发接入Facebook 应用事件SDK能力

核心代码示例,详情参阅demo

//示例:购买成功
jsBridge.fbEvent.logEvent({
  //必须,字符串类型,事件名称
  name : "fb_mobile_purchase",
  //可选,数字类型,事件值(如付款金额等)
  valueToSum: 123.45,
  //可选,任意 JSON Object 对象,事件参数
  value: {
    fb_currency    : "USD",
    fb_content_type: "Shirt",
    fb_content     : "[{\"id\": \"1234\", \"quantity\": 2}, {\"id\": \"5678\", \"quantity\": 1}]"
  }
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

A标签执行JS示例代码

<a href="javascript:void(0)" onclick="zhixing()">执行</a> 
<!-- 写入一个A标签href值为"javascript:void(0)",定义点击事件onclick;-->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- 在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接;-->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
//示例:购买成功
jsBridge.fbEvent.logEvent({
  //必须,字符串类型,事件名称
  name : "fb_mobile_purchase",
  //可选,数字类型,事件值(如付款金额等)
  valueToSum: 123.45,
  //可选,任意 JSON Object 对象,事件参数
  value: {
    fb_currency    : "USD",
    fb_content_type: "Shirt",
    fb_content     : "[{\"id\": \"1234\", \"quantity\": 2}, {\"id\": \"5678\", \"quantity\": 1}]"
  }
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

}
</script>
<!--执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可;-->

按钮执行JS示例代码

<button onclick="zhixing()" >执行</button>
<!-- //写一个按钮,定义点击执行事件; -->
<script src="您的服务器URL/jsbridge-mini.js"></script>
<!-- //在您的服务器引入一门JS地址,请下载jsbridge-mini.js上传您自己的服务器获取链接; -->
<script type="text/javascript">
function zhixing() {


<!--这里可以直接复制JS核心代码到此{}括号内-->
//示例:购买成功
jsBridge.fbEvent.logEvent({
  //必须,字符串类型,事件名称
  name : "fb_mobile_purchase",
  //可选,数字类型,事件值(如付款金额等)
  valueToSum: 123.45,
  //可选,任意 JSON Object 对象,事件参数
  value: {
    fb_currency    : "USD",
    fb_content_type: "Shirt",
    fb_content     : "[{\"id\": \"1234\", \"quantity\": 2}, {\"id\": \"5678\", \"quantity\": 1}]"
  }
}, function(succ, data) {
  alert(succ ? "操作成功" : "失败\n" + JSON.stringify(data));
});

}
</script>
<!-- //执行核心代码;
//如果需要进入页面就执行,去掉点击事件即可; -->