I finished SiriKit Payment Intent app.
Now I am working on 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. But I have problem with watchOS app.
I developed the intent and handler. When I ask Siri
Using CoolPay send Albert $40
Siri replies…
Sorry I can't do that.
, and gives a button Open CoolPay
I saw some posts saying Payment Intent for Siri is not available on watchOS. But I see the intent is available on watchOS. 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. What I can tell is… the same framework and the same call backs works for iPhone Siri though.