setBackgrounded method
Suspends wallet notifications and balance polling, and closes idle relay connections when the application enters background. Active requests keep their connections.
Implementation
Future<void> setBackgrounded(bool backgrounded) async {
wallets.setBackgrounded(backgrounded);
await nwc.setBackgrounded(backgrounded);
if (backgrounded) await relays.closeIdleConnections();
}