将通知从Web服务器(php和mysql)推送到iOS应用程序

将通知从Web服务器(php和mysql)推送到iOS应用程序

问题描述:

i am working on messaging application in which i want to send notifications for a new message from web server to iOS device. I have no idea how to achieve this. Could anyone help me out. Thanks in advance.

我正在处理消息传递应用程序,我希望将新消息的通知从Web服务器发送到iOS设备。 我不知道如何实现这一目标。 任何人都可以帮助我。 提前致谢。 p> div>

It can be easy achieved with using Google Cloud Messaging (Firebase cloud messaging). It supports both iOS/Android platforms. Allows broadcasted Push Notifications. iOS/Android app subscribes to a "topic". GCM/FCM sends push to the "topic" and all subscribed apps receive push notifications. Firebase Cloud Messaging is new version of GCM and developed to replace Google Cloud Messaging. Google recommends to use FCM on new projects. But on my project we still use GCM, it is enough for our business requirements.

Your server can trigger FCM endpoint for sending Push Notification.