public async Task TryAutoStart(INativeAdapter adapter, ILogger logger) { if (this.CurrentRegistrationToken.IsEmpty()) { return; } try { logger.LogInformation("Container has active push registration token - attempting to start"); var result = await adapter.RequestAccess().ConfigureAwait(false); logger.LogDebug($"Auto-Start Permission: {result.Status} - {result.RegistrationToken}"); if (result.RegistrationToken.IsEmpty()) { logger.LogDebug("No registration token - removing stored tokens"); // TODO: change this? this.ClearRegistration(); } else if (result.RegistrationToken?.Equals(this.CurrentRegistrationToken) ?? false) { logger.LogInformation("Push registration token updated"); // TODO: change this? this.SetCurrentToken(result.RegistrationToken !, true); await this.OnTokenRefreshed(this.CurrentRegistrationToken !).ConfigureAwait(false); } } catch (Exception ex) { logger.LogWarning("Failed to auto-start push", ex); } }
public PushManager(PushContainer container, INativeAdapter adapter, ILogger <PushManager> logger) { this.adapter = adapter; this.container = container; this.logger = logger; }
public PushManager(INativeAdapter native, ILogger <PushManager> logger, PushContainer container, AzureNotificationConfig config) { this.native = native; this.container = container; this.logger = logger; this.config = config; }
public PushManager(INativeAdapter adapter, PushContainer container, ILogger <PushManager> logger, AppleLifecycle lifecycle, FirebaseConfiguration?config = null) { this.adapter = adapter; this.container = container; this.logger = logger; this.lifecycle = lifecycle; this.config = config; }