Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stay connected to mqtt broker after I terminate my application (ios , Swift)

Tags:

ios

push

swift

mqtt

I'm developing an app in swift using this source https://github.com/aciidb0mb3r/SwiftMQTT I want to add remote push notifications. I managed to do it with local notifications for example, when the app is running even if it's not in the foreground.

My question is how can i do it when the app isn't running. As i have seen when i close the app completed my broker say that i'm disconnected. Is there any way to stay connected forever?

Something like remote push notifications that wake's up the application even if its not running

Thanks in advance :)

like image 888
mike vorisis Avatar asked Jul 05 '16 09:07

mike vorisis


1 Answers

Finally I found out what it should be.

Hivemq (a mqtt broker) has a guide for developing a plugin with java, so that I did, I implemented push notification backend and with mysql connected clients and when the message comes I search offline clients with the topic of message and send only to them the push!

Thanks all for your help.

like image 115
mike vorisis Avatar answered Oct 07 '22 01:10

mike vorisis