Browse files

WIP prediction activity eligibility

  • Loading branch information...
marcpalmer committed Jun 5, 2018
1 parent afcbc40 commit 9261653d9fc1b9a3a08a1b52a6ee9d89d8aad383
@@ -19,10 +19,13 @@ public enum ActivityEligibility {
case handoff
/// Specify this to also register for Spotlight search when the activity is published.
/// - note: This is unusual. Normally you will index items for spotlight using Spotlight APIs.
/// - note: Normally you will index items for spotlight using Spotlight APIs.
case search
/// Specify this if the activity refers to publicly accessible content that should be indexed.
/// - note: This requires a public web URL is set on the activity
case publicIndexing
/// Allow the activity to qualify for Siri prediction
case prediction
@@ -46,6 +46,12 @@ final class PublishCurrentActionActivityAction: Action {
activity.isEligibleForHandoff = activityTypes.contains(.handoff)
activity.isEligibleForPublicIndexing = activityTypes.contains(.publicIndexing)
#if os(iOS) || os(watchOS)
if #available(iOS 12, watchOS 5, *) {
activity.isEligibleForPrediction = activityTypes.contains(.prediction)
// If the action provides some extra data, use this. Note that the prepareFunction has already been
// essentially "curried" to capture the original `input` of the action being published.
guard let preparedActivity = context.input.prepareFunction(activity) else {

0 comments on commit 9261653

Please sign in to comment.