i have a working app that connects and receives data from hardware device via mqtt server.
I would like to send notification messages to the users mobile from hardware device even the main app is closed.
As far as i have read in the forum, it is possible to run a background task.
while the main app is closed, can I still be connected to mqtt server and receive messages?
I would appreciate if someone can provide some help on this because i can not go any further with my application.
Use the Notifier.LogInfo method as debug statements and use logcat to debug
You do not need the inner if statement it is wrong anyway (should be if not connected)
Write your MessageReceived event handler
EDIT: first prepare a simple example which is working in the foreground and show your working blocks so we can compare with your blocks from the background processing