Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static void Initialize(string keyPath)
 {
     keyPath = JsonAppConfig.SearchParentDirectory(keyPath);
     dsa     = CreatePrivateKeyAlgorithm(keyPath);
 }