FCMv1 authentication

Ashwin 40 Reputation points
2024-05-26T11:22:32.0533333+00:00

Working on our project for a temp setup, before moving to production, configuration authention for Azure Notification Hub Service, checked the sample template for authentication.

Migrated to the FCMv1 version.

1.Should we store both FCM legacy and FCM v1 credentials? FCMv1

2.What is "number of send API calls"?

3.SendTemplateNotificationAsync not working

"{ "message" : { "notification" : { "body" : "$(message)", "title" : "Test" }}}" and my call to templated notification is $NotificationOutcome = $client.SendTemplateNotificationAsync( $templateParameterDictionary, '$InstallationId:{781-}').Result

 var token = new JwtSecurityToken(
            issuer: _configuration["JWT:ValidIssuer"],
            audience: _configuration["JWT:ValidAudience"],
            expires: DateTime.Now.AddHours(3),
            claims: authClaims,
            signingCredentials: new SigningCredentials(authSigningKey, SecurityAlgorithms.HmacSha256)
            );

        UserDetails userDetails = new UserDetails();
        userDetails.FirstName = model.Username;
        userDetails.LastName = model.Username;
        userDetails.UserName = model.Username;

        return Ok(new
        {
            token = new JwtSecurityTokenHandler().WriteToken(token),
            expiration = token.ValidTo,
            username = model.Username,
            email = user.Email,
            role = userRoles != null ? userRoles[0] : "Site-Manager",
            user = userDetails
        });     }     return Unauthorized(); } 
Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
325 questions
{count} votes

Accepted answer
  1. ajkuma 26,721 Reputation points Microsoft Employee
    2024-05-30T07:08:59.4566667+00:00

    @Ashwin , Thanks for posting this question. Apologies for the delayed response.

    1.In Azure Notification Hubs (ANHs), FCM legacy and FCM v1 are considered distinct platforms. Therefore, you must store the credentials for both FCM legacy and FCM v1 separately.

    1. If my understanding for your question is correct:

    A call to any of these counts as an API call. A call to any of the send APIs (direct single/batch send, native/template send) is a send API call.

    All APIs include everything - If you're using an application like PostMan to make raw REST calls to our service, those count as individual calls. Our SDKs wrap our REST APIs, but could technically call us more than once due to things like retries or de-bouncing logic for device registration/installation management.

    3.For the sendTemplateNotificationAsync issue, it looks like the issue was due to a bug, I had posted an answer on a discussion thread, kindly take a look at this here.

    Our engineering team have completed the bug fix and will begin rolling this update today. It will be deployed to all the regions in a phased manner.  However, we don't have a concrete ETA to provide for the deployment of the update across all regions.

    Kindly let us know, I'll follow-up with you further.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.