{"id":18885152,"url":"https://github.com/bozaigao/react-native-wechat-with-miniprogram-share","last_synced_at":"2026-05-07T08:34:01.424Z","repository":{"id":57341500,"uuid":"196171376","full_name":"bozaigao/react-native-wechat-with-miniprogram-share","owner":"bozaigao","description":"在react-native-wechat@1.9.10组件版本的基础上增加了小程序分享,支持在线和本地图片分享","archived":false,"fork":false,"pushed_at":"2019-12-19T03:15:21.000Z","size":10198,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-25T04:45:21.323Z","etag":null,"topics":["android","ios","miniprogram","react-native","wechat","wechat-sdk"],"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/bozaigao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-10T09:03:48.000Z","updated_at":"2019-12-19T03:15:23.000Z","dependencies_parsed_at":"2022-09-10T14:11:43.199Z","dependency_job_id":null,"html_url":"https://github.com/bozaigao/react-native-wechat-with-miniprogram-share","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozaigao%2Freact-native-wechat-with-miniprogram-share","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozaigao%2Freact-native-wechat-with-miniprogram-share/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozaigao%2Freact-native-wechat-with-miniprogram-share/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bozaigao%2Freact-native-wechat-with-miniprogram-share/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bozaigao","download_url":"https://codeload.github.com/bozaigao/react-native-wechat-with-miniprogram-share/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239858411,"owners_count":19708856,"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":["android","ios","miniprogram","react-native","wechat","wechat-sdk"],"created_at":"2024-11-08T07:17:05.220Z","updated_at":"2026-02-23T04:30:16.578Z","avatar_url":"https://github.com/bozaigao.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-wechat-with-miniprogram-share\n在react-native-wechat@1.9.10组件版本的基础上增加了小程序分享,支持在线和本地图片分享\n\n### 安装方法\n执行npm i react-native-wechat-with-miniprogram-share --save安装组件\n\n#### Android端配置\nreact-native link react-native-wechat-with-miniprogram-share链接Android原生模块\n\n#### iOS端配置\n将react-native-wechat-with-miniprogram-share/ios/RCTWeChat.xcodeproj文件拖入ios项目Libraries,并在TARGETS=\u003eBuild Phases=\u003eLink Binary With Libraries添加libWeChatSDK.a静态库文件.\n![iOS配置一](./iOS_step1.jpeg)       ![iOS配置二](./iOS_step2.jpeg)\n\n### 其他使用方法同[react-native-wechat](https://github.com/yorkie/react-native-wechat),微信小程序分享参考以下代码\n```javascript\nimport * as WeChat from 'react-native-wechat-with-miniprogram-share';\n\nexport function shareToWXMiniProgram(id, title, thumb) {\n    //微信应用注册\n    WeChat.registerApp(wechatAppId);\n    WeChat.isWXAppInstalled().then(isInstalled =\u003e {\n        if (isInstalled) {\n            //小程序分享链接自己根据参数进行拼接\n            let shareUrl = 'xxx';\n            //要分享的小程序id\n            let miniUserName = 'xxx';\n            WeChat.shareToWXMiniProgram({title, thumb,shareUrl,miniUserName})\n                .then(wxShareResult =\u003e {\n                    if (wxShareResult.errCode === 0) {\n                        // Toast.success('分享成功');\n                    }\n                })\n                .catch(error =\u003e {\n                    console.log(error.message);\n                    // Toast.message('分享失败');\n                });\n        } else {\n            Toast.message('未安装微信');\n        }\n    });\n}\n```\n\n#### 分享效果图\n![分享效果图](./miniprogram_share1.png)      ![分享效果图](./miniprogram_share2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbozaigao%2Freact-native-wechat-with-miniprogram-share","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbozaigao%2Freact-native-wechat-with-miniprogram-share","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbozaigao%2Freact-native-wechat-with-miniprogram-share/lists"}