简体   繁体   English

将数据发送到Android设备通知到IOS设备

[英]Send data to Android device Notification to IOS devices

We are using firebase to send notifications to both Android and IOS devices from server and we are using legacy FCM to send notifications . 我们正在使用Firebase从服务器向Android和IOS设备发送通知,并且正在使用旧版FCM发送通知 But when our app is backgrounded notification is handled by system itself and thus we couldn't handle it by app. 但是,当我们的应用程序处于后台时,通知是由系统本身处理的,因此我们无法由应用程序处理。 So we need to add data to notification to handle the notification by application itself on android side. 因此,我们需要向通知中添加数据,以在Android端由应用程序本身处理通知。

But due to we also have ios devices we couldn't remove notification from the pattern. 但是由于我们也有ios设备,因此无法从模式中删除通知。

Is there any way to send data to Android devices and notification to IOS devices? 有什么方法可以向Android设备发送数据并向IOS设备发送通知吗?

Also you may find the pattern that I mentioned at below. 您也可以找到我在下面提到的模式。

{
    {
    "registration_ids":[

    ],
    "content_available":true,
    "priority":"high",
    "data":{
        "title":"",
        "text":"",
        "badge": 1,
        "sound": "default"
    },
    "notification":{
        "title":"",
        "body":"",
        "badge": 1,
        "sound": "default"
    }
}

You will have to map the FCM Registration ID with the OS Type and store it somehow. 您将必须将FCM Registration IDOS Type进行映射并以某种方式存储它。 Now when you are sending the notifications, based on the OS Type , you will change the body structure for the notifications. 现在,当您基于OS Type发送通知时,将更改通知的主体结构。

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

相关问题 Laravel 5将推送通知发送到android和ios设备 - Laravel 5 send push notification to android and ios device 使用设备ID向特定设备发送通知 - send notification to particular devices by using device id 从设备到其他设备的Android推送通知 - Android Push Notification from device to other devices 已淘汰的设备:将推送通知解析到Android设备 - OUTDATED DEVICE: Parse Push Notification to Android devices 在Android和iOS设备中基于用户并结合设备和应用ID的推送通知 - push notification based on users with combination of device and app id in android and iOS devices 如何将推送通知发送到多个Android设备 - how to send push notification to multiple android devices 如何发送通知到物理上更接近的android设备 - How to send notification to physically closer android devices 如何在两个Android设备之间发送通知 - How to send notification between two android devices 将Firebase通知发送到多个已注册的Android设备 - Send Firebase Notification to multiple registered Android devices 如何使用 expo 一次向所有 android 和 ios 设备发送推送通知? - How to send push notification to all android and ios devices at once in react native using expo?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM