I need to finish watchOS sirikit payment app (as a companion app for the iPhone app obviously). The same framework, logic for intent and handler are working on iOS.
I developed the intent and handler. When I ask Siri the below sentence,
using MyApp send Albert $40
Siri replies...
Sorry I can't do that. and give a button Open MyApp
I saw some posts saying Payment Intent for Siri is not available on watchOS. But I see this in SDK. Please give pointers.
@available(watchOS 3.2, *)
open class INSendPaymentIntent : INIntent {
public init(payee: INPerson?, currencyAmount: INCurrencyAmount?, note: String?)
@NSCopying open var payee: INPerson? { get }
@NSCopying open var currencyAmount: INCurrencyAmount? { get }
open var note: String? { get }
}
The Plists and projects have right permissions and capabilities. Payment Intent Plist has the below keys. Image Link for Plist Keys for Payment Intent
// WatchIntentsExtension.swift
import Intents
import PaymentsFrameworkWatchOS
class WatchIntentsExtension: INExtension {
let paymentProvider = PaymentProvider()
let contactLookup = ContactLookup()
override func handler(for intent: INIntent) -> Any? {
print("Watch Overriding")
guard intent is INSendPaymentIntent else { fatalError("Unhandled intent type \(intent)") }
return WatchSendPaymentIntentHandler(paymentProvider: paymentProvider, contactLookup: contactLookup)
}
}
I cannot post code for Handler
as I have compliance issues. And... I do not do much on there.
The same code works for iPhone Siri though.