使用Firebase发送和接收iOS应用的推送通知 [英] Using Firebase to send and receive push notification for an iOS app

查看:520
本文介绍了使用Firebase发送和接收iOS应用的推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为iOS创建了一个基于firebase的聊天应用程序。其中一项功能是向同一个聊天室中的用户发送推送通知(如果他们不在线)。

我无法找到可用于向用户发送推送通知的firebase功能(适用于iOS)。



可能吗?

解决方案

在iPhone应用程序上显示警告标志和通知是通过苹果的推送通知系统完成的。由于应用程序在收到通知时并未在用户的手机上运行,​​因此必须从服务器端代码触发APN。

您可能需要创建一个服务器端模块,监听聊天Firebase的更改。当某个离线用户显示一条消息时,您必须使用APN安排远程通知。后一部分与Firebase无关,但具有丰富的苹果开发者网站上的文档



我不确定网络应用程序是否可以显示警报或徽章。否则,只有为您的Firebase聊天应用程序创建本机包装时,此方法才有效。


I am create a firebase based chat application for iOS. One of the features is to send push notification to the users in the same chat room (if they are offline).

I can't find a firebase function (for iOS) that can be used to send push notifications to the user.

Is it possible?

解决方案

Displaying alert badges and notifications on iPhone applications is accomplished through Apple's Push Notification system. Since the application is not running on the user's phone when they receive notifications, the APN will have to be triggered from your server-side code.

You'll probably want to create a server-side module that listens for changes to your chat Firebase. When a message appears for a user that is offline, you'll have to schedule a remote notification with the APN. That latter part has nothing to do with Firebase, but has extensive documentation on Apple's developer web site.

I'm not sure if a web application can display alerts or badges. Otherwise this approach will only work if you create a native wrapper for your Firebase chat application.

这篇关于使用Firebase发送和接收iOS应用的推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆