I recently started experimenting with SignalR for real time updates from a server in Xamarin.Forms. This is my scenario: PageA and PageB both create separate connections in order to receive updates from the server. A user can navigate from PageA to PageB and currently, both connections remain alive.
1. Would it be best to disconnect PageA's connection when navigating to PageB and reconnect when PageB is popped off the navigation stack?
2. Should I be using separate connections? (Both use the same HubProxy)
3. When debugging I noticed that there's network activity on the Android client when the app is in the background (I assume this is the case for the iOS client as well). How do I effectively suspend/disconnect all connections when the app is placed in the background and resume/reconnect when it returns to the foreground? How are the Pages/ViewModels made aware of this transition?
4. Similarly, if I use a service like PubNub, where do I place this suspense-resume (subscribe/unsubscribe) logic?