mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-20 20:22:50 +08:00
增加设置本地的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
|
||||
@ -829,3 +848,4 @@ android
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -63,6 +63,7 @@
|
||||
window.plugins.jPushPlugin.init();
|
||||
window.plugins.jPushPlugin.setDebugMode(true);
|
||||
window.plugins.jPushPlugin.getRegistrationID(onGetRegistradionID);
|
||||
window.plugins.jPushPlugin.setApplicationIconBadgeNumber(5);
|
||||
// var extras={"name":"json"};
|
||||
// window.plugins.jPushPlugin.addLocalNotification(1,"hh","ln",1111,1000*60,extras);
|
||||
// window.plugins.jPushPlugin.removeLocalNotification(1111);
|
||||
|
@ -170,6 +170,19 @@
|
||||
- (void)succeedWithPluginResult:(CDVPluginResult *)result withCallbackID:(NSString *)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 *result;
|
||||
|
@ -35,6 +35,11 @@ JPushPlugin.prototype.beginLogPageView = function(pageName,duration){
|
||||
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){
|
||||
try{
|
||||
|
Loading…
Reference in New Issue
Block a user