4 Star 5 Fork 0

mosandisk / cordova-plugin-qq

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

Cordova Plugin For QQ SDK

version platform GitHub license Contact

This is a Cordova Plugin for QQ SDK . 简体中文.
I also write a cordova plugin for WeiboSDK here.

Feature

  1. QQ SSO Login
  2. QQ Logout
  3. QQ Share
  4. QZone Share
  5. QQ Favorites
  6. checkClientInstalled

Requirements

  • Cordova Version 3.5+
  • Cordova-Android >=4.0
  • Cordova-iOS >=4.0

##Installation

  1. cordova plugin add https://github.com/iVanPan/Cordova_QQ.git --variable QQ_APP_ID=YOUR_QQ_APPID or cordova plugin add cordova-plugin-qqsdk --variable QQ_APP_ID=YOUR_QQ_APPID
  2. cordova build --device

##Notes

  1. This plugin is required cordova-android version >=4.0,so using cordova 5.0.0 or higher is recommended
  2. This plugin should be used after the deviceready event has been fired!!!
  3. If cordova version <5.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 Update:This Bug is fixed in last cordova version(5.1.1)
  4. For Android: make sure your signature is correct !!!

##Usage

QQ SSO Login

var checkClientIsInstalled = 1;//default is 0,only for iOS
YCQQ.ssoLogin(function(args){
      alert("token is " + args.access_token);
      alert("userid is " +args.userid);
      alert("expires_time is "+ new Date(parseInt(args.expires_time)) + " TimeStamp is " +args.expires_time);
      },function(failReason){
       console.log(failReason);
},checkClientIsInstalled);

QQ Logout

YCQQ.logout(function(){
	console.log('logout success');
},function(failReason){
	console.log(failReason);
});

QQ Share

var args = {};
args.url = "";
args.title = "";
args.description = "";
args.imageUrl = "";
args.appName = "";
YCQQ.shareToQQ(function(){
	console.log("share success");
},function(failReason){
	console.log(failReason);
},args);

QZone Share

 var args = {};
 args.url = "http://www.baidu.com";
 args.title = "This is cordova QZone share ";
 args.description = "This is cordova QZone share ";
 var imgs =['https://www.baidu.com/img/bdlogo.png',
 'https://www.baidu.com/img/bdlogo.png',
 'https://www.baidu.com/img/bdlogo.png'];
  args.imageUrl = imgs;
  YCQQ.shareToQzone(function () {
      alert("share success");
  }, function (failReason) {
      alert(failReason);
  }, args);

###QQ Favorites

 var args = {};
 args.url = "http://www.baidu.com";
 args.title = "这个是cordova QQ 收藏测试";
 args.description = "这个是cordova QQ 收藏测试";
 args.imageUrl = "https://www.baidu.com/img/bdlogo.png";
 args.appName = "cordova—QQ";
 YCQQ.addToQQFavorites(function () {
   alert("share success");
 }, function (failReason) {
   alert(failReason);
 }, args);

CheckClientInstalled

YCQQ.checkClientInstalled(function(){
	 console.log('client is installed');
},function(){
	// if installed QQ Client version is not supported sso,also will get this error
	console.log('client is not installed');
});

##Example

  1. install this plugin
  2. backup www folder in your cordova project
  3. replace www by example_www
  4. cordova build & test
example

##ERROR_CODE When you use qq login,you may get an error code.If you get one, find detail error msg from here please.

The MIT License (MIT) Copyright (c) 2015 Van Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

这个一个QQ SDK的Cordova 插件 expand collapse
JavaScript
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
JavaScript
1
https://gitee.com/modisk/cordova-plugin-qq.git
git@gitee.com:modisk/cordova-plugin-qq.git
modisk
cordova-plugin-qq
cordova-plugin-qq
master

Search