Not receiving push notifications in iOS after registering tokem

I am trying to receive push notifications when a user writes a message in a channel. I have managed to register the user for these kind of notifications with the registerDevicePushToken function:

            SBDMain.connect(withUserId: preferences.getUserEmail()!, completionHandler:
            { (user, error) in
                if (error == nil) {
                    Messaging.messaging().apnsToken = deviceToken
                    SBDMain.registerDevicePushToken(deviceToken, unique: false, completionHandler: { (status, error) in
                        if error == nil {
                            if status == SBDPushTokenRegistrationStatus.pending {
                                SBDMain.connect(withUserId: preferences.getUserEmail()!, completionHandler: { (user, error) in
                                    if error == nil {
                                        SBDMain.registerDevicePushToken(SBDMain.getPendingPushToken()!, unique: true, completionHandler: { (status, error) in

                                        })
                                    }
                                })
                            }
                            else {
                            print("Success")
                                SBDMain.setPushTriggerOption(.all)
                            }
                        }
                        else {
                            print("Error")
                            print(error)
                            return
                        }
                    })
                }
            })

Nevertheless, after doing this, I can’t manage to receive the said notifications even when the app is running in the background. The user does receive the messages of the channel while in chat. I do receive other kind of push notifications, but when the Sendbird notification should be received, I don’t get any response from the app (neither in the userNotificationCenter functions nor in the application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)).

Used Versions:

  • Xcode 13.0
  • OS 13.5
  • SendBirdSDK (3.1.13)

Hello @_ktng,

Welcome to the Sendbird Community.

Can you send me your Application ID via DM? I’ll take a look at logging and see what I can tell. Is there any possibility that the user you’re testing with is connected to the SDK via another method, such as the web?

Resolved by ensuring the bundle_id of the application is the same as the bundle_id of the APNS certificate.

1 Like