Slide I used to deliver a talk in Global Azure Bootcamp 2015. I talked about developing app for wearables (e.g. Apple Watch and Android Wear) and leverage Azure App Service - Mobile App as the backend.
Global Azure Bootcamp is a yearly community-driven worldwide Azure-related talks.
56. So, what’s the options?
Deploy your backend
code on a Virtual Machine
Deploy your backend
code on a Cloud Service
Create App Service instance,
e.g. using Mobile App type
57. API APPS
Easily build and consume APIs in
the cloud
WEB APPS
Web apps that scale with your
business
LOGIC APPS
Automate business process
across SaaS and on-premises
MOBILE APPS
Build Mobile apps for any device
Azure App Service
67. application(applica
tion:
UIApplication,
handleWatchKitExten
sionRequest
userInfo: [NSObject
: AnyObject]?,
reply:
(([NSObject :
AnyObject]!)
WKInterfaceCo
ntroller.open
ParentApplica
tion() Internet
Azure App Service
or any backend
service
[“action": “loadTasks"]
[“data": task
dictionary array,
“error”: “error string”]
WatchKit Extension & iOS app communication
WatchKit Extension iOS App
Calling “openParentApplication” on WatchKit extension side will be handled
by “handleWatchKitExtensionRequest” on iOS app side.
68. WatchKit Extension & iOS app communication - loading tasks
WKInterfaceController.openParentApplication(["ac
tion": "loadTasks"], reply: { (replyInfo, error)
-> Void in
if error != nil {
//do something about error
}
let replyDict = replyInfo as [NSObject :
AnyObject]
if let errorMsg = replyDict["error"] as?
String {
if !errorMsg.isEmpty {
//do something about error
return
}
}
self.records = replyDict["data"] as!
[Dictionary<String, AnyObject>]
self.configureTable() //reload table
})
func application(application: UIApplication,
handleWatchKitExtensionRequest userInfo: [NSObject :
AnyObject]?, reply: (([NSObject : AnyObject]!) ->
Void)!) {
if let userInfo = userInfo {
if let action = userInfo["action"] as?
String {
if action == "loadTasks" {
println("userInfo: (userInfo)")
//do load tasks from Azure
loadTasks (reply)
}
else if action == "completeTask" {
if let data = userInfo["data"]
as? Dictionary<String, AnyObject> {
//update data to Azure
completeTask(data, reply:
reply)
}
}
}
}
}
WatchKit Extension side - InterfaceController.swift iOS app side - AppDelegate.swift