Azure, Open Source and ...

Azure Logic Apps, Azure SQL, Azure Mobile App and Loop (iOS) Better Together!

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 courtesy of Pete couple of months ago!

Capture Cq7JXpRVYAAwD0s

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 activities and also be able to get failure messages while he is away from us like for example at school. As I was learning swift to understand the logic and algorithm being used for Loop app the next logical step was to integrate it with backend Azure I built for OpenAPS using Azure Logic Apps , API Apps and Mobile App/Notification Hub. This was a fairly straight forward task by simply 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 for me 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 this guide (On GitHub!):

Next I started a simple Xcode project and reused the code from another great Azure guide here:

Finally, In order to fully integrate with my backend (Mobile App):

  • 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)
    class ClientManager { static let 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:
    Capture 20160922_180556000_iOS
  • 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!
    20160921_203951000_iOS 20160922_152515000_iOS 20160921_044556000_iOS