mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-04-22 08:36:27 +08:00
Merge branch 'dev'
This commit is contained in:
commit
031acb9631
@ -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)
|
||||||
|
|
||||||
|
@ -716,10 +716,6 @@ window.JPush.getUserNotificationSettings(callback)
|
|||||||
|
|
||||||
[iOS 7 以后后台收到远程通知](#后台收到推送)
|
[iOS 7 以后后台收到远程通知](#后台收到推送)
|
||||||
|
|
||||||
### jpush.setTagsWithAlias
|
|
||||||
|
|
||||||
[设置标签别名回调](#返回值说明)
|
|
||||||
|
|
||||||
### jpush.receiveMessage
|
### jpush.receiveMessage
|
||||||
|
|
||||||
[获取自定义消息内容](#获取自定义消息内容)
|
[获取自定义消息内容](#获取自定义消息内容)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jpush-phonegap-plugin",
|
"name": "jpush-phonegap-plugin",
|
||||||
"version": "3.2.7",
|
"version": "3.2.8",
|
||||||
"description": "JPush for cordova plugin",
|
"description": "JPush for cordova plugin",
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "jpush-phonegap-plugin",
|
"id": "jpush-phonegap-plugin",
|
||||||
|
@ -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.7">
|
version="3.2.8">
|
||||||
|
|
||||||
<name>JPush</name>
|
<name>JPush</name>
|
||||||
<description>JPush for cordova plugin</description>
|
<description>JPush for cordova plugin</description>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<source-file src="src/ios/Plugins/AppDelegate+JPush.m" />
|
<source-file src="src/ios/Plugins/AppDelegate+JPush.m" />
|
||||||
|
|
||||||
<header-file src="src/ios/lib/JPUSHService.h" />
|
<header-file src="src/ios/lib/JPUSHService.h" />
|
||||||
<source-file src="src/ios/lib/jpush-ios-3.0.6.a" framework="true" />
|
<source-file src="src/ios/lib/jpush-ios-3.0.7.a" framework="true" />
|
||||||
<resource-file src="src/ios/JPushConfig.plist" />
|
<resource-file src="src/ios/JPushConfig.plist" />
|
||||||
|
|
||||||
<framework src="CFNetwork.framework" weak="true" />
|
<framework src="CFNetwork.framework" weak="true" />
|
||||||
|
@ -527,24 +527,6 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
eventCallbackMap.put(sequence, callbackContext);
|
eventCallbackMap.put(sequence, callbackContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTagsWithAlias(JSONArray data, CallbackContext callbackContext) {
|
|
||||||
HashSet<String> tags = new HashSet<String>();
|
|
||||||
String alias;
|
|
||||||
try {
|
|
||||||
alias = data.getString(0);
|
|
||||||
JSONArray tagsArray = data.getJSONArray(1);
|
|
||||||
for (int i = 0; i < tagsArray.length(); i++) {
|
|
||||||
tags.add(tagsArray.getString(i));
|
|
||||||
}
|
|
||||||
JPushInterface.setAliasAndTags(mContext,
|
|
||||||
alias, tags, mTagWithAliasCallback);
|
|
||||||
callbackContext.success();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
callbackContext.error("Error reading tagAlias JSON");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void getConnectionState(JSONArray data, CallbackContext callback) {
|
void getConnectionState(JSONArray data, CallbackContext callback) {
|
||||||
boolean isConnected = JPushInterface.getConnectionState(cordovaActivity.getApplicationContext());
|
boolean isConnected = JPushInterface.getConnectionState(cordovaActivity.getApplicationContext());
|
||||||
callback.success(String.valueOf(isConnected));
|
callback.success(String.valueOf(isConnected));
|
||||||
@ -553,8 +535,7 @@ public class JPushPlugin extends CordovaPlugin {
|
|||||||
/**
|
/**
|
||||||
* 自定义通知行为,声音、震动、呼吸灯等。
|
* 自定义通知行为,声音、震动、呼吸灯等。
|
||||||
*/
|
*/
|
||||||
void setBasicPushNotificationBuilder(JSONArray data,
|
void setBasicPushNotificationBuilder(JSONArray data, CallbackContext callbackContext) {
|
||||||
CallbackContext callbackContext) {
|
|
||||||
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(
|
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(
|
||||||
this.cordova.getActivity());
|
this.cordova.getActivity());
|
||||||
builder.developerArg0 = "Basic builder 1";
|
builder.developerArg0 = "Basic builder 1";
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
//以下为js中可调用接口
|
//以下为js中可调用接口
|
||||||
//设置标签、别名
|
//设置标签、别名
|
||||||
-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command;
|
|
||||||
|
|
||||||
-(void)setTags:(CDVInvokedUrlCommand*)command;
|
-(void)setTags:(CDVInvokedUrlCommand*)command;
|
||||||
-(void)addTags:(CDVInvokedUrlCommand*)command;
|
-(void)addTags:(CDVInvokedUrlCommand*)command;
|
||||||
-(void)deleteTags:(CDVInvokedUrlCommand*)command;
|
-(void)deleteTags:(CDVInvokedUrlCommand*)command;
|
||||||
@ -76,7 +74,6 @@
|
|||||||
/*
|
/*
|
||||||
* 以下为js中可监听到的事件
|
* 以下为js中可监听到的事件
|
||||||
* jpush.openNotification 点击推送消息启动或唤醒app
|
* jpush.openNotification 点击推送消息启动或唤醒app
|
||||||
* jpush.setTagsWithAlias 设置标签、别名完成
|
|
||||||
* jpush.receiveMessage 收到自定义消息
|
* jpush.receiveMessage 收到自定义消息
|
||||||
* jpush.receiveNotification 前台收到推送
|
* jpush.receiveNotification 前台收到推送
|
||||||
* jpush.backgroundNotification 后台收到推送
|
* jpush.backgroundNotification 后台收到推送
|
||||||
|
@ -87,23 +87,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command{
|
|
||||||
NSString *alias = [command argumentAtIndex:0];
|
|
||||||
NSArray *tags = [command argumentAtIndex:1];
|
|
||||||
|
|
||||||
[JPUSHService setTags:[NSSet setWithArray:tags]
|
|
||||||
alias:alias
|
|
||||||
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
|
||||||
CDVPluginResult *result;
|
|
||||||
if (iResCode == 0) {
|
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
|
||||||
} else {
|
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
|
||||||
}
|
|
||||||
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
-(void)setTags:(CDVInvokedUrlCommand*)command {
|
-(void)setTags:(CDVInvokedUrlCommand*)command {
|
||||||
NSDictionary* params = [command.arguments objectAtIndex:0];
|
NSDictionary* params = [command.arguments objectAtIndex:0];
|
||||||
NSNumber* sequence = params[@"sequence"];
|
NSNumber* sequence = params[@"sequence"];
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
|
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define JPUSH_VERSION_NUMBER 3.0.6
|
#define JPUSH_VERSION_NUMBER 3.0.7
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
Binary file not shown.
@ -70,20 +70,6 @@ JPushPlugin.prototype.clearLocalNotifications = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.setTagsWithAlias = function (tags, alias, successCallback, errorCallback) {
|
|
||||||
if (tags == null) {
|
|
||||||
this.setAlias(alias)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (alias == null) {
|
|
||||||
this.setTags(tags)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var arrayTagWithAlias = [tags]
|
|
||||||
arrayTagWithAlias.unshift(alias)
|
|
||||||
this.callNative('setTagsWithAlias', arrayTagWithAlias, successCallback, errorCallback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置标签。
|
* 设置标签。
|
||||||
* 注意:该接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
|
* 注意:该接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user