Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.

Handle push tokens

Register for push notifications

Register APNs and FCM

The example below shows a typical iOS setup:

  • Configure Firebase.

  • Request notification permissions.

  • Register with APNs.

  • Provide the APNs token to Firebase Messaging.

FCM configuration (Firebase project setup, entitlements, APNs key, and so on) is out of scope for this guide.

For setup details, see FCM Introduction, FCM Architectural Overview and About FCM messages.

Register APNs and FCM
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        // ...
        
        // Use Firebase library to configure APIs
        FirebaseApp.configure()

        // Register user notification 
        let settings: UIUserNotificationSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
        application.registerUserNotificationSettings(settings)
      
        // Firebase register 
        Messaging.messaging().delegate = self
        // Register for Remote Notification 
        application.registerForRemoteNotifications()
        return true
}

Update the push token in NFC Wallet

The push token can change (for example, after an app reinstall or when Firebase refreshes the token). When this happens, your digital wallet application must notify the NFC Wallet SDK by calling NotificationService.updatePushToken.

The NFC Wallet SDK detects when the token is unchanged and avoids unnecessary calls to the NFC Wallet backend.

Last updated

Was this helpful?