3.2.2. Click Counts for Mobile Push Notifications

Custom Setup Guide

🚧

Before you begin, make sure you’ve completed these steps:

👍

By the end of this guide, you should see the following result:

You can send a mobile push notification from Mindbox and it is displayed on the target device. Once a notification is tapped, its system status changes to "Clicked."

To check that clicks are being detected, please use this guide.

1. Submitting push notification click counts

Find the userNotificationCenter.didReceive method (or create it) in the AppDelegate.swift file and call Mindbox.shared.pushClicked from this method.

//
//  AppDelegate.swift
//  Sample
//
//  Created by Peter Nikitin on 06.04.2022.
//

import Foundation
import Mindbox
import UIKit

class AppDelegate: UIResponder, UIApplicationDelegate {
        
    ...

    func userNotificationCenter(
    _ center: UNUserNotificationCenter, 
    didReceive response: UNNotificationResponse, 
    withCompletionHandler completionHandler: @escaping () -> Void) {
    Mindbox.shared.pushClicked(response: response)
    completionHandler()
  }
      
    ...

}

2. App navigation

By default, a click opens the app’s main screen.

The SDK does not yet support cases where you need to open a different screen for the customer in your app.

👍

Check your results:

You can send a mobile push notification from Mindbox and it is displayed on the target device. Once a notification is tapped, its system status changes to "Clicked."

To check that clicks are being detected, please use this guide.