{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":"","apiSetting":null},"next":{"description":"","pages":[]},"title":"Delaying In App Notifications","type":"basic","slug":"delaying-in-app-notifications","excerpt":"","body":"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.\n\nIn-app notifications can be delayed in the following way:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Disable in-app notifications\\n[[SailthruMobile new] setInAppNotificationsEnabled:NO]; // Call this before startEngine\\n\\n// Re-enable in-app notifications later when applicable\\n// Note: Failure to re-enable In-app notifications via this call \\n// will lead to in-app notifications never being displayed\\n[[SailthruMobile new] setInAppNotificationsEnabled:YES];\",\n      \"language\": \"objectivec\",\n      \"name\": \"iOS (Objective-C)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nSailthruMobile().setInAppNotificationsEnabled(false) // Call this before startEngine\\n\\n// Re-enable in-app notifications later when applicable\\n// Note: Failure to re-enable In-app notifications via this call \\n// will lead to in-app notifications never being displayed\\nSailthruMobile().setInAppNotificationsEnabled(true)\",\n      \"language\": \"swift\",\n      \"name\": \"iOS (Swift)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nnew SailthruMobile().setInAppNotificationsEnabled(false); // Call this before startEngine\\n\\n// Re-enable in-app notifications later when applicable\\n// Note: Failure to re-enable In-app notifications via this call \\n// will lead to in-app notifications never being displayed\\nnew SailthruMobile().setInAppNotificationsEnabled(true);\",\n      \"language\": \"java\",\n      \"name\": \"Android (Java)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nSailthruMobile().setInAppNotificationsEnabled(false) // Call this before startEngine\\n\\n// Re-enable in-app notifications later when applicable\\n// Note: Failure to re-enable In-app notifications via this call \\n// will lead to in-app notifications never being displayed\\nSailthruMobile().setInAppNotificationsEnabled(true)\",\n      \"language\": \"kotlin\",\n      \"name\": \"Android (Kotlin)\"\n    }\n  ]\n}\n[/block]","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5e6156bf5e4a51006dcd8157","parentDoc":null,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Advanced Techniques","slug":"advanced-techniques","order":6,"from_sync":false,"reference":false,"_id":"5e6156bf5e4a51006dcd8125","project":"55e67aaa9cc7c62b00c4a1ea","createdAt":"2017-02-08T21:31:11.878Z","__v":0,"version":"5e6156bf5e4a51006dcd818c"},"user":"55d29988486de50d00327118","version":{"version":"1.5","version_clean":"1.5.0","codename":"ST Rebrand","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e6156bf5e4a51006dcd8120","5e6156bf5e4a51006dcd8121","5e6156bf5e4a51006dcd8122","5e6156bf5e4a51006dcd8123","5e6156bf5e4a51006dcd8124","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","5e6156bf5e4a51006dcd8125","5e6156bf5e4a51006dcd8126","5af0fe494ca2730003cbc98a","5af0fe55ec80af0003804ca2","5e69868cbd5dcb006b35867b","5e6986ca2c6652006791b6e8"],"_id":"5e6156bf5e4a51006dcd818c","project":"55e67aaa9cc7c62b00c4a1ea","__v":2,"forked_from":"5b720760c44b7600034b7a08","createdAt":"2015-09-02T04:27:23.612Z","releaseDate":"2015-09-02T04:27:23.612Z"},"githubsync":"","project":"55e67aaa9cc7c62b00c4a1ea","__v":3,"createdAt":"2015-11-20T15:38:14.479Z"}

Delaying 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: [block:code] { "codes": [ { "code": "// Disable in-app notifications\n[[SailthruMobile new] setInAppNotificationsEnabled:NO]; // Call this before startEngine\n\n// Re-enable in-app notifications later when applicable\n// Note: Failure to re-enable In-app notifications via this call \n// will lead to in-app notifications never being displayed\n[[SailthruMobile new] setInAppNotificationsEnabled:YES];", "language": "objectivec", "name": "iOS (Objective-C)" }, { "code": "// Disable in-app notifications\nSailthruMobile().setInAppNotificationsEnabled(false) // Call this before startEngine\n\n// Re-enable in-app notifications later when applicable\n// Note: Failure to re-enable In-app notifications via this call \n// will lead to in-app notifications never being displayed\nSailthruMobile().setInAppNotificationsEnabled(true)", "language": "swift", "name": "iOS (Swift)" }, { "code": "// Disable in-app notifications\nnew SailthruMobile().setInAppNotificationsEnabled(false); // Call this before startEngine\n\n// Re-enable in-app notifications later when applicable\n// Note: Failure to re-enable In-app notifications via this call \n// will lead to in-app notifications never being displayed\nnew SailthruMobile().setInAppNotificationsEnabled(true);", "language": "java", "name": "Android (Java)" }, { "code": "// Disable in-app notifications\nSailthruMobile().setInAppNotificationsEnabled(false) // Call this before startEngine\n\n// Re-enable in-app notifications later when applicable\n// Note: Failure to re-enable In-app notifications via this call \n// will lead to in-app notifications never being displayed\nSailthruMobile().setInAppNotificationsEnabled(true)", "language": "kotlin", "name": "Android (Kotlin)" } ] } [/block]