2013-07-15 6 views
0

Android 앱에 Urban Flyship 푸시 알림을 추가하고 있습니다. 내 맞춤 BroadcastReceiver에 테스트 푸시를 보낼 때 알림이 전송됩니다. 다음은 onReceive() 방법입니다.알림 수신되었지만 표시되지 않음

public class IntentReceiver extends BroadcastReceiver { 

    @Override 
    public void onReceive(Context context, Intent intent) { 
     if(intent == null) 
      return; 

    String action = intent.getAction(); 

    if (action.equals(PushManager.ACTION_PUSH_RECEIVED)) { 
     int id = intent.getIntExtra(PushManager.EXTRA_NOTIFICATION_ID, 0); //Breakpoint here 

     Log.w("my app", "Received push notification. Alert: " 
       + intent.getStringExtra(PushManager.EXTRA_ALERT) 
       + " [NotificationID="+id+"]"); 

     logPushExtras(intent); 

    } else if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) { 
     //Other stuff here 
    } 

실행은 중단 점 (주석에 표시된 위치)에서 중단되고 세부 사항이 기록됩니다.

알림 영역에는 알림이 표시되지 않습니다. UA 푸시 알림을 사용하는 다른 앱에서는 이것이 내가 한 전부라고 생각하지만 이번에는 작동하지 않는 것 같습니다.

나는 내 매니 페스트 파일에서 뭔가 잘못했거나 어딘가에서 클래스를 구현하는 것을 잊어 버렸다.

아이디어가 있으십니까?

추가 정보

확장 응용 프로그램 :

public class ExtendedApplication extends Application { 

    public void onCreate(){ 
     AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this); 
     UAirship.takeOff(this, options); 
     PushManager.enablePush(); 

     PushPreferences prefs = PushManager.shared().getPreferences(); 
     Log.e("my app", "My Application onCreate - App APID: " + prefs.getPushId()); 

     PushManager.shared().setIntentReceiver(IntentReceiver.class); 
    } 
} 

편집 내 ExtendedApplication A와

PushManager.shared().setNotificationBuilder(new BasicPushNotificationBuilder()); 

를 추가하려고했습니다

this에서 제안했습니다.

답변

0

UA 사이트의 빈 "경고"필드가있는 테스트 푸시를 보냈습니다. 나는 거기에서 약간의 텍스트와 함께 시험해 보았다. 나는 이유를 모른다. 그러나 나는 그것이 조용히 실패해야만한다고 생각하지 않는다.

이야기의 도덕적 : 경고 필드를 비워 두지 마십시오.

관련 문제