In part 1 we crated a Flow to enable/disable the sending of push notifications and in part 2 we created an Azure Function to generate random phrases of positivity.
In this third and final part of this series we’ll go and create the second Flow that sends the push notifications to the phone.
This Flow will be automatically triggered every 15 minutes by using a Recurrence action followed by an action to get the blob content containing whether or not we should send a notification as the following screenshot shows:
Now that we have the blob content, we can examine it in an If condition. If the content of the blob is “enabled” we can continue the Flow:
If the condition is satisfied (“IF YES”) two actions are performed: the first an HTTP GET to the Azure function, the second a push notification action that as content uses what was returned in the body of the HTTP GET. Notice in the HTTP GET, the URI includes the function authorization key as a query string parameter.
After saving the new Flow, we can head back to the Flow app and hit the button to enable “positivity pushes”:
Then every 15 minutes (until we turn them off by hitting the button again) we’ll get a positivity notification on the phone:
SHARE: