Added fcmToken to the request body for user registration
Created a private function called registerToSNS in AccountService which sends the fcmToken (Firebase Cloud Messaging Token) of the registering device to the relevant Lambda function. The lambda generates a unique SNS application endpoint and saves the endpoint, userId, and deviceToken to a DynamoDB table.
If no fcmToken is received, we don't register the device for sending notifications at all. We may need to add additional checks during login for when the deviceToken of the user may change.
Created a private function called notifyUserLevelUp which sends a notification to the user who just leveled up (if they leveled up) via a Lambda function defined on AWS.
[!Caution]
A new secrets.properties property must be added for proper configuration. The updated secrets.properties file is available in the relevant confluence page
ServiceUris
file.fcmToken
to the request body for user registrationregisterToSNS
inAccountService
which sends thefcmToken
(Firebase Cloud Messaging Token) of the registering device to the relevant Lambda function. The lambda generates a unique SNS application endpoint and saves theendpoint
,userId
, anddeviceToken
to aDynamoDB
table.deviceToken
of the user may change.notifyUserLevelUp
which sends a notification to the user who just leveled up (if they leveled up) via a Lambda function defined on AWS.