안녕하세요.
GCM push기능을 개발중인데요.
GCMIntentService 클래스의 onMessage 로 push메세지 까지 정상적으로 받고 있습니다.
push메세지를 받은 후에 처리 부분에서 아래코드와 같이 Notification 과 PendingIntent 를 사용하여 알림을 띠우고
해당 알림을 선택하면 PendingIntent 로 설정한 app을 실행 시킵니다. 그런데 만약 해당 app이 실행 상태라면 실행된 상태에서
push로 받은 내용에 따라 처리를 해주고 싶은데요.
일단 아래 코드로는 app이 실행된 상태라도 무조건 다시 실행이 됩니다. 여기저기 예제를 찾아봐도 실행된 상태에서의 처리내용을
찾을 수가 없네요. 전문가님들의 조언 부탁합니다.
그럼 수고하세요.
PendingIntent pendingIntent =
PendingIntent.getActivity(PRFActivity.mContext, 0, new Intent(PRFActivity.mContext,PRFActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK),0);
Notification notification = new Notification();
notification.icon = R.drawable.android_icon;
notification.tickerText = ticker;
notification.when = System.currentTimeMillis();
notification.vibrate = new long[] { 500, 100, 500, 100 };
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(this, title, msg, pendingIntent);
notificationManager.notify(0, notification);