cordova-plugin-jsms
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -10,13 +10,19 @@ # cordova-plugin-jsms | ||
cordova plugin add cordova-plugin-jsms --variable APP_KEY=Your_App_KEY | ||
``` | ||
cordova plugin add cordova-plugin-jsms --variable APP_KEY=Your_App_KEY | ||
``` | ||
or | ||
cordova plugin add https://github.com/jpush/cordova-plugin-jsms.git --variable APP_KEY=Your_App_Key | ||
``` | ||
cordova plugin add https://github.com/jpush/cordova-plugin-jsms.git --variable APP_KEY=Your_App_Key | ||
``` | ||
- Local | ||
cordova plugin add <Plugin path> --variable APP_KEY=Your_App_Key | ||
``` | ||
cordova plugin add <Plugin path> --variable APP_KEY=Your_App_Key | ||
``` | ||
> [Click here](http://docs.jiguang.cn/guideline/statistical_report/) to learn how to get AppKey. | ||
> [Click here](http://docs.jiguang.cn/guideline/statistical_report/) to learn how to get AppKey. | ||
@@ -92,3 +98,3 @@ ## API | ||
- [Official Document](http://docs.jiguang.cn/guideline/JSMS_guide/). | ||
- [Community Forum](http://community.jiguang.cn/). | ||
<!-- - [Community Forum](http://community.jiguang.cn/). --> | ||
@@ -95,0 +101,0 @@ ## Contribute |
{ | ||
"name": "cordova-plugin-jsms", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "JSMS for Cordova plugin.", | ||
@@ -5,0 +5,0 @@ "cordova": { |
# cordova-plugin-jsms | ||
[![release](https://img.shields.io/badge/release-1.1.3-blue.svg)](https://github.com/jpush/cordova-plugin-jsms/releases) | ||
[![release](https://img.shields.io/badge/release-1.1.4-blue.svg)](https://github.com/jpush/cordova-plugin-jsms/releases) | ||
[![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/cordova-plugin-jsms) | ||
@@ -17,34 +17,38 @@ [![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1) | ||
cordova plugin add cordova-plugin-jsms --variable APP_KEY=Your_App_KEY | ||
```shell | ||
cordova plugin add cordova-plugin-jsms --variable APP_KEY=Your_App_KEY | ||
``` | ||
或 | ||
cordova plugin add https://github.com/jpush/cordova-plugin-jsms.git --variable APP_KEY=Your_App_Key | ||
```shell | ||
cordova plugin add https://github.com/jpush/cordova-plugin-jsms.git --variable APP_KEY=Your_App_Key | ||
``` | ||
- 本地 | ||
cordova plugin add <Plugin path> --variable APP_KEY=Your_App_Key | ||
``` | ||
cordova plugin add <Plugin path> --variable APP_KEY=Your_App_Key | ||
``` | ||
> [这里](http://docs.jiguang.cn/guideline/statistical_report/)了解如何获得 AppKey。 | ||
> [这里](http://docs.jiguang.cn/guideline/statistical_report/)了解如何获得 AppKey。 | ||
## API | ||
### init | ||
初始化 JSMS 功能,主要是检测一些配置信息,如果配置错误将初始化失败,打印错误日志,调用其他接口前必须先初始化。 | ||
#### 接口定义 | ||
### init() | ||
window.jsms.init() | ||
初始化 JSMS 功能,主要是检测一些配置信息,如果配置错误将初始化失败,打印错误日志,调用其他接口前必须先初始化。 | ||
#### 代码示例 | ||
window.jsms.init() | ||
```js | ||
window.jsms.init() | ||
``` | ||
### setDebugMode | ||
### setDebugMode(successCallback, errorCallback, enabled) | ||
是否开启 JSMS Debug 模式。 | ||
#### 接口定义 | ||
#### 参数说明 | ||
window.jsms.setDebugMode(successCallback, errorCallback, enabled) | ||
#### 参数说明 | ||
- successCallback: 成功回调。 | ||
@@ -56,8 +60,10 @@ - errorCallback: 失败回调,以参数形式返回错误信息。 | ||
window.jsms.setDebugMode(function () { | ||
// success callback. | ||
}, function (errorMsg) { | ||
// error callback. | ||
console.log(errorMsg) | ||
}, true) | ||
```js | ||
window.jsms.setDebugMode(function () { | ||
// success callback. | ||
}, function (errorMsg) { | ||
// error callback. | ||
console.log(errorMsg) | ||
}, true) | ||
``` | ||
@@ -79,4 +85,5 @@ ### getSmsCode | ||
window.jsms.getSmsCode(function () { | ||
window.jsms.getSmsCode(function (uuid) { | ||
// success callback. | ||
console.log(uuid) | ||
}, function (errorCode) { | ||
@@ -166,6 +173,2 @@ // error callback. | ||
## Todo | ||
- [x] Android 端开发 | ||
- [x] iOS 端开发 | ||
## Support | ||
@@ -172,0 +175,0 @@ - QQ 群: 413602425 |
var exec = require('cordova/exec') | ||
var JSMSPlugin = function () {} | ||
JSMSPlugin.prototype.isPlatformIOS = function () { | ||
return (device.platform === 'iPhone' || | ||
device.platform === 'iPad' || | ||
device.platform === 'iPod touch' || | ||
device.platform === 'iOS') | ||
} | ||
JSMSPlugin.prototype.init = function () { | ||
exec(null, null, 'JSMSPlugin', 'init', []) | ||
if (this.isPlatformIOS) { | ||
exec(null, null, 'JSMSPlugin', 'setup', []) | ||
} else { | ||
exec(null, null, 'JSMSPlugin', 'init', []) | ||
} | ||
} | ||
@@ -7,0 +19,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53
180
8365280
16
2