diff --git a/example/index.html b/example/index.html index 8702919..9a4055a 100644 --- a/example/index.html +++ b/example/index.html @@ -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(); diff --git a/src/ios/Plugins/JPushPlugin.m b/src/ios/Plugins/JPushPlugin.m index 6246335..fec06c8 100644 --- a/src/ios/Plugins/JPushPlugin.m +++ b/src/ios/Plugins/JPushPlugin.m @@ -139,7 +139,11 @@ [APService setLogOFF]; } +-(void)stopPush:(CDVInvokedUrlCommand*)command{ + + [[UIApplication sharedApplication]unregisterForRemoteNotifications]; +} - (void)failWithCallbackID:(NSString *)callbackID { CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; diff --git a/www/JPushPlugin.js b/www/JPushPlugin.js index 8625aa7..83290b3 100644 --- a/www/JPushPlugin.js +++ b/www/JPushPlugin.js @@ -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(){