推送消息 - iOS mqtt推送相关问题?
ringa_lee
ringa_lee 2017-04-17 17:28:59
0
1
688

因为服务端用的是mqtt推送,现在我这边只有打开程序的时候能收到推送消息,后台和没打开的时候,不能收到,我想问能不能设置成像普通弹框通知那样来提示推送消息,怎么设置?要不要通过APNS呢

ringa_lee
ringa_lee

ringa_lee

reply all(1)
刘奇

iOS leaves a very short time for the program to obtain network requests in the background, and if you want to get push when the app is not started, you can only use APNS. The principle of Aurora push is also based on APNS!

MQTT is an instant messaging protocol based on TCP/IP transmission, similar to socket. This is a completely different communication mechanism from APNS.

APNS requires push certificates provided by Apple, as well as two different certificates provided by Apple for App development and launch. You need to register the current login device with the Apple server in the program, obtain the deviceToken, and then tell your server. You need the server to pass the Apple servers send the message, which then sends it to your device.

MQTT only requires you to build an MQTT server yourself, and then use the stream in the program to establish a long link with your server. In order to ensure security, you generally need to put your own SSL certificate here. After establishing a long link, your program can subscribe to and send messages to the server! When the topic you subscribe to has new content, it will be sent to the device in the form of a stream through this long link. You only need to do what you want to do on the receiving end. You can pop up a box to prompt the user, or you can update data and update the UI

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template