{"id":13750310,"url":"https://github.com/iVanPan/Cordova_QQ","last_synced_at":"2025-05-09T15:31:59.395Z","repository":{"id":29559834,"uuid":"33099137","full_name":"iVanPan/Cordova_QQ","owner":"iVanPan","description":"A Cordova wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQZone Sharing etc.","archived":false,"fork":false,"pushed_at":"2023-03-17T10:06:59.000Z","size":25128,"stargazers_count":287,"open_issues_count":15,"forks_count":132,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-07T14:46:00.055Z","etag":null,"topics":["cordova-android","cordova-plugin","cordova-wrapper","qq","qqzone","share","social-network","sso-login","tencent-qq-sdk","tim"],"latest_commit_sha":null,"homepage":"","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/iVanPan.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":"2015-03-30T02:27:55.000Z","updated_at":"2024-04-26T11:42:13.000Z","dependencies_parsed_at":"2024-06-19T04:11:49.683Z","dependency_job_id":"657aada4-4464-443f-a0d1-e957f12daad2","html_url":"https://github.com/iVanPan/Cordova_QQ","commit_stats":{"total_commits":165,"total_committers":8,"mean_commits":20.625,"dds":"0.16969696969696968","last_synced_commit":"8c799b5a1c055d39321db390d6f53e4e4bfe239c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iVanPan%2FCordova_QQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iVanPan%2FCordova_QQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iVanPan%2FCordova_QQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iVanPan%2FCordova_QQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iVanPan","download_url":"https://codeload.github.com/iVanPan/Cordova_QQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253275616,"owners_count":21882339,"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":["cordova-android","cordova-plugin","cordova-wrapper","qq","qqzone","share","social-network","sso-login","tencent-qq-sdk","tim"],"created_at":"2024-08-03T08:00:27.608Z","updated_at":"2025-05-09T15:31:58.406Z","avatar_url":"https://github.com/iVanPan.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"# cordova-plugin-qqsdk\n[![npm](https://img.shields.io/npm/v/cordova-plugin-qqsdk.svg)](https://www.npmjs.com/package/cordova-plugin-qqsdk)\n[![npm](https://img.shields.io/npm/dm/cordova-plugin-qqsdk.svg)](https://www.npmjs.com/package/cordova-plugin-qqsdk)\n[![platform](https://img.shields.io/badge/platform-iOS%2FAndroid-lightgrey.svg?style=flat)](https://github.com/iVanPan/Cordova_QQ)\n[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat)](https://github.com/iVanPan/Cordova_QQ/blob/master/LICENSE)\n\nA Cordova wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQ Zone Sharing etc.. [简体中文](https://github.com/iVanPan/Cordova_QQ/blob/master/README_ZH.md).     \n                   \n\n\n## Table of Contents\n\n- [Feature](#feature)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Documentation](#documentation)     \n  - [Error Code](#error-code)\n  - [Support API](#support-api)\n  - [Image](#image)  \n  - [Usage](#usage)\n    - [checkClientInstalled](#checkclientinstalled)\n    - [ssoLogin](#ssologin)\n    - [logout](#logout)\n    - [shareText](#sharetext)\n    - [shareImage](#shareimage)\n    - [shareNews](#sharenews)\n    - [shareAudio](#shareaudio)\n    - [getUserInfo](#getuserinfo)\n- [About SDK](#about-sdk) \n- [Notes](#notes) \n- [Demo](#demo) \n- [Contributing](#contributing) \n- [License](#license) \n\n## Feature\n1. QQ SSO Login\n2. QQ Logout \n3. QQ Share （Text、Image、News、Audio）\n4. QQZone Share（Text、Image、News、Audio）\n5. QQ Favorites（Text、Image、News、Audio）\n6. checkClientInstalled\t\t\n\n## Requirements\n- Cordova Version 3.5+ \n- Cordova-Android \u003e= 7.0\n- Cordova-iOS \u003e= 4.0\t\t\t\n\n## Installation\n1.```cordova plugin add cordova-plugin-qqsdk --variable QQ_APP_ID=YOUR_QQ_APPID```                  \n2. cordova build          \t\t\t\n\n## Documentation\n\n### Support API\n1. ssoLogin\n2. Logout\n3. checkClientInstalled\n4. Share(see form below)\n\n|      Platform      |   iOS  |   iOS     |     iOS      | Android |  Android  |    Android   |\n|        :---:       | :---:  |   :---:   |    :---:     |   :---: |    :---:  |     :---:    |\n|      ShareScene    |   QQ   |   QQZone  |  QQ Favorite |    QQ   |   QQZone  |  QQ Favorite |\n|      Text        |    √   |     √     |      √       |    ✕    |     √     |      √       |\n|      Image         |    √   |     √     |      √       |    √    |     √     |      √       |\n|      News         |    √   |     √     |      √       |    √    |     √     |      √       |\n|      Audio         |    √   |     √     |      √       |    √    |     √     |      √       |\n\n\n### Error Code        \nWhen you use qq login,you may get an error code.If you get one, find detail error msg from [here](http://wiki.open.qq.com/wiki/mobile/API%E8%B0%83%E7%94%A8%E8%AF%B4%E6%98%8E#6._.E8.BF.94.E5.9B.9E.E7.A0.81.E8.AF.B4.E6.98.8E%E3%80%82) please.\n\n### Image\n This plugin support three Image types:\n  1. Network URL\n  2. Base64\n  3. Absolute file path         \n \n### Usage\n##### checkClientInstalled\n```js\nvar args = {};\nargs.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;\nQQSDK.checkClientInstalled(function () {\n  alert('client is installed');\n}, function () {\n  // if installed QQ Client version is not supported sso,also will get this error\n  alert('client is not installed');\n}, args);\n```\n##### ssoLogin\n```js\nvar args = {};\nargs.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;\nQQSDK.ssoLogin(function (result) {\n  alert('token is ' + result.access_token);\n  alert('userid is ' + result.userid);\n  alert('expires_time is ' + new Date(parseInt(result.expires_time)) + ' TimeStamp is ' + result.expires_time);\n}, function (failReason) {\n  alert(failReason);\n}, args);\n\n```\n##### logout\n```js\nQQSDK.logout(function () {\n  alert('logout success');\n}, function (failReason) {\n  alert(failReason);\n});\n```\n##### shareText\n```js\nvar args = {};\nargs.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;\nargs.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite\nargs.text = '这个是 Cordova QQ 分享文字';\nQQSDK.shareText(function () {\n  alert('shareText success');\n}, function (failReason) {\n  alert(failReason);\n}, args);\n```\n##### shareImage\n```js\nvar args = {};\nargs.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;\nargs.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite\nargs.title = '这个是 Cordova QQ 图片分享的标题';\nargs.description = '这个是 Cordova QQ 图片分享的描述';\nargs.image = 'https://cordova.apache.org/static/img/cordova_bot.png';\nQQSDK.shareImage(function () {\n  alert('shareImage success');\n}, function (failReason) {\n  alert(failReason);\n}, args);\n```\n##### shareNews\n```js\nvar args = {};\nargs.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;\nargs.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite\nargs.url = 'https://cordova.apache.org/';\nargs.title = '这个是 Cordova QQ 新闻分享的标题';\nargs.description = '这个是 Cordova QQ 新闻分享的描述';\nargs.image = 'https://cordova.apache.org/static/img/cordova_bot.png';\nQQSDK.shareNews(function () {\n  alert('shareNews success');\n}, function (failReason) {\n  alert(failReason);\n}, args);\n```\n##### shareAudio\n```js\nvar args = {};\nargs.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;\nargs.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite\nargs.url = 'https://y.qq.com/portal/song/001OyHbk2MSIi4.html';\nargs.title = '十年';\nargs.description = '陈奕迅';\nargs.image = 'https://y.gtimg.cn/music/photo_new/T001R300x300M000003Nz2So3XXYek.jpg';\nargs.flashUrl = 'http://stream20.qqmusic.qq.com/30577158.mp3';\nQQSDK.shareAudio(function () {\n  alert('shareAudio success');\n}, function (failReason) {\n  alert(failReason);\n}, args);\n```\n##### getUserInfo\n```js\nvar url = 'https://graph.qq.com/user/get_user_info?access_token=' + accessToken + '\u0026oauth_consumer_key=' + QQ_APP_ID + '\u0026openid=' + userId;\nhttp.get(url)\n```\n\n## About SDK \nThis plugin use 3.2.1 version sdk for Android,3.2.3 version sdk for iOS. You can download lastest version sdk [here](http://wiki.open.qq.com/wiki/mobile/SDK%E4%B8%8B%E8%BD%BD)              \n\n## Notes             \n1. This plugin is required Cordova-Android version \u003e=4.0,so using Cordova 5.0 or higher is recommended\n2. This plugin should be used after the deviceready event has been fired!!!       \n3. ~~If Cordova version  \u003c5.1.1,when two Cordova plugins are modifying “*-Info.plist” CFBundleURLTypes, only the first added plugin is getting the changes applied.so after installing plugin,please check the URLTypes in your Xcode project.You can find this issue [here](https://issues.apache.org/jira/browse/CB-8007)~~ Update:This Bug is fixed in last Cordova version(5.1.1) \n4. For Android: make sure your signature is correct !!!\n5. long share URL and large image shoud be avoid.       \n\n## Demo     \n1. install this plugin\n2. backup www folder in your cordova project\n3. replace www by example_www\n4. install cordova-plugin-camera\n5. cordova build \u0026 test     \n\u003cdiv style=\"text-align:center\"\u003e\u003cimg src=\"https://github.com/iVanPan/Cordova_QQ/blob/master/ScreenShot.png?raw=true\" alt=\"example\" style=\"width:300px\"\u003e\u003c/div\u003e                                \n\n\n## Contributing\nFeel free to contribute                 \n\n## License\n\n**cordova-plugin-qqsdk** is released under the **MIT** license. See [LICENSE](https://github.com/iVanPan/Cordova_QQ/blob/master/LICENSE) file for more information.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FiVanPan%2FCordova_QQ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FiVanPan%2FCordova_QQ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FiVanPan%2FCordova_QQ/lists"}