저는 GCM을 내 앱에 구현하는 데 집중하고 있습니다. 튜토리얼 here을 시작점으로 사용했습니다.regId는 항상 비어 있습니다.
문제는 내 regId
항상 null
점이다 : 위의 코드에서
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals(""))
{
GCMRegistrar.register(this, "627xxxx78");
}
else
{
if (GCMRegistrar.isRegisteredOnServer(this))
{
Log.i(TAG, "Already registered regId : " + regId);
}
else
{
final Context context = this;
mRegisterTask = new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
boolean registered =
ServerUtilities.register(context, regId);
if (!registered)
{
GCMRegistrar.unregister(context);
}
return null;
}
@Override
protected void onPostExecute(Void result) {
mRegisterTask = null;
}
};
mRegisterTask.execute(null, null, null);
}
}
, ServerUtilities.register
가 호출되지 않습니다 GCMRegistrar.getRegistrationId(this)
때문에; 항상 빈 문자열을 반환합니다.
아이디어가 있으십니까?
매니페스트 파일을 게시 할 수 있습니까? – Chet
'GCMIntentService'에서 등록 요청으로 얻은 결과는 무엇입니까? – CommonsWare