{"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[Carnival 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[Carnival setInAppNotificationsEnabled:YES];\",\n      \"language\": \"objectivec\",\n      \"name\": \"iOS (Objective-C)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nCarnival.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\\nCarnival.setInAppNotificationsEnabled(true)\",\n      \"language\": \"swift\",\n      \"name\": \"iOS (Swift)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nCarnival.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\\nCarnival.setInAppNotificationsEnabled(true);\",\n      \"language\": \"java\",\n      \"name\": \"Android (Java)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nCarnival.setDisplayInAppNotifications(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\\nCarnival.setDisplayInAppNotifications(true);\",\n      \"language\": \"javascript\",\n      \"name\": \"Cordova (JavaScript)\"\n    },\n    {\n      \"code\": \"// Disable in-app notifications\\nCarnival.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\\nCarnival.SetInAppNotificationsEnabled(true);\",\n      \"language\": \"csharp\",\n      \"name\": \"Unity (C#)\"\n    }\n  ]\n}\n[/block]","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5b1f2cbdfd653400031d8d79","parentDoc":null,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Advanced Techniques","slug":"advanced-techniques","order":7,"from_sync":false,"reference":false,"_id":"5b1f2cbdfd653400031d8d47","project":"55e67aaa9cc7c62b00c4a1ea","createdAt":"2017-02-08T21:31:11.878Z","__v":0,"version":"5b1f2cbdfd653400031d8d9f"},"user":"55d29988486de50d00327118","version":{"version":"1.3","version_clean":"1.3.0","codename":"rebrand","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5b1f2cbdfd653400031d8d42","5b1f2cbdfd653400031d8d43","5b1f2cbdfd653400031d8d44","5b1f2cbdfd653400031d8d45","5b1f2cbdfd653400031d8d46","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","5b1f2cbdfd653400031d8d47","5b1f2cbdfd653400031d8d48","5af0fe494ca2730003cbc98a","5af0fe55ec80af0003804ca2"],"_id":"5b1f2cbdfd653400031d8d9f","project":"55e67aaa9cc7c62b00c4a1ea","__v":0,"forked_from":"55e67aab9cc7c62b00c4a1ed","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[Carnival 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[Carnival setInAppNotificationsEnabled:YES];", "language": "objectivec", "name": "iOS (Objective-C)" }, { "code": "// Disable in-app notifications\nCarnival.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\nCarnival.setInAppNotificationsEnabled(true)", "language": "swift", "name": "iOS (Swift)" }, { "code": "// Disable in-app notifications\nCarnival.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\nCarnival.setInAppNotificationsEnabled(true);", "language": "java", "name": "Android (Java)" }, { "code": "// Disable in-app notifications\nCarnival.setDisplayInAppNotifications(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\nCarnival.setDisplayInAppNotifications(true);", "language": "javascript", "name": "Cordova (JavaScript)" }, { "code": "// Disable in-app notifications\nCarnival.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\nCarnival.SetInAppNotificationsEnabled(true);", "language": "csharp", "name": "Unity (C#)" } ] } [/block]