MQTT-Client-Framework icon indicating copy to clipboard operation
MQTT-Client-Framework copied to clipboard

Remove or add condition check for [UIApplication sharedApplication] in ForegroundReconnection.h

Open haok3166 opened this issue 8 years ago • 4 comments
trafficstars

Remove or add condition check for [UIApplication sharedApplication] in ForegroundReconnection.h so that the framework can be used in widgets.

haok3166 avatar Sep 21 '17 15:09 haok3166

Is [UIApplication sharedApplication] the only problem for Widgets or do you remember if there are other APIs used as well, that are not accessible from widgets ?

ogres avatar Sep 23 '17 10:09 ogres

Thanks for your response. Yes, [UIApplication sharedApplication] is the only issue when used in Widgets.

haok3166 avatar Sep 23 '17 13:09 haok3166

I think our best option here is to extract whole foreground reconnection to separate pod (maybe even repo?). I believe it is the only one that depends on UIKit and MQTTClient should not be dependent on UI framework. It could be in theory integrated macOS app as well.

jcavar avatar Sep 23 '17 17:09 jcavar

Yes, the UIKit dependency should be removed.

It is the client's responsibility to stop / resume the connection. For some apps, they might want to keep the connection in background.

Thanks for the great MQTT framework.

haok3166 avatar Sep 23 '17 17:09 haok3166