npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ltg-qq

v0.0.6

Published

codrova/phonegap wrapper for qq sdk

Downloads

56

Readme

cordova-plugin-qqsdk

npm npm platform GitHub license

A Cordova wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQ Zone Sharing etc.. 简体中文.

Table of Contents

Feature

  1. QQ SSO Login
  2. QQ Logout
  3. QQ Share (Text、Image、News、Audio)
  4. QQZone Share(Text、Image、News、Audio)
  5. QQ Favorites(Text、Image、News、Audio)
  6. checkClientInstalled

Requirements

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

Installation

1.cordova plugin add cordova-plugin-qqsdk --variable QQ_APP_ID=YOUR_QQ_APPID
2. cordova build

Documentation

Support API

  1. ssoLogin
  2. Logout
  3. checkClientInstalled
  4. Share(see form below)

| Platform | iOS | iOS   | iOS   | Android | Android | Android | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | ShareScene  |  QQ   |   QQZone | QQ Favorite |  QQ   |   QQZone | QQ Favorite | | Text     |    √   |     √    | √       |    ✕    |     √    | √       | | Image     |    √   |   √  | √     |    √  |   √  | √     | |     News       |    √   |     √    |     √       |    √    |     √    |     √       | |     Audio       |    √   |     √    |     √       |    √    |     √    |     √       |

Error Code

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

Image

This plugin support three Image types:

  1. Network URL
  2. Base64
  3. Absolute file path

Usage

checkClientInstalled
var args = {};
args.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;
QQSDK.checkClientInstalled(function () {
  alert('client is installed');
}, function () {
  // if installed QQ Client version is not supported sso,also will get this error
  alert('client is not installed');
}, args);
ssoLogin
var args = {};
args.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;
QQSDK.ssoLogin(function (result) {
  alert('token is ' + result.access_token);
  alert('userid is ' + result.userid);
  alert('expires_time is ' + new Date(parseInt(result.expires_time)) + ' TimeStamp is ' + result.expires_time);
}, function (failReason) {
  alert(failReason);
}, args);
logout
QQSDK.logout(function () {
  alert('logout success');
}, function (failReason) {
  alert(failReason);
});
shareText
var args = {};
args.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;
args.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite
args.text = '这个是 Cordova QQ 分享文字';
QQSDK.shareText(function () {
  alert('shareText success');
}, function (failReason) {
  alert(failReason);
}, args);
shareImage
var args = {};
args.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;
args.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite
args.title = '这个是 Cordova QQ 图片分享的标题';
args.description = '这个是 Cordova QQ 图片分享的描述';
args.image = 'https://cordova.apache.org/static/img/cordova_bot.png';
QQSDK.shareImage(function () {
  alert('shareImage success');
}, function (failReason) {
  alert(failReason);
}, args);
shareNews
var args = {};
args.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;
args.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite
args.url = 'https://cordova.apache.org/';
args.title = '这个是 Cordova QQ 新闻分享的标题';
args.description = '这个是 Cordova QQ 新闻分享的描述';
args.image = 'https://cordova.apache.org/static/img/cordova_bot.png';
QQSDK.shareNews(function () {
  alert('shareNews success');
}, function (failReason) {
  alert(failReason);
}, args);
shareAudio
var args = {};
args.client = QQSDK.ClientType.QQ;//QQSDK.ClientType.QQ,QQSDK.ClientType.TIM;
args.scene = QQSDK.Scene.QQ;//QQSDK.Scene.QQZone,QQSDK.Scene.Favorite
args.url = 'https://y.qq.com/portal/song/001OyHbk2MSIi4.html';
args.title = '十年';
args.description = '陈奕迅';
args.image = 'https://y.gtimg.cn/music/photo_new/T001R300x300M000003Nz2So3XXYek.jpg';
args.flashUrl = 'http://stream20.qqmusic.qq.com/30577158.mp3';
QQSDK.shareAudio(function () {
  alert('shareAudio success');
}, function (failReason) {
  alert(failReason);
}, args);
getUserInfo
var url = 'https://graph.qq.com/user/get_user_info?access_token=' + accessToken + '&oauth_consumer_key=' + QQ_APP_ID + '&openid=' + userId;
http.get(url)

About SDK

This plugin use 3.2.1 version sdk for Android,3.2.3 version sdk for iOS. You can download lastest version sdk here

Notes

  1. This plugin is required Cordova-Android version >=4.0,so using Cordova 5.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 !!!
  5. long share URL and large image shoud be avoid.

Demo

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

Contributing

Feel free to contribute

License

cordova-plugin-qqsdk is released under the MIT license. See LICENSE file for more information.