Delay In-App Notifications

You may want to disable in-app notifications on a login or onboarding screen. In-app notifications can be detrimental to the overall user experience or irrelevant when on such screens. In-app notifications can be delayed in the following way:

iOS (Objective-C)

// Disable in-app notifications
[[SailthruMobile new] setInAppNotificationsEnabled:NO]; // Call this before startEngine

// Re-enable in-app notifications later when applicable
// Note: Failure to re-enable In-app notifications via this call 
// will lead to in-app notifications never being displayed
[[SailthruMobile new] setInAppNotificationsEnabled:YES];

iOS (Swift)

// Disable in-app notifications
SailthruMobile().setInAppNotificationsEnabled(false) // Call this before startEngine

// Re-enable in-app notifications later when applicable
// Note: Failure to re-enable In-app notifications via this call 
// will lead to in-app notifications never being displayed
SailthruMobile().setInAppNotificationsEnabled(true)

Android (Java)

// Disable in-app notifications
new SailthruMobile().setInAppNotificationsEnabled(false); // Call this before startEngine

// Re-enable in-app notifications later when applicable
// Note: Failure to re-enable In-app notifications via this call 
// will lead to in-app notifications never being displayed
new SailthruMobile().setInAppNotificationsEnabled(true);

Android (Kotlin)

// Disable in-app notifications
SailthruMobile().setInAppNotificationsEnabled(false) // Call this before startEngine

// Re-enable in-app notifications later when applicable
// Note: Failure to re-enable In-app notifications via this call 
// will lead to in-app notifications never being displayed
SailthruMobile().setInAppNotificationsEnabled(true)

Contact us

Top