startForegroundService method
Start a foreground service for continuous notification polling.
This creates a persistent notification and runs a service that is less likely to be killed by the system. Use this for more reliable notification delivery. Returns true if the service was started successfully.
Implementation
@override
Future<bool> startForegroundService({
required String pollingUrl,
int? intervalMinutes,
String? channelId,
}) async {
final result = await methodChannel
.invokeMethod<bool>('startForegroundService', {
'pollingUrl': pollingUrl,
'intervalMinutes': ?intervalMinutes,
'channelId': ?channelId,
});
return result ?? false;
}