forked from github/jpush-phonegap-plugin
增加设置本地的badge值的api
This commit is contained in:
parent
6d668101c5
commit
58b8cd45b2
20
README.md
20
README.md
@ -554,6 +554,25 @@ iOS
|
|||||||
|
|
||||||
#####返回值
|
#####返回值
|
||||||
无
|
无
|
||||||
|
#### API - setApplicationIconBadgeNumber
|
||||||
|
|
||||||
|
设置iOS的角标,当设置badge=0时为清除角标
|
||||||
|
|
||||||
|
|
||||||
|
##### 接口定义
|
||||||
|
|
||||||
|
JPushPlugin.prototype.setApplicationIconBadgeNumber = function(badge)
|
||||||
|
|
||||||
|
#####平台
|
||||||
|
iOS
|
||||||
|
|
||||||
|
##### 参数说明
|
||||||
|
- data js字符串
|
||||||
|
|
||||||
|
##### 返回值
|
||||||
|
无
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### API - init
|
#### API - init
|
||||||
@ -829,3 +848,4 @@ android
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
window.plugins.jPushPlugin.init();
|
window.plugins.jPushPlugin.init();
|
||||||
window.plugins.jPushPlugin.setDebugMode(true);
|
window.plugins.jPushPlugin.setDebugMode(true);
|
||||||
window.plugins.jPushPlugin.getRegistrationID(onGetRegistradionID);
|
window.plugins.jPushPlugin.getRegistrationID(onGetRegistradionID);
|
||||||
|
window.plugins.jPushPlugin.setApplicationIconBadgeNumber(5);
|
||||||
// var extras={"name":"json"};
|
// var extras={"name":"json"};
|
||||||
// window.plugins.jPushPlugin.addLocalNotification(1,"hh","ln",1111,1000*60,extras);
|
// window.plugins.jPushPlugin.addLocalNotification(1,"hh","ln",1111,1000*60,extras);
|
||||||
// window.plugins.jPushPlugin.removeLocalNotification(1111);
|
// window.plugins.jPushPlugin.removeLocalNotification(1111);
|
||||||
|
@ -170,6 +170,19 @@
|
|||||||
- (void)succeedWithPluginResult:(CDVPluginResult *)result withCallbackID:(NSString *)callbackID {
|
- (void)succeedWithPluginResult:(CDVPluginResult *)result withCallbackID:(NSString *)callbackID {
|
||||||
[self.commandDelegate sendPluginResult:result callbackId:callbackID];
|
[self.commandDelegate sendPluginResult:result callbackId:callbackID];
|
||||||
}
|
}
|
||||||
|
-(void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command{
|
||||||
|
//
|
||||||
|
NSArray *argument=command.arguments;
|
||||||
|
if ([argument count]<1) {
|
||||||
|
NSLog(@"setBadge argument error!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NSNumber *badge=[argument objectAtIndex:0];
|
||||||
|
[UIApplication sharedApplication].applicationIconBadgeNumber=[badge intValue];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (CDVPluginResult *)pluginResultForValue:(id)value {
|
- (CDVPluginResult *)pluginResultForValue:(id)value {
|
||||||
|
|
||||||
CDVPluginResult *result;
|
CDVPluginResult *result;
|
||||||
|
@ -35,6 +35,11 @@ JPushPlugin.prototype.beginLogPageView = function(pageName,duration){
|
|||||||
this.call_native( "beginLogPageView",[pageName,duration],null);
|
this.call_native( "beginLogPageView",[pageName,duration],null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
JPushPlugin.prototype.setApplicationIconBadgeNumber = function(badge){
|
||||||
|
if(this.isPlatformIOS()){
|
||||||
|
this.call_native( "setApplicationIconBadgeNumber",[badge],null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.setTagsWithAlias = function(tags,alias){
|
JPushPlugin.prototype.setTagsWithAlias = function(tags,alias){
|
||||||
try{
|
try{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user