{"id":20103269,"url":"https://github.com/bmfe/eros-plugin-ios-wxshare","last_synced_at":"2025-05-06T08:31:14.603Z","repository":{"id":90566736,"uuid":"130185192","full_name":"bmfe/eros-plugin-ios-wxshare","owner":"bmfe","description":null,"archived":false,"fork":false,"pushed_at":"2018-09-06T09:20:07.000Z","size":11,"stargazers_count":3,"open_issues_count":4,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T10:27:28.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-19T08:38:10.000Z","updated_at":"2018-09-06T09:15:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"e07be26d-6e79-484c-b106-f8dd047d19cb","html_url":"https://github.com/bmfe/eros-plugin-ios-wxshare","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-plugin-ios-wxshare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-plugin-ios-wxshare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-plugin-ios-wxshare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmfe%2Feros-plugin-ios-wxshare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmfe","download_url":"https://codeload.github.com/bmfe/eros-plugin-ios-wxshare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252648579,"owners_count":21782408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:35:34.989Z","updated_at":"2025-05-06T08:31:14.597Z","avatar_url":"https://github.com/bmfe.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bmWXShare\n\n\u003e 功能简介：基于友盟ShareSDK实现，微信分享（分享到朋友圈，微信好友）及微信授权登录；\n\u003e 在使用分享之前，还需要一些配置 \u003cbr\u003e\n1.首先请到友盟平台注册App获取AppKey; \u003cbr\u003e\n2.iOS平台请参考友盟的[教程](https://developer.umeng.com/docs/66632/detail/66825)配置SSO白名单、及 URL Scheme；\u003cbr\u003e\n3.为了让大家更灵活的根据产品定制样式，分享的页面面板需要自己写。\n\n\n## 集成方式\n\n1. 打开iOS目录`工程目录/platforms/ios/WeexEros`，编辑Podfile文件，添加`ErosPluginWXShare`组件的引用，添加代码如下，**注意**版本号改为最新的版本\n\n\t```ruby\n\tdef common\n    \t...忽略其他库的引用\n    \t# 在这里添加引用 ErosPluginWXShare\n    \tpod 'ErosPluginWXShare', :git =\u003e 'https://github.com/bmfe/eros-plugin-ios-wxshare.git', :tag =\u003e '版本'\n\tend\n\ttarget 'WeexEros' do\n    \tcommon\n\tend\n\t```\n\n2. 在终端中`cd`到此目录下执行 `pod update`，等待命令执行完毕，重新运行项目，如果没有报错则说明`ErosPluginWXShare`组件集成成功；\n\n## 使用\n\n**引用Module**\n\n```js\nvar bmWXShare = weex.requireModule('bmWXShare')\n```\n\n**API**\n\n* 判断是否安装微信app `isInstallWXApp()` \n\n\t\u003e 在使用微信分享或授权登录之前应该判断是否安装了微信app，如果没有安装应该隐藏相关功能按钮\n\n\t```js\n\t// 同步方法\n\tvar result = bmWXShare.isInstallWXApp()\n\t```\n\n* 初始化友盟SDK `initUM('appkey')` \n\n\t\u003e 在使用之前，请先调用此方法初始化友盟SDK\n\n\t```js\n\tbmWXShare.initUM('友盟平台申请的appkey')\n\t```\n\n* 初始化微信SDK `initWX(info)`\n\n\t\u003e 在使用分享到微信平台功能，或者微信登录功能前，需要调用此方法来初始化微信平台；\n\n\t```js\n\tbmWXShare.initWX({\n\t  appKey: 'appkey', // 微信开发平台申请的appkey\n\t  appSecret: 'appSecret', // appKey对应的appSecret，\n\t  redirectURL: '回调页面' // 授权回调页面\n\t})\n\t```\n\n* 分享：`share(info,successCallback,failedCallback)`\n\n\t```js\n\tbmWXShare.share({\n\t  title:'', // 分享的标题\n\t  content:'', // 分享的文字内容\n\t  url: '', // 分享对应的URL地址，如h5、音乐链接、视频链接、小程序的链接\n\t  image: '', // 分享的图片url\n\t  path: '', // 分享小程序用到的页面路径\n\t  shareType: 'Webpage', // 分享的类型\n\t  platform: 'WechatSession' // 分享平台 朋友圈/好友（注意：历史版本的字段名是platforms,现在是一个字符串而不是数组）\n\t},function(resData){ // 注意： 历史版本返回的是一个promise对象，现在的是callback回调 \t\n\t  // 成功回调\n\t},function(resData){\n\t  // 失败回调\n\t})\n\n\t// 分享平台\n\tplatform:[\n\t  WechatSession, // 微信好友\n\t  WechatTimeLine // 分享至朋友圈\n\t]\n\n\t// 分享类型\n\tshareType:[\n\t  Text, // 文字\n\t  Image, // 图片\n\t  TextImage, // 图文\n\t  Webpage, // 网页\n\t  Music, // 音乐\n\t  Video, // 视频\n\t  MiniProgram // 小程序\n\t]\n\t```\n\n* 微信授权登录：`authLogin(callback)`\n\n\t```js\n\tbmWXShare.authLogin(function(resData){\t\n\t  // 授权结果，成功的话会将所有的userInfo返回\n\t  // console.log(resData)\n\t});\n\t```\n\n## Change Log\n**iOS 1.0.4** \u003cbr\u003e\n1.再次修复获取是否安装微信方法无效的问题；\n\n**iOS 1.0.3** \u003cbr\u003e\n1.修复获取是否安装微信方法无效的问题；\n\n**iOS 1.0.2** \u003cbr\u003e\n1.修复shareType字段取值问题；\n\n**iOS 1.0.1** \u003cbr\u003e\n1.修复友盟SDK报错的问题；\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmfe%2Feros-plugin-ios-wxshare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmfe%2Feros-plugin-ios-wxshare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmfe%2Feros-plugin-ios-wxshare/lists"}