2626import  cn .jpush .android .api .JPushInterface ;
2727import  cn .jpush .android .data .JPushLocalNotification ;
2828import  cn .jpush .android .api .TagAliasCallback ;
29+ import  android .util .Log ;
30+ 
2931
3032public  class  JPushPlugin  extends  CordovaPlugin  {
3133	private  final  static  List <String > methodList  = 
@@ -56,7 +58,9 @@ public class JPushPlugin extends CordovaPlugin {
5658
5759	private  ExecutorService  threadPool  = Executors .newFixedThreadPool (1 );
5860	private  static  JPushPlugin  instance ;
61+     private  static  String  TAG  = "Client JPushPlugin" ;
5962
63+     public  static  boolean  bOpenNotificationAlert  = true ;
6064	public  static  String  notificationAlert ;
6165	public  static  Map <String , Object > notificationExtras =new  HashMap <String , Object >();
6266	public  static  String  openNotificationAlert ;
@@ -73,12 +77,19 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
7377
7478		 //JPushPlugin.notificationAlert = alert; 
7579		 //JPushPlugin.notificationExtras = extras; 
76- 		 if (JPushPlugin .openNotificationAlert  != null ){
77- 			 JPushPlugin .transmitOpen (JPushPlugin .openNotificationAlert , JPushPlugin .openNotificationExtras );
78- 		 }
79- 		 if (JPushPlugin .notificationAlert !=null ){
80- 			 JPushPlugin .transmitReceive (JPushPlugin .notificationAlert , JPushPlugin .notificationExtras );
81- 		 }
80+         
81+         if (JPushPlugin .bOpenNotificationAlert ){
82+             
83+             JPushPlugin .bOpenNotificationAlert  = false ;
84+             if (JPushPlugin .openNotificationAlert  != null ){
85+                 JPushPlugin .transmitOpen (JPushPlugin .openNotificationAlert , JPushPlugin .openNotificationExtras );
86+             }
87+             if (JPushPlugin .notificationAlert !=null ){
88+                 JPushPlugin .transmitReceive (JPushPlugin .notificationAlert , JPushPlugin .notificationExtras );
89+             }
90+ 
91+         }
92+         
8293
8394		//JPushInterface.init(cordova.getActivity().getApplicationContext()); 
8495	}
@@ -226,7 +237,7 @@ public void run() {
226237							JSONArray .class , CallbackContext .class );
227238					method .invoke (JPushPlugin .this , data , callbackContext );
228239				} catch  (Exception  e ) {
229- 					 System . out . println ( e .toString ());
240+                      Log . e ( TAG , e .toString ());
230241				}
231242			}
232243		});
0 commit comments