I'm trying to send notifications to mobile devices using firebase admin sdk with asp.net mvc... But I'm stuck a certain request limit. Is there any way to get around this limit? I share some snippets of my code below.
- var path = HttpContext.Current.Server.MapPath("~/assd.json");
- var path = HttpContext.Current.Server.MapPath("~/assd.json");
- FirebaseApp.Create(new AppOptions()
- {
- Credential = GoogleCredential.FromFile(path),
- ProjectId = "*********",
- });
-
- var message = new MulticastMessage
- {
- Data = new Dictionary<string, string>()
- {
- { "type", type },
- { "typeValue", typeValue },
- { "isSound", isSound.ToString()},
- { "title", title},
- { "body", spot },
-
- },
- Apns = new ApnsConfig()
- {
- Headers = new Dictionary<string, string>()
- {
- { "apns-priority", "10" },
- },
- Aps = new Aps()
- {
- Alert = new ApsAlert()
- {
- Title = title,
- Body = spot,
- },
- Badge = 1,
- },
- },
- Tokens = tokens,
- };
-
- var response =FirebaseMessaging.DefaultInstance.SendMulticastAsync(message).Result;
- if (response.FailureCount > 0)
- {
- var failedTokens = new List<string>();
- for (var i = 0; i < response.Responses.Count; i++)
- {
- if (!response.Responses[i].IsSuccess)
- {
- failedTokens.Add(tokens[i]);
- listLog.Add(tokens[i]);
- }
- }
- }
I also try to use the topic system, but it also has a limit.
Thank you.. Sofware Developer