[iOS] Push tracking events are not working

[Problem/Question]
The push tracking events (delivered, clicked) are called normally, but there is no change in the Log and Analysis tabs on the dashboard.

[SDK Version]
sendbird-chat-sdk-ios / 4.19.5

[Reproduction Steps]

  1. Push notifications are delivered successfully with under codes.
  // AppDeleate
  func application(
    _: UIApplication,
    didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil
  ) -> Bool {

    let initParams = InitParams(
      applicationId: Constants.sendbirdAppId,
      isLocalCachingEnabled: true,
      logLevel: .info,
      needsSynchronous: false
    )
    SendbirdChat.initialize(
      params: initParams,
      migrationStartHandler: {
        // Logging
      },
      completionHandler: { error in
        // Logging
        SendbirdChat.setAppGroup(Constants.AppGroudId)
      }
    )
    SendbirdChat.setSessionDelegate(SendbirdService.shared)
     // ...
  }

  func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
      SendbirdChat.executeOrWaitForInitialization {
         SendbirdChat.registerDevicePushToken(deviceToken, unique: false) { 
             // ...
         }
      }
      // ...
   }
  1. And I tried to track delivered event using NotificationServiceExtension and markPushNotificationAsDelivered function.
      SendbirdChat.markPushNotificationAsDelivered(
        remoteNotificationPayload: bestAttemptContent.userInfo
      ) { error in
        print(error) // return nil
      }

The completionHandler returns nil and I expected logging to be successful. However, there is no change in the Log and Analysis tabs on the dashboard.

  1. I’m also tried to track clicked event using under codes with markPushNotificationAsClicked function.
func userNotificationCenter(
    _: UNUserNotificationCenter,
    didReceive response: UNNotificationResponse,
    withCompletionHandler _: @escaping () -> Void
  ) {
    let userInfo = response.notification.request.content.userInfo
    let sendbird = userInfo["sendbird"] as? [String: Any]
    let notificationPushData = sendbird?["notification_push_data"] as? [String: Any]
    if let url = notificationPushData?["url"] as? String, let url = URL(string: url) {
      WebService.shared.currentURL = url.absoluteString
    }
    SendbirdChat.markPushNotificationAsClicked(remoteNotificationPayload: userInfo) { error in
        print(error) // return nil
    }
  }

The completionHandler returns nil again, but there is no change in the Log and Analysis tabs on the dashboard.

  1. I assumed several reasons.
  • It’s because I missed some settings should be done.
  • It’s because I’m currently using a free trial plan.
  • It’s because I tested it with an app built on xcode, not the app store.
  1. So, how to fix this behaviors?

[Frequency]
Always.

[Current impact]
Can’t track any push events.

Hi @Berry_Kim,

Are you using these events with Sendbird Business Messaging?

Yes I’m using Sendbird Business Messaging.

Thank you for confirming. It seems like there is a need for a larger conversation. Can you please open a case with our support team by emailing support@sendbird.com ? I’ll assist you more directly there.

Thank you

1 Like