Allow the notification time to be specific to each user, based on their preferences and timezone.If I were to enhance the application, I’d do the following Ultimately, I just decided to skip using Cron, and schedule the job to run every 3 hours. – I didn’t want to send a notification at midnight). I attempted to use Cron to limit the times that the job would run (i.e. My second challenge was with the CloudWatch scheduling component. In other cases, I only pass the item key, and retrieve the information in the lambda function (via a DynamoDB call). In some places, I pass all the information in the sns message. If a failure occurs, then a message is sent to the user, directing them to re-authorize the application to access their Fitbit account.īy biggest challenge with this flow was determining the best method to pass and provide information to the lambda functions. If the token is refreshed, then the information is saved to the DynamoDB table and passed to the Get Device Info Topic (starting the process all over again).The Lambda function again calls a Fitbit API this time to refresh the token. If a “Token Expired” error is returned, then the Lambda function passes the required information to the Refresh User SNS topic.If the result was a success then the a message is sent to the SNS topic for the subscribed user – assuming that the battery status is low AND the user has not already been notified.…kicks off the Lambda function that obtains the Fitbit device info. The Fitbit api is called, and the resulting message is processed by the Lambda function. The device information is stored in and retrieved from the DynamoDB table as needed for processing and history tracking.The CloudWatch Scheduler kicks off a Lambda job that pulls registered users from the DynamoDB table. This information is based to a SNS topic, which in turn….This post describes how the device status is checked and communicated to the user. Part 2 covered the Authentication Flow of the process. In Part 1, I introduced an app that sends an SMS notification when your Fitbit battery is low.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |