fcm通道是信鸽和谷歌推出的各种推送通道,在外国可用谷歌service框架的手机上能够实现不打开应用收到推送消息。在没有fcm的手机rom下依旧走信鸽的推送通道。
classpath 'com.google.gms:google-services:3.1.0'
compile 'com.tencent.xinge:fcm:4.3.2-release'
compile 'com.google.firebase:firebase-messaging:17.3.1'
//在应用级的gradle文件的最后一行代码中新增并将google-services.json放进你应用model的根路径下
apply plugin: 'com.google.gms.google-services'
XGPushConfig.enableFcmPush(this,true);
XGPushConfig.enableOtherPush(this, true);
12-02 09:16:31.874 17260-17423/lc.com.xinge.push E/XG_fcm: Fcm App has initialize
12-02 09:16:31.874 17260-17423/lc.com.xinge.push D/XG_fcm: FirebaseAPP初始化完成
12-02 09:16:31.875 17260-17423/lc.com.xinge.push I/XG_fcm: registerPush Token is: eK0LLz43Z_U:APA91bHjyTCuX7fZ6Ye-fAojAo_l2nphA3rRtLZN98grADOZtULysxYd51pCaL5oiqyVs0Mtbfu2mBdjoeGsSq5sjbh5mCETgl2dURRy9-yNR_ZZrn6pWcvwt7CoWTY0_Q9_mreiryuI
12-02 09:16:31.877 17260-17260/lc.com.xinge.push W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
12-02 09:16:31.892 17260-17278/lc.com.xinge.push V/FA: Using measurement service
12-02 09:16:31.893 17260-17278/lc.com.xinge.push V/FA: Connecting to remote service
12-02 09:16:31.895 17260-17423/lc.com.xinge.push I/XINGE: [XGOtherPush] Reservert info: other push token is : eK0LLz43Z_U:APA91bHjyTCuX7fZ6Ye-fAojAo_l2nphA3rRtLZN98grADOZtULysxYd51pCaL5oiqyVs0Mtbfu2mBdjoeGsSq5sjbh5mCETgl2dURRy9-yNR_ZZrn6pWcvwt7CoWTY0_Q9_mreiryuI other push type: fcm