1) AndroidManifest.xml 수정
Token을 FCM에서 받도록 수정되었으므로 AndroidManifest 내의 GCM 관련 코드를 FCM으로 교체하여야 합니다
삭제해야할 기존 코드
<permission android:name="<your-package-name>.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="<your-package-name>.permission.C2D_MESSAGE" />
<receiver
android:name="com.apms.sdk.push.PushReceiver"
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" />
</intent-filter>
<intent-filter>
<action android:name="org.mosquitto.android.mqtt.MSGRECVD" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver><!-- Private PUSH Receiver -->
<receiver android:name="com.apms.sdk.push.PushReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.fcm.intent.RECEIVE"/>
<action android:name="org.mosquitto.android.mqtt.MSGRECVD"/>
</intent-filter>
</receiver>
<service
android:name="com.apms.sdk.push.FCMPushService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
2) Gradle 수정
compile 'com.google.android.gms:play-services-gcm:8.4.0'compile 'com.google.firebase:firebase-core:16.0.5'
compile 'com.google.firebase:firebase-messaging:17.3.4'apply plugin: 'com.google.gms.google-services'buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}3) google-service.json 파일 프로젝트에 추가