public void Setup() { client = new HttpClient { BaseAddress = new Uri(configurationSection["FirebaseUrl"]) }; client.DefaultRequestHeaders.Add("Authorization", $"key = {configurationSection["FirebaseServerKey"]}"); client.DefaultRequestHeaders.Add("Sender", $"id = {configurationSection["FirebaseSenderId"]}"); service = new FirebaseCloudMessagingService(client); }
private void LoadMessagingService() { if (_userCredential != null) { _messagingService = new FirebaseCloudMessagingService(new BaseClientService.Initializer() { HttpClientInitializer = _userCredential, ApplicationName = _applicationName, }); } }
public RepositoryIntegrationTests() { var contextOption = new DbContextOptionsBuilder <CoronaContext>(); contextOption.UseCosmos( configurationSection["CosmosEndpoint"], configurationSection["CosmosAuthKey"], configurationSection["CosmosDatabase"]); var context = new CoronaContext(contextOption.Options); repository = new CoronaRepository(context); var client = new HttpClient { BaseAddress = new Uri(configurationSection["FirebaseUrl"]) }; client.DefaultRequestHeaders.Add("Authorization", $"key = {configurationSection["FirebaseServerKey"]}"); client.DefaultRequestHeaders.Add("Sender", $"id = {configurationSection["FirebaseSenderId"]}"); pushService = new FirebaseCloudMessagingService(client); }