From 219ae72758049227c26f5ab018c6f0e6a8ffafd1 Mon Sep 17 00:00:00 2001 From: zhangqinghe Date: Tue, 18 Nov 2014 14:01:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86ios=20=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E6=8E=A8=E9=80=81=E7=9A=84js=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/index.html | 2 ++ src/ios/Plugins/JPushPlugin.m | 4 ++++ www/JPushPlugin.js | 6 ++---- 3 files changed, 8 insertions(+), 4 deletions(-) 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(){