Handle push notifications
Route notifications using sender
senderfunc application(
_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable : Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
) {
let sender = userInfo["sender"] as? String
Task {
do {
switch sender {
case "CPS":
// Digital card operations (LCM).
// Call the SDK notification handler. See `NotificationService` in the API reference.
break
case "TNS":
// Transaction notifications.
// Refresh transaction history. See `TransactionHistoryService` in the API reference.
break
case "MG":
// Key replenishment triggered by the TSP.
// Trigger replenishment. See `ReplenishmentService` in the API reference.
break
default:
// Non-SDK notifications.
break
}
completionHandler(.newData)
} catch {
completionHandler(.failed)
}
}
}Process CPS notifications (digital card operations)
Server message
Process TNS notifications (transactions)
Process MG notifications (replenishment)
Last updated
Was this helpful?