initialize static method
Inicializa o serviço de sincronização em background
Implementation
static Future<void> initialize() async {
if (_isInitialized) return;
try {
// Inicializar WorkManager
await Workmanager().initialize(
callbackDispatcher,
isInDebugMode: kDebugMode,
);
// As notificações são agora gerenciadas internamente pelo Syncly
// através do SyncNotificationService
_isInitialized = true;
SyncUtils.debugLog('BackgroundSyncService inicializado com sucesso', tag: 'BackgroundSyncService');
} catch (e) {
SyncUtils.debugLog('Erro ao inicializar BackgroundSyncService: $e', tag: 'BackgroundSyncService');
rethrow;
}
}