简体   繁体   English

将 FCM 发送到您的 android 应用程序的特定版本

[英]send FCM to a particular version of your android app

how to send FCM (Firebase Cloud Message) to a particular version of your android app?如何将 FCM(Firebase 云消息)发送到您的 android 应用程序的特定版本? for example:- my app's latest version is 2.0 and i only want to send notifications to devices having version 2.0.例如:- 我的应用程序的最新版本是 2.0,我只想向具有 2.0 版本的设备发送通知。

There is no built-in way to target a specific version of the app when sending messages through the FCM API.通过 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是最新版本):

!('v2.0' in topics)

If you're using the Notifications composer in the Firebase console to send your messages, you can target based on app version.如果您使用 Firebase 控制台中的通知编辑器发送消息,则可以根据应用版本进行定位。

  • 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:在弹出的新行中,您可以选择“版本”并选择一个应用程序版本:

按版本定位

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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