小编tec*_*ngs的帖子

Android GCM:GCMRegistrar提供空注册ID

我已按照http://developer.android.com/guide/google/gcm/gs.html#server-app在我的应用中实施GCM

                    GCMRegistrar.checkDevice(this);
        GCMRegistrar.checkManifest(this);
        if (GCMRegistrar.isRegistered(this)) {
            Log.d(TAG, GCMRegistrar.getRegistrationId(this));
        }
        final String regId = GCMRegistrar.getRegistrationId(this);

        if (regId.equals("")) {
            GCMRegistrar.register(this, sender_id);
            Log.d(TAG, "Registration id :  "+GCMRegistrar.getRegistrationId(this));
        }
            else {
            Log.d("info", "already registered as" + regId);
        }
Run Code Online (Sandbox Code Playgroud)

返回空字符串作为注册ID还需要什么才能获得注册ID?

android google-cloud-messaging

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

google-cloud-messaging ×1