Push Provisioning
Step 1: Showing the Add to Wallet button
import WatchConnectivity
class ViewController: UIViewController, TPCSDKProvisionDelegate, WCSessionDelegate {
// To store the isWatchPaired value before calling TPC function
var isWatchPaired = false
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
if WCSession.isSupported() {
let session = WCSession.default
session.delegate = self
session.activate()
}
}
// MARK: WCSessionDelegate
func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
if error != nil {
//handle error
} else if activationState == .activated && session.isPaired {
isWatchPaired = true
}
}
func sessionDidBecomeInactive(_ session: WCSession) {
// handle sessionDidBecomeInactive
isWatchPaired = false
}
func sessionDidDeactivate(_ session: WCSession) {
// handle sessionDidDeactivate
isWatchPaired = false
}
}
Note
Caution
Step 2: Provision a card
Warning
Provisioning with standard scheme enum values for Visa, Mastercard, Amex, and Discover
Provisioning with a scheme string (standard)
Last updated
Was this helpful?