TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ahmet Özdemir
NA
6
2.1k
Sending notifications to mobile devices using firebase Firebase Admin
Mar 12 2021 11:34 AM
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
Reply
Answers (
1
)
.NET Core 5.0 TestServer
Regarding Temperature sensor and raspberry pie