It’s been a long time since my last post! A lot has happened with us since, including Sam switching to Nate’s awesome Loop app based on his Loopkit toolkit and our favorite RileyLink board couple of months ago!
While this was a great change for Sam (Less devices to carry and easier UI to manage Loop) as parents we really wanted to be informed on Loop activity and also be able to get failure messages while he is away from us like for example at school. While learning swift to understand the logic and algorithm being used for Loop app the next logical step was to integrate the Loop with backend Azure I built for OpenAPS using Azure Logic Apps , API Apps and Mobile App/Notification Hub. This was a fairly straight forward by adding couple of lines of swift and shortly after we started receiving messages on both our Windows Phone and Surface running NightScout UWA.
This was all good till this week when I finally made the decision to switch to iOS after being loyal to Windows Phone for past 11 years! One of main blockers was lack of access to Loop’s push notification and while Pete’s awesome work on NightScout integration was great to have the remote monitoring piece I wanted to be able to get the same alerts on iPhone as well.
That’s where the idea of Loop Follow came about!
Thanks to Azure team’s awesome documentation, first I started configuring our custom Mobile App to support Apple push by following the following guide (On GitHub!):
https://github.com/Azure/azure-content/blob/master/articles/notification-hubs/notification-hubs-ios-apple-push-notification-apns-get-started.md
Next I started a simple Xcode project and reused the code from another great Azure guide here:
https://github.com/Azure/azure-content/blob/master/articles/app-service-mobile/app-service-mobile-ios-get-started-push.md
In order to fully integrate with my backend (Mobile App) following above guide:
- I used the latest release of Microsoft Azure Mobile Apps: iOS SDK
- I updated the sample code and added the applicationKey (Not including the key you will get a 401 from Mobile App)
classClientManager{staticlet sharedClient =MSClient(applicationURLString:“[Your Mobile App URL”, applicationKey: “[Your Mobile App Key”))} - After deploying the app to iPhone, using the awesome Notification Hub Test Send feature I sent a test push message to ensure everything works end to end:
- Next I simply updated both of my Logic Apps and by using Jeff’s awesome API App Apple Push support was just a breeze!
- And in a minute or so all the messages started showing up on my iPhone!