public void Initialize(string productId, string keyPath) { _baseUri = new Uri($"https://fcm.googleapis.com/v1/projects/{productId}/messages:send"); keyPath = JsonAppConfig.SearchParentDirectory(keyPath); var scope = "https://www.googleapis.com/auth/firebase.messaging"; using var stream = new FileStream(keyPath, FileMode.Open, FileAccess.Read); _googleCredential = GoogleCredential.FromStream(stream).CreateScoped(scope); }
public static void Initialize(string keyPath) { keyPath = JsonAppConfig.SearchParentDirectory(keyPath); dsa = CreatePrivateKeyAlgorithm(keyPath); }