Push Notification: Integrate Double Opt-In for iOS

Learn to integrate Double Opt-In & Double Opt-Out for iOS.

Overview

The Opt-In and Opt-Out APIs enable developers to integrate user consent management functionality into their iOS apps. This ensures user preferences are synced with backend systems for compliance and personalized engagement.


iOS Integration Steps

Follow these steps to integrate Opt-In and Opt-Out for your iOS app.


1. Update Double Opt-In URLs and Intervals

Add the required URLs and intervals for double opt-in notifications in your app’s Info.plist.

<!-- For Smartech -->
<key>SmartechKeys</key>
<dict>
    <key>SMT_OPT_IN_1_URL</key>
    <string><Add your url for opt-in 1></string>
    <key>SMT_OPT_IN_2_URL</key>
    <string><Add your url for opt-in 2></string>
    <key>SMT_OPT_IN_1_INTERVAL</key>
    <string>2</string>
    <key>SMT_OPT_IN_2_INTERVAL</key>
    <string>2</string>
</dict>
<!-- End Smartech -->

📘

Note

Intervals are measured in days.


2. Initiate Double Opt-In

To trigger the double opt-in flow, integrate the following method at the desired point in your app:

[[SmartPush sharedInstance] initiateNotificationDoubleOptIn];
SmartPush.sharedInstance().initiateNotificationDoubleOptIn()

3. Advanced Double Opt-In Controls (Optional)

Show Double Opt-In Instantly

To display the double opt-in prompt immediately:

[[SmartPush sharedInstance] showInstantNotificationDoubleOptIn];
SmartPush.sharedInstance().showInstantNotificationDoubleOptIn()

Reset Double Opt-In Intervals

To reset the intervals and re-trigger the double opt-in process:

[[SmartPush sharedInstance] resetNotificationDoubleOptIn];
SmartPush.sharedInstance().resetNotificationDoubleOptIn()

JavaScript Integration Steps

Refer to this document for JavaScript integration to integrate Opt-In and Opt-Out.