How To Create Topic in FCM Notifications

后端 未结 4 2117
小蘑菇
小蘑菇 2020-11-28 19:51

I\'m trying Firebase-Notification API the service is worked perfect when i send downstream message from console to app, but how to send message to topic registered users ? <

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 20:32

    This is an alternate path.

    If you subscribe a client app to an unexisting topic then the topic will also be created without having to call any firebase url request.

    It' will also take a couple of hours to appear on Firebase Console.

    By using google shared example: https://github.com/firebase/quickstart-android/tree/master/messaging you can confirm the same.

            FirebaseMessaging.getInstance().subscribeToTopic("news");
            Log.d(TAG, "Subscribed to news topic");
    

提交回复
热议问题