简体   繁体   中英

Quickblox push notification not working with Firebase device token

I'm using Quickblox for chatting features in my app, GCM was setup properly and it was fully functional along with push notification of Quickblox. But now google developer documentation strongly recommends that GCM users should migrate to FCM. After migration to FCM, i noticed that device token ids are not in the same format as I was getting while using GCM. So what I'm facing now is my all other push notifications are working other than Quickblox push notification and I think the reason behind this is device token identifiers. Did anyone has faced such issue? Please help me here.

I'm not sure how to help exactly. Basically, you need to migrate to FCM and migrate to the 3.2 version of Quickblox if you didn't. I'll enumerate the main steps:

  1. Follow the Google guide to migrate from GCM to FCM.
  2. Integrate auto-push subscription and FCM Service. Insert in the manifest:

     <meta-data android:name="com.quickblox.messages.TYPE" android:value="FCM" /> <meta-data android:name="com.quickblox.messages.SENDER_ID" android:value="@string/sender_id" /> <meta-data android:name="com.quickblox.messages.QB_ENVIRONMENT" android:value="DEVELOPMENT" /> <service android:name="com.quickblox.messages.services.fcm.QBFcmPushListenerService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> 
  3. Receive the events with something like this:

      private BroadcastReceiver pushBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String message = intent.getStringExtra(“message”); String from = intent.getStringExtra("from"); Log.i(TAG, "Receiving message: " + message + ", from " + from); } }; LocalBroadcastManager.getInstance(this).registerReceiver(pushBroadcastReceiver, new IntentFilter("new-push-event")); 

I find this is the minimum required code to run. But better if you take a look at the Quickblox docs and understand their approach.

I get the impression that their docs isn't growing consistently with their code... This issue can break down the platform :(

https://quickblox.com/developers/SimpleSample-messages_users-android#Steps_to_setup_SDK_Settings .

Remember insert your FCM Server key instead of the Legacy server key in Quickblox: Your App > Push Notifications > Settings .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM