{"id":4740,"url":"https://github.com/reactnativecn/react-native-qq","last_synced_at":"2025-10-10T20:36:44.664Z","repository":{"id":2913421,"uuid":"47870122","full_name":"reactnativecn/react-native-qq","owner":"reactnativecn","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-10T13:55:42.000Z","size":12052,"stargazers_count":307,"open_issues_count":43,"forks_count":86,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-10-06T06:45:48.787Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactnativecn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-12-12T08:11:45.000Z","updated_at":"2025-06-30T20:30:11.000Z","dependencies_parsed_at":"2024-06-18T21:12:35.783Z","dependency_job_id":"b5f1cd90-a4e5-4c70-924e-052fcd9a719f","html_url":"https://github.com/reactnativecn/react-native-qq","commit_stats":{"total_commits":37,"total_committers":7,"mean_commits":5.285714285714286,"dds":0.6756756756756757,"last_synced_commit":"cf8311b828e8044d98379675de76c0e902992263"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reactnativecn/react-native-qq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactnativecn%2Freact-native-qq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactnativecn%2Freact-native-qq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactnativecn%2Freact-native-qq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactnativecn%2Freact-native-qq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactnativecn","download_url":"https://codeload.github.com/reactnativecn/react-native-qq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactnativecn%2Freact-native-qq/sbom","scorecard":{"id":765997,"data":{"date":"2025-08-11","repo":{"name":"github.com/reactnativecn/react-native-qq","commit":"7f76e712680856ed676de7d3b29d89fe37698e3b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 4/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":8,"reason":"binaries present in source code","details":["Warn: binary detected: android/libs/open_sdk_r5793_lite.jar:1","Warn: binary detected: ios/RCTQQAPI/TencentOpenAPI.framework/TencentOpenAPI:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T00:49:03.172Z","repository_id":2913421,"created_at":"2025-08-23T00:49:03.172Z","updated_at":"2025-08-23T00:49:03.172Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002123,"owners_count":26083314,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-01-05T20:17:21.865Z","updated_at":"2025-10-10T20:36:44.646Z","avatar_url":"https://github.com/reactnativecn.png","language":"Objective-C","readme":"# react-native-qq [![npm version](https://badge.fury.io/js/react-native-qq.svg)](http://badge.fury.io/js/react-native-qq)\n\nReact Native的QQ登录插件, react-native版本需要0.40.0及以上\n\n## 如何安装\n\n### 首先安装npm包\n\n```bash\nyarn add react-native-qq\n```\n或\n\n```bash\nnpm install react-native-qq --save\n```\n\n然后执行\n\n```bash\nreact-native link react-native-qq\n```\n\n### 安装iOS工程\n\n在工程target的`Build Phases-\u003eLink Binary with Libraries`中加入`libRCTQQAPI.a、libiconv.tbd、libsqlite3.tbd、libz.tbd、libc++.tbd`\n\n在 `Build Settings-\u003eSearch Paths-\u003eFramework Search Paths`（如果你找不到Framework Search Paths，请注意选择Build Settings下方的All，而不是Basic） 中加入路径 `$(SRCROOT)/../node_modules/react-native-qq/ios/RCTQQAPI`\n\n在 `Build Settings-\u003eLink-\u003eOther Linker Flags` 中加入 `-framework \"TencentOpenAPI\"`\n\n在 `Apple LLVM X.X - Custom Compiler Flags-\u003eLink-\u003eOther C Flags`中加入 `-isystem \"$(SRCROOT)/../node_modules/react-native-qq/ios/RCTQQAPI\"`\n\n在工程plist文件中加入qq白名单：(ios9以上必须)\n请以文本方式打开Info.plist，在其中添加\n```xml\n\u003ckey\u003eLSApplicationQueriesSchemes\u003c/key\u003e\n\u003carray\u003e\n    \u003c!-- QQ、Qzone URL Scheme 白名单--\u003e\n    \u003cstring\u003emqqapi\u003c/string\u003e\n    \u003cstring\u003emqq\u003c/string\u003e\n    \u003cstring\u003emqqOpensdkSSoLogin\u003c/string\u003e\n    \u003cstring\u003emqqconnect\u003c/string\u003e\n    \u003cstring\u003emqqopensdkdataline\u003c/string\u003e\n    \u003cstring\u003emqqopensdkgrouptribeshare\u003c/string\u003e\n    \u003cstring\u003emqqopensdkfriend\u003c/string\u003e\n    \u003cstring\u003emqqopensdkapi\u003c/string\u003e\n    \u003cstring\u003emqqopensdkapiV2\u003c/string\u003e\n    \u003cstring\u003emqqopensdkapiV3\u003c/string\u003e\n    \u003cstring\u003emqzoneopensdk\u003c/string\u003e\n    \u003cstring\u003ewtloginmqq\u003c/string\u003e\n    \u003cstring\u003ewtloginmqq2\u003c/string\u003e\n    \u003cstring\u003emqqwpa\u003c/string\u003e\n    \u003cstring\u003emqzone\u003c/string\u003e\n    \u003cstring\u003emqzonev2\u003c/string\u003e\n    \u003cstring\u003emqzoneshare\u003c/string\u003e\n    \u003cstring\u003ewtloginqzone\u003c/string\u003e\n    \u003cstring\u003emqzonewx\u003c/string\u003e\n    \u003cstring\u003emqzoneopensdkapiV2\u003c/string\u003e\n    \u003cstring\u003emqzoneopensdkapi19\u003c/string\u003e\n    \u003cstring\u003emqzoneopensdkapi\u003c/string\u003e\n    \u003cstring\u003emqzoneopensdk\u003c/string\u003e\n \u003c/array\u003e\n```\n\n在`Info-\u003eURL Types` 中增加QQ的scheme： `Identifier` 设置为`qq`, `URL Schemes` 设置为你注册的QQ开发者账号中的APPID，需要加前缀`tencent`，例如`tencent1104903684`\n\n在你工程的`AppDelegate.m`文件中添加如下代码：\n\n```\n#import \u003cReact/RCTLinkingManager.h\u003e\n\n- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {\n  return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];\n}\n\n```\n\n### 安装Android工程\n\n在`android/app/build.gradle`里，defaultConfig栏目下添加如下代码：\n\n```\nmanifestPlaceholders = [\n    QQ_APPID: \"\u003c平台申请的APPID\u003e\"\n]\n```\n\n以后如果需要修改APPID，只需要修改此一处。\n\n另外，确保你的MainActivity.java中有`onActivityResult`的实现：\n\n```java\n    @Override\n    public void onActivityResult(int requestCode, int resultCode, Intent data){\n        super.onActivityResult(requestCode, resultCode, data);\n        mReactInstanceManager.onActivityResult(requestCode, resultCode, data);\n    }\n```\n\n## 如何使用\n\n### 引入包\n\n```\nimport * as QQAPI from 'react-native-qq';\n```\n\n### API\n\n#### QQAPI.login([scopes])\n\n- scopes: 登录所申请的权限，默认为get_simple_userinfo。 需要多个权限时，以逗号分隔。\n\n调用QQ登录，可能会跳转到QQ应用或者打开一个网页浏览器以供用户登录。在本次login返回前，所有接下来的login调用都会直接失败。\n\n返回一个`Promise`对象。成功时的回调为一个类似这样的对象：\n\n```javascript\n{\n\t\"access_token\": \"CAF0085A2AB8FDE7903C97F4792ECBC3\",\n\t\"openid\": \"0E00BA738F6BB55731A5BBC59746E88D\"\n\t\"expires_in\": \"1458208143094.6\"\t\n\t\"oauth_consumer_key\": \"12345\"\n}\n```\n\n#### QQAPI.shareToQQ(data)\n\n分享到QQ好友，参数同QQAPI.shareToQzone，返回一个`Promise`对象\n\n#### QQAPI.shareToQzone(data)\n\n分享到QZone，参数为一个object，可以有如下的形式：\n\n```javascript\n// 分享图文消息\n{\t\n\ttype: 'news',\n\ttitle: 分享标题,\n\tdescription: 描述,\n\twebpageUrl: 网页地址,\n\timageUrl: 远程图片地址,\n}\n\n// 其余格式尚未实现。\n```\n\n## 常见问题\n\n#### Android: 调用QQAPI.login()没有反应\n\n通常出现这个原因是因为Manifest没有配置好，检查Manifest中有关Activity的配置。\n\n#### Android: 已经成功激活QQ登录，但回调没有被执行\n\n通常出现这个原因是因为MainActivity.java中缺少onActivityResult的调用。\n","funding_links":[],"categories":["Components"],"sub_categories":["Integrations"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactnativecn%2Freact-native-qq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactnativecn%2Freact-native-qq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactnativecn%2Freact-native-qq/lists"}