안녕하세요.

 

기존 노티피케이션으로 하다가 다이얼로그로 변경해달라고 하는데..... 다이얼로그로 변경하니 푸시가 안옵니다.

 

 

위쪽의 주석문은 노티피케이션을 이용해 받는소스구요...... 물론 잘 오더라구요.

 

알러다이얼로그 소스를 넣었는데..... 작동을 하지 않습니다.

 

푸시를 받을때 다이얼로그로 받으려면, 어떻게 하는지 궁금합니다.

 

좋은하루 되시구요, 답변 부탁 드리겠습니다.

 

감사합니다.

 

 

 @Override
 protected void onMessage(Context context, Intent intent) {
  
  String[] mStrMsg = URLDecoder.decode(intent.getStringExtra("msg")).split("aaaaaaa");
/*
  Notification noti = new Notification(R.drawable.icon_push, mStrMsg[0],System.currentTimeMillis()); // 도착 시간
  noti.defaults = Notification.DEFAULT_SOUND|Notification.DEFAULT_VIBRATE|Notification.DEFAULT_LIGHTS;
  noti.flags = Notification.FLAG_ONLY_ALERT_ONCE;

  noti.flags = Notification.FLAG_AUTO_CANCEL; // 확인 후 자동제거

  Intent notifyIntent = new Intent(context, DateNotification.class);
  
  notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  PendingIntent pendingI = PendingIntent.getActivity(context, 0, notifyIntent, 0);

  noti.setLatestEventInfo(context, mStrMsg[0], mStrMsg[1], pendingI);

  NotificationManager notiManager;
  notiManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
  
  int MyNoti = 0;
  notiManager.notify(MyNoti, noti);
*/
  AlertDialog.Builder builder = new AlertDialog.Builder(context);
  builder.setIcon(R.drawable.icon_push)
  .setTitle("제목.....")
  .setMessage("내용")
  .setPositiveButton(R.string.app_name, new DialogInterface.OnClickListener() {
   public void onClick(DialogInterface dialog, int which) {
    
   }
  });

  AlertDialog alert = builder.create();
  alert.show();
 }