Я реализую GCM. Я зарегистрировал заявку на разработчиков Google консоли позволило GCM API услуги, место для Google services.json в папке приложения, поместите следующее в манифесте:Android GCM - не получает регистрационный токен
уровня<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="<my-package-name>.permission.C2D_MESSAGE" />
<application>..
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- GCM -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<action android:name="android.net.conn." />
<category android:name="<my-pakage-name>" />
</intent-filter>
</receiver>
<service
android:name=".notifications.GCMListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name=".notifications.InstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name=".notifications.RegistrationIntentService"
android:exported="false"></service>
</application>
App build.gradle
apply plugin: 'com.google.gms.google-services'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
}
уровень проекта build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:1.4.0-beta3'
}
Поэтому мой запрос, я не знаю, что случилось с выше, что я Åmot получение регистрационного токена. Пожалуйста, помогите мне получить регистрационный токен
Что вы видите в журналах? –
Ничего не связано с GCM .. – Mohanish
Добавили ли вы правильный идентификатор отправителя во время регистрации? –