이클립스를 이용해 앱을 폰에 설치할때는 regId가 제대로 들어옵니다.
그런데 프로젝트를 export한 apk파일로 설치된 앱에서는
앱이 처음 설치되고 바로 들어가면 null값을 받아오고
그 다음부터 앱이 실행되면 regid값이 제대로 들어옵니다.
이건 무슨 이유일까요?
GCMRegistrar.checkDevice(context);
GCMRegistrar.checkManifest(context);
regId = GCMRegistrar.getRegistrationId(context);
if (regId.equals("")) { // gcm 에 regId 등록되어있는지 확인 하고 가져오기
GCMRegistrar.register(context, SENDER_ID);
regId = GCMRegistrar.getRegistrationId(context);
} else {
Log.i("Main", "Already registered - " + regId);
}
코드는 이렇게 쓰고 있습니다.