添加了ios 停止推送的js接口

This commit is contained in:
zhangqinghe 2014-11-18 14:01:18 +08:00
parent 1b2ffe13d8
commit ae42986fc9
3 changed files with 8 additions and 4 deletions

View File

@ -39,6 +39,8 @@
var initiateUI = function(){
window.plugins.jPushPlugin.getRegistrationID(onGetRegistradionID);
window.plugins.jPushPlugin.stopPush();
//test android interface
//window.plugins.jPushPlugin.stopPush()
//window.plugins.jPushPlugin.resumePush();

View File

@ -139,7 +139,11 @@
[APService setLogOFF];
}
-(void)stopPush:(CDVInvokedUrlCommand*)command{
[[UIApplication sharedApplication]unregisterForRemoteNotifications];
}
- (void)failWithCallbackID:(NSString *)callbackID {
CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];

View File

@ -180,10 +180,8 @@ JPushPlugin.prototype.setCustomPushNotificationBuilder = function(){
}
JPushPlugin.prototype.stopPush = function(){
if(device.platform == "Android") {
data=[];
this.call_native("stopPush",data,null);
}
data=[];
this.call_native("stopPush",data,null);
}
JPushPlugin.prototype.resumePush = function(){