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

cordova-plugin-weibosdk

v0.6.4

Published

codrova/phonegap wrapper for weibo sdk

Downloads

47

Readme

cordova-plugin-weibosdk

npm npm platform GitHub license

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

Feature

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

Requirements

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

Installation

  1. cordova plugin add cordova-plugin-weibosdk --variable WEIBO_APP_ID=YOUR_WEIBO_APPID
  2. Add <preference name="REDIRECTURI" value="YOUR_WEIBO_REDIRECTURI" /> in your config.xml If you don't add this preference the defualt redirecturi is https://api.weibo.com/oauth2/default.html
  3. cordova build

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)

Usage

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) {
   alert(failReason);
});

Weibo Logout

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

Weibo WebPage Share

var args = {};
args.url = 'https://cordova.apache.org/';
args.title = 'Apache Cordova';
args.description = 'This is a Cordova Plugin';
args.image = 'https://cordova.apache.org/static/img/pluggy.png';
WeiboSDK.shareToWeibo(function () {
   alert('share success');
}, function (failReason) {
   alert(failReason);
}, args);

Weibo Image Share

var args = {};
args.image = 'https://cordova.apache.org/static/img/pluggy.png';
WeiboSDK.shareImageToWeibo(function () {
   alert('share success');
}, function (failReason) {
   alert(failReason);
}, args);

Weibo Text Share

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

CheckClientInstalled

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

GetUserInfo

var url = 'https://api.weibo.com/2/users/show.json?uid=' + usrid + '&&access_token=' + token;
http.get(url)

Example

  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.

Contributing

Feel free to contribute

License

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