Does Apple Provide an API for Siri

Does Apple provide an API for SIRI?

In iOS 10, Apple has announced an API for Siri called SiriKit. However, you can only do it as an app extension and only if your app implements one of the following types of services:

  • Audio or video calling
  • Messaging
  • Payments
  • Searching photos
  • Workouts
  • Ride booking
  • Climate and radio

SiriKit is a way for you to make your content available through Siri.
It also lets you add support for your services to the Maps app. To
support SiriKit, you use the Intents framework and Intents UI
framework to implement one or more extensions that you then include
inside your iOS app. When the user requests specific types of services
through Siri or Maps, the system uses your extensions to provide those
services.

This means SiriKit cannot be used for the scenario mentioned in the question and in ways that many of us would like.

Source: Apple Docs for SiriKit

Where is iOS 6 Siri API

Rumors were incorrect, there is no Siri API (yet, hopefully).

Call the SiriKit API to create Automation Shortcuts

Interacting with apples Shortcut app:

  • use deep linking to allow users to open the shortcuts app, open a single shortcut or run a specific shortcut.

  • provide a shortcut for your app that then can be used within the ShortCut app like: MyApp - show me the latest news from "selected blog"


Things worth mentioning when working with shortcut automations:

  • automations require special permissions to run without user interaction

  • many automations won't run if the device is locked


In app automations (IOS):

You can use Background Tasks, BGTaskScheduler, UserNotifications (APNS) etc. to automate things from within your app.



In app automations (MacOS):

On macOS you can easily automate things using crontab - when the user is logged in - or launchctl if you want to be more fexible (attention for daemons are root permissions required!)



Notice:
Any kind of automation can cause security issues if it can run without user interactions, especially if it has root privileges.



Links according to this topic/answer:

  • https://developer.apple.com/documentation/sirikit/adding_user_interactivity_with_siri_shortcuts_and_the_shortcuts_app

  • https://developer.apple.com/documentation/sirikit/offering_actions_in_the_shortcuts_app

  • https://medium.com/infonity-tech/shortcut-deeplinking-for-ios-developer-64f75171c7de

  • https://medium.com/globant/integrating-siri-shortcuts-using-custom-intent-and-interface-in-ios-14-d3a84a933103

  • https://www.raywenderlich.com/6462-siri-shortcuts-tutorial-in-ios-12

  • https://github.com/a2/swift-shortcuts



SiriKit support for general services

No, you can't. That's why it says "only if your app implements one of the following types of services".

You won't get the 'find foo in bar' syntax; each respective service has its own syntax - like "start a workout in MyApp" or "Book a ride to place with MyApp". See https://developer.apple.com/sirikit/ for examples.

I would expect a workaround using the SiriKit API to result in your app being rejected if submitted to the general app store, and I would expect it to be extremely fragile if it passed App Review or didn't go through it in the first place.

Google Maps and Siri implementation

This isn't directly supported right now, without writing a third party website that Siri can hook into. According to the below linked documentation, from Apple's website, Siri on iOS 6 will support this functionality in at least limited part:

http://www.apple.com/ios/ios6/siri/

Eyes Free

Apple is working with car manufacturers to integrate Siri into select voice control systems. Through the voice command button on your steering wheel, you’ll be able to ask Siri questions without taking your eyes off the road. To minimize distractions even more, your iOS device’s screen won’t light up. With the Eyes Free feature, ask Siri to call people, select and play music, hear and compose text messages, use Maps and get directions, read your notifications, find calendar information, add reminders, and more. It’s just another way Siri helps you get things done, even when you’re behind the wheel.

This encourages me to believe that they will also expose the API (because someone will ferret it out if it exists) to normal API consumers during the iOS 6 lifecycle, probably before iOS 6.1, or with that release.

Is it possible to have Siri perform a task / action in my App?

From your linked text Google+ and Apple's Siri offer API options for developers:

...Siri, whose capabilities hinge on its use of links to non-Siri mobile apps via APIs. You don't need to tell Siri to open Fandango, for
example, you just tell it to buy movie tickets and it takes it from
there. When Siri's asked for the best slice of pizza/cup of
coffee/manicure in a user's area, it races through resources such as
Yahoo! and Yelp for answers.

The text above is confusing, it sounds like some mobile apps have an Apple blessed non public API that Siri is using. It should say instead "whose capabilities hinge on its use of links to non mobile apps via APIs".

Siri uses Yelp behind scenes to offer an equivalent functionality as the Fandango app, but it doesn't integrate with 3rd party apps. So far there is no mention of an API for Siri.



Related Topics



Leave a reply



Submit