by iVanPan

iVanPan / cordova_weibo

A Cordova wrapper around the Sina WeiboSDK for Android and iOS. Provides access to ssoLogin, WeiboSh...

203 Stars 91 Forks Last release: over 3 years ago (0.5.0) MIT License 98 Commits 1 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


npm npm platform GitHub license

A Cordova wrapper around the Sina WeiboSDK for Android and iOS. Provides access to ssoLogin, WeiboSharing etc... 简体中文


  • Weibo SSO Login
  • Weibo Logout
  • Weibo Share (WebPage,Text,Image)
  • Check Weibo Client is Installed


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


  1. cordova plugin add cordova-plugin-weibosdk --variable WEIBO_APP_ID=YOUR_WEIBO_APPID
  2. Add
     in your config.xml If you don't add this preference the defualt redirecturi is
  3. cordova build


  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 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)


Weibo SSO Login

WeiboSDK.ssoLogin(function (args) {
   alert('access 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) {

Weibo Logout

WeiboSDK.logout(function () {
   alert('logout success');
}, function (failReason) {

Weibo WebPage Share

var args = {};
args.url = '';
args.title = 'Apache Cordova';
args.description = 'This is a Cordova Plugin';
args.image = '';
WeiboSDK.shareToWeibo(function () {
   alert('share success');
}, function (failReason) {
}, args);

Weibo Image Share

var args = {};
args.image = '';
WeiboSDK.shareImageToWeibo(function () {
   alert('share success');
}, function (failReason) {
}, args);

Weibo Text Share

var args = {};
args.text = 'This is a Cordova Plugin';
WeiboSDK.shareTextToWeibo(function () {
   alert('share success');
}, function (failReason) {
}, args);


WeiboSDK.checkClientInstalled(function () {
   alert('client is installed');
}, function () {
   alert('client is not installed');


var url = '' + usrid + '&&access_token=' + token;


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

About WeiboSdk

you can downlaod last weibosdk here .if you find any problem about weibosdk, open an isssus please.


Feel free to contribute


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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.