All Projects → iVanPan → React Native Qqsdk

iVanPan / React Native Qqsdk

Licence: mit
A React Native wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQZone Sharing etc

Projects that are alternatives of or similar to React Native Qqsdk

uc-qq-share-to-wechat
触发手机UC、QQ浏览器的原生的微信分享功能
Stars: ✭ 70 (-30%)
Mutual labels:  share, qq
SocialSDK
iOS 实现sina(新浪)、wechat(微信)、qq(腾讯) 登录、分享功能,Share,ShareSDK,高仿友盟SocialSDK UI 实现,可自定义UI实现
Stars: ✭ 64 (-36%)
Mutual labels:  share, qq
ABot-Graia
一个使用 Graia Ariadne 搭建的 QQ 功能性机器人。
Stars: ✭ 194 (+94%)
Mutual labels:  tencent, qq
Sdk3rd
第三方SDK集成库,授权/分享/支付
Stars: ✭ 249 (+149%)
Mutual labels:  share, qq
Cordova qq
A Cordova wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQZone Sharing etc.
Stars: ✭ 294 (+194%)
Mutual labels:  share, qq
YHThirdManager
一个快速、简单、易集成、扩展性好的社交化组件。摒弃友盟等三方库,使用原生SDK。支持微信支付、微信分享、微信登录、微信授权、QQ授权、QQ分享、QQ登录、新浪授权、新浪登录、新浪分享、微博评论、微博获取、支付宝支付。极大的减小了包体积;同时加入了自动管理提示框的功能
Stars: ✭ 41 (-59%)
Mutual labels:  share, qq
tencent kit
flutter版QQ登录/分享
Stars: ✭ 201 (+101%)
Mutual labels:  share, qq
Socialsdklibrary
提供微博、微信、QQ、Tim、QQ 轻聊版、钉钉的登陆分享功能支持;
Stars: ✭ 399 (+299%)
Mutual labels:  share, qq
qqmessageoutput
安卓QQ聊天记录导出
Stars: ✭ 100 (+0%)
Mutual labels:  tencent, qq
ELFChatBot
闲聊QQ机器人,也就是人工智障
Stars: ✭ 61 (-39%)
Mutual labels:  tencent, qq
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 294 (+194%)
Mutual labels:  tencent, qq
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 589 (+489%)
Mutual labels:  tencent, qq
Ichunqiu qqbot
i春秋社区机器人自2018年02月04日开始服务于i春秋社区,每日文章推送、文章查询、魔法币查询、作者信息查询、作家团奖金余额查询、奖金排行榜、i春秋课程查询等一列功能。据不完全统计,使用人数已经超过3.5万,使用次数达到20万,最大覆盖700+个群。
Stars: ✭ 79 (-21%)
Mutual labels:  qq
Shareutil
社会化登录分享工具库
Stars: ✭ 1,275 (+1175%)
Mutual labels:  share
Qnotified
一个旨在使QQ变得更好用的开源Xposed模块
Stars: ✭ 1,180 (+1080%)
Mutual labels:  qq
Nonebot
基于 OneBot 标准的 Python 异步 QQ 机器人框架
Stars: ✭ 1,207 (+1107%)
Mutual labels:  qq
Overlaycontroller
OverlayController easily pop your custom view and provide optional transition animation. written in swift 5.0
Stars: ✭ 94 (-6%)
Mutual labels:  share
Anti Recall
Android 免root 防撤回神器 !
Stars: ✭ 1,274 (+1174%)
Mutual labels:  qq
Qq Group Members
QQ Group Members (QQ 群成员导出)
Stars: ✭ 75 (-25%)
Mutual labels:  qq
Scritch
A small CLI to help you write sharable scripts for your team
Stars: ✭ 74 (-26%)
Mutual labels:  share

react-native-qqsdk

npm npm platform GitHub license

A React Native 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
  4. QZone Share
  5. QQ Favorites
  6. checkClientInstalled

Installation

npm install --save [email protected]

RNPM

 react-native link react-native-qqsdk

CocoaPods

  1. Install package from npm
npm install --save [email protected]
  1. Create a Podfile
  2. Add pod in Podfile something similar to this:
pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'Core',
  'CxxBridge',
  'RCTText',
  'RCTNetwork',
  'RCTImage',
  'RCTWebSocket', # needed for debugging
   # Add any other subspecs you want to use in your project
  'DevSupport'
]
pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod "react-native-qqsdk", :path => "../node_modules/react-native-qqsdk"
  1. Pod install
  2. Follow step 7,8,9 in iOS Setup

Manual

npm install --save [email protected]

iOS Setup

  1. Open your app's Xcode project

  2. Find the RCTQQSDK.xcodeproj file within the node_modules/react-native-qqsdk/ios directory and drag it into the Libraries node in Xcode

  3. Select the project node in Xcode and select the "Build Phases" tab of your project configuration.

  4. Drag libRCTQQSDK.a from Libraries/RCTQQSDK.xcodeproj/Products into the "Link Binary With Libraries" section of your project's "Build Phases" configuration.

  5. Click the plus sign underneath the "Link Binary With Libraries" list and add the libz.tbd,libiconv.tdb,libstdc++.tbd,libsqlite3.tbd,Security.framework,SystemConfiguration.framework,CoreTelephony.framework,CoreGraphics.framework library .

  6. Click the plus sign underneath the "Link Binary With Libraries" list and add the TencentOpenAPI.framework which locate in ../node_modules/react-native-qqsdk/ios/RCTQQSDK. Then Under the "Build Settings" tab of your project configuration, find the "Framework Search Paths" section and edit the value. Add a new value, $(SRCROOT)/../node_modules/react-native-qqsdk/ios/RCTQQSDK.

  7. Under the "Info" tab of your project configuration, find the "URL Types" section and add your app Id.

  8. Under the "Info" tab of your project configuration, add LSApplicationQueriesSchemes For QQ SDK. Add LSApplicationQueriesSchemes

  9. add following code to your AppDelegate.m

...
#import <React/RCTLinkingManager.h>

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
  return [RCTLinkingManager application:application openURL:url
                      sourceApplication:sourceApplication annotation:annotation];
}

Android Setup

  1. In your android/settings.gradle file, make the following additions:

    include ':app', ':react-native-qqsdk'
    project(':react-native-qqsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-qqsdk/android')
    
  2. In your android/app/build.gradle file, add the :react-native-qqsdk project as a compile-time dependency:

    ...
    dependencies {
        ...
        compile project(':react-native-qqsdk')
    }
    
  3. add App ID to $RNProjectRoot/package.json

{
  "qq_app_id": "YOUR_QQ_APP_ID"
}

4.Update the MainApplication.java file to use react-native-qqsdk via the following changes:

...
// 1. Import the plugin class.
import me.vanpan.rctqqsdk.QQSDKPackage;

public class MainApplication extends Application implements ReactApplication {

    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
        ...

        @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                new QQSDKPackage()
            );
        }
    };
}

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

code explanation
404        QQ client not found
405        Android Activity not found
500        QQ share (QQZone, QQ, Favorite) error
503        QQ share (QQZone, QQ, Favorite) cancelled
600        QQ ssoLogin error
603        ssoLogin cancelled

Image

This plugin support three Image types:

  1. Network URL
  2. Base64
  3. Absolute file path also support resolveAssetSource,for example, resolveAssetSource(require('./news.jpg')).uri

Usage

checkClientInstalled
import * as QQ from 'react-native-qqsdk';
QQ.isQQClientInstalled()
  .then(()=>{console.log('Installed')})
  .catch(()=>{console.log('not installed')});

ssoLogin
import * as QQ from 'react-native-qqsdk';
QQ.ssoLogin()
  .then((result)=>{console.log('result is', result)})
  .catch((error)=>{console.log('error is', error)});

logout
import * as QQ from 'react-native-qqsdk';
QQ.logout()
  .then((result)=>{console.log('result is', result)})
  .catch((error)=>{console.log('error is', error)});

shareText
import * as QQ from 'react-native-qqsdk';
QQ.shareText('分享文字',QQ.shareScene.QQ)
  .then((result)=>{console.log('result is', result)})
  .catch((error)=>{console.log('error is', error)});

shareImage
import * as QQ from 'react-native-qqsdk';
const imgUrl = 'https://y.gtimg.cn/music/photo_new/T001R300x300M000003Nz2So3XXYek.jpg';
QQ.shareImage(imgUrl,'分享标题','分享描述',QQ.shareScene.QQ)
  .then((result)=>{console.log('result is', result)})
  .catch((error)=>{console.log('error is', error)});

shareNews
import * as QQ from 'react-native-qqsdk';
import resolveAssetSource from 'resolveAssetSource';
QQ.shareNews('https://facebook.github.io/react-native/',resolveAssetSource(require('./news.jpg')).uri,'分享新闻标题','分享新闻描述',QQ.shareScene.QQ)
.then((result)=>{console.log('result is', result)})
.catch((error)=>{console.log('error is', error)});

shareAudio
import * as QQ from 'react-native-qqsdk';
const audioPreviewUrl = 'https://y.qq.com/portal/song/001OyHbk2MSIi4.html';
const audioUrl = 'http://stream20.qqmusic.qq.com/30577158.mp3';
const imgUrl = 'https://y.gtimg.cn/music/photo_new/T001R300x300M000003Nz2So3XXYek.jpg';
QQ.shareAudio(audioPreviewUrl,audioUrl,imgUrl,'十年','陈奕迅',QQ.shareScene.QQ)
.then((result)=>{console.log('result is', result)})
.catch((error)=>{console.log('error is', error)});

getUserInfo
var url = 'https://graph.qq.com/user/get_user_info?access_token=' + accessToken + '&oauth_consumer_key= APPID &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

Contributing

Feel free to contribute

License

react-native-qqsdk is released under the MIT license. See LICENSE file for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].