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에서 제안했습니다.