SlideShare a Scribd company logo
1 of 87
Download to read offline
Siri, I have a special upgrade
parts for you
MobileConf 2018
Pitiphong Phongpattranont - Mobile Developer at Omise
Prelude
Since the beginning of iPhone,
every 4 versions, iOS and iOS
SDK will have a new feature/
API which changes the way we
use iPhone forever
Multitasking in iOS 4
Extensions in iOS 8
iOS 12?
Custom Intents & Siri Shortcuts
integration
With Shortcuts, any app can
exposed quick action to Siri
This may be the beginning of a
new era of computer
interactions
Let's debunk some myths first
Apple is bad at AI because of
their privacy policy
– Craig Federighi, Senior Vice President, Software Engineering at Apple
“There's this idea that, well, if you don't have the data, how would
you ever learn? Well, turns out, if you want to get pictures of
mountains, you don't need to get it out of people's personal photo
libraries”
Google is good at AI because
they have a lot of users' data
– John Giannandrea, Chief of Machine Learning and AI Strategy at Apple
“Well you don’t need quite as much data as you think you do and in
fact there are lots and lots of large data sets which are open.”
– John Giannandrea, AI chief at Google
“Well you don’t need quite as much data as you think you do and in
fact there are lots and lots of large data sets which are open.”
Apple is late at AI
Apple has been working and
using Machine Learning (AI) in
lots of their products
What is Siri?
At the beginning, It was an
app/service as a voice
assistant
And then, Apple acquired it
and integrated it into iOS
Siri was the voice assistant
Siri has been improved and
upgraded into a Virtual
Assistant
Not just being a Voice
Assistant anymore
Nowadays Siri does not only
talk to you but also knows a lot
of you
Context
Information
Many things about you
So Siri can helps you in many
ways
Does a lot of suggestions in
many aspects
Now, let's talk about the
upgrading parts
Siri Shortcuts
“With Shortcuts, any app can
exposed quick action to Siri”
Siri can learn about user and
suggests some actions
throughout the iOS
In the form of

Siri Shortcuts
In order to have a better Siri,
Siri need to know more
You need to give Siri
information
The better and more
informations you gave to Siri,
the better it get
What Makes a Great Shortcut?
• Accelerate the user to perform a key function of your app

• Be of persistent interest to the user

• Be executable at any time
Working on Siri Shortcuts
Define Shortcut
Donate ShortcutDefine Shortcut
Donate ShortcutDefine Shortcut Handle Shortcut
Define and Donate?
There are 2 ways
NSUserActivity
let userActivity = NSUserActivity(activityType:
"com.myapp.name.my-activity-type")
userActivity.isEligibleForSearch = true
userActivity.isEligibleForPrediction = true
userActivity.title = "Activity"
userActivity.userInfo = ["key": "value"]
userActivity.suggestedInvocationPhrase = "Let's do it"
let userActivity = NSUserActivity(activityType:
"com.myapp.name.my-activity-type")
userActivity.isEligibleForSearch = true
userActivity.isEligibleForPrediction = true
userActivity.title = "Activity"
userActivity.userInfo = ["key": "value"]
userActivity.suggestedInvocationPhrase = "Let's do it"
let userActivity = NSUserActivity(activityType:
"com.myapp.name.my-activity-type")
userActivity.isEligibleForSearch = true
userActivity.isEligibleForPrediction = true
userActivity.title = "Activity"
userActivity.userInfo = ["key": "value"]
userActivity.suggestedInvocationPhrase = "Let's do it"
Intents
You can now define your own
custom Intent 🎉 🎉 🎉
Generated Code
public class OrderSoupIntent: INIntent {
public var items: [INObject]?
public var deliveryLocation: CLPlacemark?
}
public protocol OrderSoupIntentHandling: NSObjectProtocol
{
public func handle(intent: OrderSoupIntent, completion:
@escaping (OrderSoupIntentResponse) -> Void)
optional func confirm(intent: OrderSoupIntent,
completion:
@escaping (OrderSoupIntentResponse) -> Void)
}
Donation
// Donate your shortcut
let intent = OrderSoupIntent()
intent.items = order.items.map({
INObject(identifier: $0.id.uuidString,
display: $0.menuItem.displayName)
})
intent.deliveryLocation = order.destinationLocation
let interaction = INInteraction(intent: intent, response: nil)
interaction.donate { error in
// Handle error
}
Handle
// Handle your shortcut
func application(_ application: UIApplication, 

continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void)
-> Bool {
if userActivity.activityType == "OrderSoupIntent",
let intent = userActivity.interaction?.intent as?
OrderSoupIntent {
// Show ordering UI, pre-populated with the fields
from the intent
}
}
Handle
// Handle your shortcut
class IntentHandler: INExtension, OrderSoupIntentHandling {
func confirm(intent: OrderSoupIntent, completion: 

(OrderSoupIntentResponse) -> Void) {
completion(OrderSoupIntentResponse(code: .ready, 

userActivity: nil))
}
func handle(intent: OrderSoupIntent, completion: (

OrderSoupIntentResponse) -> Void) {
// Order the soup
completion(OrderSoupIntentResponse(code: .success, 

userActivity: nil))
}
}
Choosing an Adoption Strategy
Use NSUserActivity if your shortcut: 

• Opens something in your app

• Represents showing items that you index in Spotlight or offer for Handoff
Choosing an Adoption Strategy
For the best experience, adopt Intents. Intents-based shortcuts can: 

• Run inline, without launching your app

• Include custom voice response or a custom UI

• Include granular predictions
Limitation
Intents cannot accept or pass
any parameters/data at the
moment
But we hope that it would be
able to do that in the future
For more information, please
visit https://
developer.apple.com/
Why do we need to support
this in our apps?
In my opinion, the integration
of apps and running OS will be
more and more integrated
It has been started for several
years already
And it’s still in progress
And it will continue for a long
time in the future
This means that just having a
mobile app without the OS
integration will not be enough
anymore
Except you are a huge gigantic
service which everyone uses

(I’m looking at you, Facebook)
I think and hope that it would
become one of the
requirements in the future
Even it’s not a requirement at
the moment but it will give a lot
of value to your app
Especially this Siri Shortcuts
Does it worth the effort?
YES!!!
Siri Shortcuts is designed for
every from beginner to power
users
So let’s upgrade Siri with your
app
And users will love your apps
Q&A
Thank you

More Related Content

Similar to Siri and the upgrade parts

Nearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding WorkshopNearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding WorkshopMisael Leon
 
Apple Watch: Everything You Need To Know As A Marketer
Apple Watch: Everything You Need To Know As A MarketerApple Watch: Everything You Need To Know As A Marketer
Apple Watch: Everything You Need To Know As A MarketerInlight
 
App Development Smart Guide
App Development Smart GuideApp Development Smart Guide
App Development Smart GuideEmma Mitchell
 
A smart guide to app development
A smart guide to app developmentA smart guide to app development
A smart guide to app developmentEmma Mitchell
 
Designing and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps PlatformDesigning and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps PlatformApigee | Google Cloud
 
Alt tab mobile company overview - feb 2015
Alt tab mobile   company overview - feb 2015Alt tab mobile   company overview - feb 2015
Alt tab mobile company overview - feb 2015Roger Jones
 
Mobile App Development Proposal Template PowerPoint Presentation Slides
Mobile App Development Proposal Template PowerPoint Presentation SlidesMobile App Development Proposal Template PowerPoint Presentation Slides
Mobile App Development Proposal Template PowerPoint Presentation SlidesSlideTeam
 
Android_Workshop
Android_WorkshopAndroid_Workshop
Android_WorkshopSenthil ACS
 
Preparing for Release to the App Store
Preparing for Release to the App StorePreparing for Release to the App Store
Preparing for Release to the App StoreGeoffrey Goetz
 
Tool review for Countly
Tool review for CountlyTool review for Countly
Tool review for CountlyMatthew Porter
 
Mobile Apps - Where's the beef
Mobile Apps - Where's the beefMobile Apps - Where's the beef
Mobile Apps - Where's the beefcompuccino
 
Accidental API developer - the 12 month pregnancy to create new API
Accidental API developer - the 12 month pregnancy to create new APIAccidental API developer - the 12 month pregnancy to create new API
Accidental API developer - the 12 month pregnancy to create new APIMarjukka Niinioja
 
Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...
Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...
Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...Jayneel Patel
 
The mobile opportunity: what every business leader needs to know
The mobile opportunity: what every business leader needs to knowThe mobile opportunity: what every business leader needs to know
The mobile opportunity: what every business leader needs to knowRobosoft Technologies
 
eStudio34 presents London Search Love 2015 | Practical tips for the future o...
eStudio34 presents London Search Love 2015 |  Practical tips for the future o...eStudio34 presents London Search Love 2015 |  Practical tips for the future o...
eStudio34 presents London Search Love 2015 | Practical tips for the future o...William Renedo
 
SearchLove London 2015 | Will Critchlow | Practical Tips for the Future of ...
SearchLove London 2015 |  Will Critchlow |  Practical Tips for the Future of ...SearchLove London 2015 |  Will Critchlow |  Practical Tips for the Future of ...
SearchLove London 2015 | Will Critchlow | Practical Tips for the Future of ...Distilled
 

Similar to Siri and the upgrade parts (20)

Nearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding WorkshopNearsoft Mobile Onboarding Workshop
Nearsoft Mobile Onboarding Workshop
 
Apple Watch: Everything You Need To Know As A Marketer
Apple Watch: Everything You Need To Know As A MarketerApple Watch: Everything You Need To Know As A Marketer
Apple Watch: Everything You Need To Know As A Marketer
 
App Development Smart Guide
App Development Smart GuideApp Development Smart Guide
App Development Smart Guide
 
A smart guide to app development
A smart guide to app developmentA smart guide to app development
A smart guide to app development
 
Designing and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps PlatformDesigning and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps Platform
 
Alt tab mobile company overview - feb 2015
Alt tab mobile   company overview - feb 2015Alt tab mobile   company overview - feb 2015
Alt tab mobile company overview - feb 2015
 
Mobile App Development Proposal Template PowerPoint Presentation Slides
Mobile App Development Proposal Template PowerPoint Presentation SlidesMobile App Development Proposal Template PowerPoint Presentation Slides
Mobile App Development Proposal Template PowerPoint Presentation Slides
 
Mobile Application Development - Guide 2020
Mobile Application Development - Guide 2020Mobile Application Development - Guide 2020
Mobile Application Development - Guide 2020
 
Mobile Application
Mobile ApplicationMobile Application
Mobile Application
 
Android_Workshop
Android_WorkshopAndroid_Workshop
Android_Workshop
 
Preparing for Release to the App Store
Preparing for Release to the App StorePreparing for Release to the App Store
Preparing for Release to the App Store
 
Tool review for Countly
Tool review for CountlyTool review for Countly
Tool review for Countly
 
Mobile Apps - Where's the beef
Mobile Apps - Where's the beefMobile Apps - Where's the beef
Mobile Apps - Where's the beef
 
Accidental API developer - the 12 month pregnancy to create new API
Accidental API developer - the 12 month pregnancy to create new APIAccidental API developer - the 12 month pregnancy to create new API
Accidental API developer - the 12 month pregnancy to create new API
 
Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...
Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...
Webinar by OpenXcell Technolabs: Impacts of iOS 7 on App Marketers and Develo...
 
Ayush portfolio
Ayush portfolioAyush portfolio
Ayush portfolio
 
12 top app testing tools
12 top app testing tools12 top app testing tools
12 top app testing tools
 
The mobile opportunity: what every business leader needs to know
The mobile opportunity: what every business leader needs to knowThe mobile opportunity: what every business leader needs to know
The mobile opportunity: what every business leader needs to know
 
eStudio34 presents London Search Love 2015 | Practical tips for the future o...
eStudio34 presents London Search Love 2015 |  Practical tips for the future o...eStudio34 presents London Search Love 2015 |  Practical tips for the future o...
eStudio34 presents London Search Love 2015 | Practical tips for the future o...
 
SearchLove London 2015 | Will Critchlow | Practical Tips for the Future of ...
SearchLove London 2015 |  Will Critchlow |  Practical Tips for the Future of ...SearchLove London 2015 |  Will Critchlow |  Practical Tips for the Future of ...
SearchLove London 2015 | Will Critchlow | Practical Tips for the Future of ...
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

Siri and the upgrade parts

  • 1. Siri, I have a special upgrade parts for you MobileConf 2018 Pitiphong Phongpattranont - Mobile Developer at Omise
  • 3. Since the beginning of iPhone, every 4 versions, iOS and iOS SDK will have a new feature/ API which changes the way we use iPhone forever
  • 7. Custom Intents & Siri Shortcuts integration
  • 8. With Shortcuts, any app can exposed quick action to Siri
  • 9. This may be the beginning of a new era of computer interactions
  • 10. Let's debunk some myths first
  • 11. Apple is bad at AI because of their privacy policy
  • 12. – Craig Federighi, Senior Vice President, Software Engineering at Apple “There's this idea that, well, if you don't have the data, how would you ever learn? Well, turns out, if you want to get pictures of mountains, you don't need to get it out of people's personal photo libraries”
  • 13. Google is good at AI because they have a lot of users' data
  • 14. – John Giannandrea, Chief of Machine Learning and AI Strategy at Apple “Well you don’t need quite as much data as you think you do and in fact there are lots and lots of large data sets which are open.”
  • 15. – John Giannandrea, AI chief at Google “Well you don’t need quite as much data as you think you do and in fact there are lots and lots of large data sets which are open.”
  • 16. Apple is late at AI
  • 17. Apple has been working and using Machine Learning (AI) in lots of their products
  • 19. At the beginning, It was an app/service as a voice assistant
  • 20. And then, Apple acquired it and integrated it into iOS
  • 21. Siri was the voice assistant
  • 22. Siri has been improved and upgraded into a Virtual Assistant
  • 23. Not just being a Voice Assistant anymore
  • 24. Nowadays Siri does not only talk to you but also knows a lot of you
  • 28. So Siri can helps you in many ways
  • 29. Does a lot of suggestions in many aspects
  • 30. Now, let's talk about the upgrading parts
  • 32. “With Shortcuts, any app can exposed quick action to Siri”
  • 33. Siri can learn about user and suggests some actions throughout the iOS
  • 34. In the form of
 Siri Shortcuts
  • 35. In order to have a better Siri, Siri need to know more
  • 36. You need to give Siri information
  • 37. The better and more informations you gave to Siri, the better it get
  • 38. What Makes a Great Shortcut? • Accelerate the user to perform a key function of your app • Be of persistent interest to the user • Be executable at any time
  • 39. Working on Siri Shortcuts
  • 44. There are 2 ways
  • 46. let userActivity = NSUserActivity(activityType: "com.myapp.name.my-activity-type") userActivity.isEligibleForSearch = true userActivity.isEligibleForPrediction = true userActivity.title = "Activity" userActivity.userInfo = ["key": "value"] userActivity.suggestedInvocationPhrase = "Let's do it"
  • 47. let userActivity = NSUserActivity(activityType: "com.myapp.name.my-activity-type") userActivity.isEligibleForSearch = true userActivity.isEligibleForPrediction = true userActivity.title = "Activity" userActivity.userInfo = ["key": "value"] userActivity.suggestedInvocationPhrase = "Let's do it"
  • 48. let userActivity = NSUserActivity(activityType: "com.myapp.name.my-activity-type") userActivity.isEligibleForSearch = true userActivity.isEligibleForPrediction = true userActivity.title = "Activity" userActivity.userInfo = ["key": "value"] userActivity.suggestedInvocationPhrase = "Let's do it"
  • 50. You can now define your own custom Intent 🎉 🎉 🎉
  • 51.
  • 52. Generated Code public class OrderSoupIntent: INIntent { public var items: [INObject]? public var deliveryLocation: CLPlacemark? } public protocol OrderSoupIntentHandling: NSObjectProtocol { public func handle(intent: OrderSoupIntent, completion: @escaping (OrderSoupIntentResponse) -> Void) optional func confirm(intent: OrderSoupIntent, completion: @escaping (OrderSoupIntentResponse) -> Void) }
  • 53. Donation // Donate your shortcut let intent = OrderSoupIntent() intent.items = order.items.map({ INObject(identifier: $0.id.uuidString, display: $0.menuItem.displayName) }) intent.deliveryLocation = order.destinationLocation let interaction = INInteraction(intent: intent, response: nil) interaction.donate { error in // Handle error }
  • 54. Handle // Handle your shortcut func application(_ application: UIApplication, 
 continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { if userActivity.activityType == "OrderSoupIntent", let intent = userActivity.interaction?.intent as? OrderSoupIntent { // Show ordering UI, pre-populated with the fields from the intent } }
  • 55.
  • 56. Handle // Handle your shortcut class IntentHandler: INExtension, OrderSoupIntentHandling { func confirm(intent: OrderSoupIntent, completion: 
 (OrderSoupIntentResponse) -> Void) { completion(OrderSoupIntentResponse(code: .ready, 
 userActivity: nil)) } func handle(intent: OrderSoupIntent, completion: (
 OrderSoupIntentResponse) -> Void) { // Order the soup completion(OrderSoupIntentResponse(code: .success, 
 userActivity: nil)) } }
  • 57. Choosing an Adoption Strategy Use NSUserActivity if your shortcut: • Opens something in your app • Represents showing items that you index in Spotlight or offer for Handoff
  • 58. Choosing an Adoption Strategy For the best experience, adopt Intents. Intents-based shortcuts can: • Run inline, without launching your app • Include custom voice response or a custom UI • Include granular predictions
  • 60. Intents cannot accept or pass any parameters/data at the moment
  • 61. But we hope that it would be able to do that in the future
  • 62. For more information, please visit https:// developer.apple.com/
  • 63. Why do we need to support this in our apps?
  • 64. In my opinion, the integration of apps and running OS will be more and more integrated
  • 65. It has been started for several years already
  • 66. And it’s still in progress
  • 67. And it will continue for a long time in the future
  • 68. This means that just having a mobile app without the OS integration will not be enough anymore
  • 69. Except you are a huge gigantic service which everyone uses
 (I’m looking at you, Facebook)
  • 70. I think and hope that it would become one of the requirements in the future
  • 71. Even it’s not a requirement at the moment but it will give a lot of value to your app
  • 72. Especially this Siri Shortcuts
  • 73. Does it worth the effort?
  • 75. Siri Shortcuts is designed for every from beginner to power users
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83. So let’s upgrade Siri with your app
  • 84. And users will love your apps
  • 85.
  • 86. Q&A