2016-06-14 4 views
1

로캘 알림을 사용하는 앱을 만들었습니다. 알림을 설정하기 위해 백엔드에 전화가 걸리고 설정할 알림 목록이 반환됩니다. 이 목록을 통과하는 루프를 만들고 알림을 하나씩 설정합니다. 알림을 설정하는 데 거의 시간이 걸리는 것으로 나타났습니다.지구별 알림 ANE 설정 알림 속도를 높일 수 있습니까?

public function sendNotification(title:String, body:String, delay:int, id:int, tickerText:String, data:String, alertAction:String = "") : void 
    { 
     if (Notifications.isSupported) 
     { 
      Notifications.service.notify(
       new NotificationBuilder() 
       .setId(id) 
       .setDelay(delay) 
       .setAlert(tickerText) 
       .setTitle(title) 
       .setSound("sound/trigger") 
       .enableVibration(false) 
       .setCount(1) 
       .setBody(body) 
       .setPayload(data) 
       .build() 
      ); 
     } 
    } 

이 가능이 속도를 높이기 위해이 알림을 설정할 때, 내가 전화하는 기능입니다? 아마도 배치와 함께?

+0

가장 최근 버전을 사용하고 있습니까? 우리가 최근 빌드에서이 전화를 빠르게했다고 생각하니? – Michael

+0

최근에 얼마나 될까요? 나는 2016 년 5 월 5 일 버전을 가지고 있습니다. 03:05 – APvG

답변

1

이 시도 :

NotificationManager mNotificationManager = 
        (NotificationManager) context.getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); 

public void createSimpleNotification(Context context) { 
     if (Build.VERSION.SDK_INT < 16) 
      return; 
     Intent resultIntent = null; 
      resultIntent = new Intent(context, LauncherActivity.class); 
     TaskStackBuilder stackBuilder = TaskStackBuilder.create(context); 
     stackBuilder.addParentStack(SplashActivity.class); 
     stackBuilder.addNextIntent(resultIntent); 
     PendingIntent resultPending = stackBuilder 
       .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); 
     Bundle bundle = new Bundle(); 
     bundle.putString(Constants.DATA, "Your data"); 
     resultIntent.putExtra(Constants.DATA, bundle); 
     Notification.Builder mBuilder = new Notification.Builder(context) 
       .setSmallIcon(R.mipmap.ic_launcher) // notification icon 
       .setContentTitle("Title") // main title of the notification 
       .setStyle(new Notification.BigTextStyle().bigText("Hello, how are you")) 
       .setAutoCancel(true) 
       .setContentText("Hello everyone") // notification text 
       .setContentIntent(resultPending); // notification intent 
     mNotificationManager.notify(1, mBuilder.build()); 
    } 

은 당신을 도울 것입니다 희망 :

+0

답변 해 주셔서 감사합니다. 나는 나 자신을 분명히하지 않았다. 미안하다. 알림 ANE는 Adobe Air (as3)에서 사용됩니다. – APvG

관련 문제