send FCM to a particular version of your android app

99封情书 提交于 2020-07-03 07:33:37

问题


how to send FCM (Firebase Cloud Message) to a particular version of your android app? for example:- my app's latest version is 2.0 and i only want to send notifications to devices having version 2.0.


回答1:


If you're using the Notifications composer in the Firebase console to send your messages, you can target based on app version.

  • Choose "User segment" under the "Target" step, select your app, and click "and" on the right side:

  • In the new line that pops up, you can select "Version" and pick an app version:




回答2:


There is no built-in way to target a specific version of the app when sending messages through the FCM API. If you want to send messages to users of a specific version, you could set up a topic for each app version:

v1.0
v1.1
v2.0
...

So with that you can target users of a specific version.

If you want to send a message to all users that are not on the latest version, you can target them with a condition like this (if v2.0 is the latest version):

!('v2.0' in topics)


来源:https://stackoverflow.com/questions/54445652/send-fcm-to-a-particular-version-of-your-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!