안녕하세요.
GCM 기능을 구현하고 있습니다.
그런데 3rd Party 서버에서 GCM으로 메시지를 전송하지도 않고 있는데도 불구하고,
끊임없이 onReceive가 호출이 됩니다. 코드는 아래와 같습니다.
public class GCMBroadcastReceiver extends BroadcastReceiver{
public static final int NOTIFICATION_ID = 1;
private NotificationManager mNotifcationManager;
NotificationCompat.Builder builder;
Context mContext;
@Override
public void onReceive(Context context, Intent intent) {
Log.i("GCM", "onReceive start");
Log.i("GCM", "msg: " + intent.getExtras().toString());
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
mContext = context;
String messageType = gcm.getMessageType(intent);
if(GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
sendNotification("Send Error: " + intent.getExtras().toString());
} else if(GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)) {
sendNotification("Deleted Message on server: " + intent.getExtras().toString());
} else {
// endNotification(intent.getExtras().get("message").toString());
}
setResultCode(Activity.RESULT_OK);
Log.i("GCM", "onReceive done");
}
로그캣으로 보면 위의 onReceive가 아래의 메시지로 끊임없이 호출되는 것을 알 수 있습니다.
07-23 11:01:07.190: I/GCM(12991): onReceive start
07-23 11:01:07.190: I/GCM(12991): msg: Bundle[mParcelledData.dataSize=168]
07-23 11:01:07.190: I/GCM(12991): onReceive done
설정에서 알림표시를 하지 않도록 했음에도 불구하고 onReceive가 계속 호출이 되는데 무엇이 문제인건가요?