Skip to content

qq open api function inspired by Cordova YCQQ Plugin adding extra apis

License

Notifications You must be signed in to change notification settings

miloliu/Cordova-YCQQ-Plugin-EX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Plugin For QQ SDK

version platform GitHub license Contact

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

Feature

  1. QQ SSO Login
  2. QQ Logout
  3. QQ Share
  4. checkClientInstalled

Requirements

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

##Installation

  1. cordova plugin add https://github.com/miloliu/Cordova-YCQQ-Plugin-EX.git --variable QQ_APP_ID=YOUR_QQ_APPID
  2. cordova build

##Notes

  1. you may get a error like this "platforms/android/libs/android-support-v4.jar" already exists!",because you may have duplicate android-support-v4.jar files in your android project. Remove android-support-v4.jar from the /libs folder of your project. fixed by hook
  2. This plugin is required cordova-android version >=4.0,so using cordova 5.0.0 or higher is recommended
  3. This plugin should be used after the deviceready event has been fired!!!
  4. 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)

##Usage

QQ SSO Login

var checkClientIsInstalled = 1;//default is 0,only for iOS
YCQQ.ssoLogin(function(args){
      alert(args.access_token);
      alert(args.userid);
      },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);

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');
});

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

About

qq open api function inspired by Cordova YCQQ Plugin adding extra apis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published