Exemplo n.º 1
0
 /** 设置通知提示方式 - 基础属性 */
 private void setStyleBasic() {
   BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(PushSetActivity.this);
   builder.statusBarDrawable = R.drawable.ic_launcher;
   builder.notificationFlags = Notification.FLAG_AUTO_CANCEL; // 设置为点击后自动消失
   builder.notificationDefaults =
       Notification
           .DEFAULT_SOUND; // 设置为铃声( Notification.DEFAULT_SOUND)或者震动( Notification.DEFAULT_VIBRATE)
   JPushInterface.setPushNotificationBuilder(1, builder);
   Toast.makeText(PushSetActivity.this, "Basic Builder - 1", Toast.LENGTH_SHORT).show();
 }
 void setBasicPushNotificationBuilder(JSONArray data, CallbackContext callbackContext) {
   BasicPushNotificationBuilder builder =
       new BasicPushNotificationBuilder(this.cordova.getActivity());
   builder.developerArg0 = "Basic builder 1";
   JPushInterface.setPushNotificationBuilder(1, builder);
   JSONObject obj = new JSONObject();
   try {
     obj.put("id", 1);
   } catch (JSONException e) {
     e.printStackTrace();
   }
   // callbackContext.success(obj);
 }