Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasonz1987/cordova-plugin-xiaomi
a cordova plugin for xiaomi sdk
https://github.com/jasonz1987/cordova-plugin-xiaomi
Last synced: about 1 month ago
JSON representation
a cordova plugin for xiaomi sdk
- Host: GitHub
- URL: https://github.com/jasonz1987/cordova-plugin-xiaomi
- Owner: jasonz1987
- Created: 2016-12-13T14:18:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-21T02:16:43.000Z (almost 8 years ago)
- Last Synced: 2024-10-05T19:16:24.433Z (about 2 months ago)
- Language: Objective-C
- Size: 362 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# cordova-plugin-xiaomi
A cordova plugin, a JS version of Xiaomi OAUTH SDK
# Feature
getAccessToken,getProfile,getOpenId
# Example
# Install
1. ```cordova plugin add cordova-plugin-xiaomi --variable xiaomiappid=YOUR_XIAOMI_APPID```, or using [plugman](https://npmjs.org/package/plugman), [phonegap](https://npmjs.org/package/phonegap), [ionic](http://ionicframework.com/)
2. ```cordova build ios``` or ```cordova build android```
3. (iOS only) if your cordova version <5.1.1,check the URL Type using XCode
# Usage
## getAccessToken
```Javascript
Xiaomi.getAccessToken(function (result) {
console.log(result)
}, function (error) {
console.log(error);
});
```## getOpenId
** should call this method after getAccessToken **
```Javascript
Xiaomi.getOpenId(function (result) {
console.log(result)
}, function (error) {
console.log(error);
});
```## getProfile
** should call this method after getAccessToken **
```Javascript
Xiaomi.getProfile(function (result) {
console.log(result)
}, function (error) {
console.log(error);
});
```# FAQ
See [FAQ](https://github.com/jasonz1987/cordova-plugin-xiaomi/wiki/FAQ).
# TODO
+ add example
+ support ios platform
+ add other sdk
# More
[Xiaomi Official Android SDK](https://github.com/xiaomipassport/oauth-Android-sdk)
[Xiaomi Official IOS SDK](https://github.com/xiaomipassport/oauth-iOS-sdk)
# LICENSE
[MIT LICENSE](http://opensource.org/licenses/MIT)