mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-05-27 00:00:12 +08:00
Merge branch 'dev'
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# JPush PhoneGap / Cordova Plugin
|
# JPush PhoneGap / Cordova Plugin
|
||||||
|
|
||||||
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
[](https://travis-ci.org/jpush/jpush-phonegap-plugin)
|
||||||
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
[](https://github.com/jpush/jpush-phonegap-plugin/releases)
|
||||||
[](https://github.com/jpush/jpush-phonegap-plugin)
|
[](https://github.com/jpush/jpush-phonegap-plugin)
|
||||||
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
[](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1)
|
||||||
|
|
||||||
|
|||||||
+3
-18
@@ -175,9 +175,9 @@ window.plugins.jPushPlugin.getRegistrationID(function(data) {
|
|||||||
#### 接口定义
|
#### 接口定义
|
||||||
|
|
||||||
```
|
```
|
||||||
JPushPlugin.prototype.setTagsWithAlias(tags, alias)
|
JPushPlugin.prototype.setTagsWithAlias(tags, alias, successCallback, errorCallback)
|
||||||
JPushPlugin.prototype.setTags(tags)
|
JPushPlugin.prototype.setTags(tags, successCallback)
|
||||||
JPushPlugin.prototype.setAlias(alias)
|
JPushPlugin.prototype.setAlias(alias, errorCallback)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 参数说明
|
#### 参数说明
|
||||||
@@ -197,21 +197,6 @@ JPushPlugin.prototype.setAlias(alias)
|
|||||||
- 有效的别名组成:字母(区分大小写)、数字、下划线、汉字。
|
- 有效的别名组成:字母(区分大小写)、数字、下划线、汉字。
|
||||||
- 限制:alias 命名长度限制为 40 字节(判断长度需采用 UTF-8 编码)。
|
- 限制:alias 命名长度限制为 40 字节(判断长度需采用 UTF-8 编码)。
|
||||||
|
|
||||||
#### 返回值说明
|
|
||||||
|
|
||||||
函数本身无返回值,但需要注册 `jpush.setTagsWithAlias` 事件来监听设置结果。
|
|
||||||
|
|
||||||
```js
|
|
||||||
var onTagsWithAlias = function(event) {
|
|
||||||
console.log("onTagsWithAlias")
|
|
||||||
var result = "result code:"+event.resultCode + " "
|
|
||||||
result += "tags:" + event.tags + " "
|
|
||||||
result += "alias:" + event.alias + " "
|
|
||||||
$("#tagAliasResult").html(result)
|
|
||||||
}
|
|
||||||
document.addEventListener("jpush.setTagsWithAlias", onTagsWithAlias, false)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 错误码定义
|
#### 错误码定义
|
||||||
|
|
||||||
| Code | 描述 | 详细解释 |
|
| Code | 描述 | 详细解释 |
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jpush-phonegap-plugin",
|
"name": "jpush-phonegap-plugin",
|
||||||
"version": "3.2.0",
|
"version": "3.2.1",
|
||||||
"description": "JPush for cordova plugin",
|
"description": "JPush for cordova plugin",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "jpush-phonegap-plugin",
|
"id": "jpush-phonegap-plugin",
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="jpush-phonegap-plugin"
|
id="jpush-phonegap-plugin"
|
||||||
version="3.2.0">
|
version="3.2.1">
|
||||||
|
|
||||||
<name>JPush</name>
|
<name>JPush</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<description>JPush for cordova plugin</description>
|
||||||
|
|||||||
@@ -109,6 +109,7 @@
|
|||||||
} else {
|
} else {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
||||||
}
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +124,7 @@
|
|||||||
} else {
|
} else {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
||||||
}
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,6 +139,7 @@
|
|||||||
} else {
|
} else {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
||||||
}
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user