{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"In App Notifications - Android Pulsate SDK","type":"basic","slug":"in-app-notifications-android-pulsate-sdk","excerpt":"","body":"The Android Pulsate SDK comes with methods that allow Developers to change how In App Notifications work.\n[block:api-header]\n{\n  \"title\": \"Enabling / Disabling In App Notifications\"\n}\n[/block]\nTo Enable / Disable In App Notifications use the \"*setInAppNotificationEnabled(boolean enabled)*\" method. This setting is per alias, different aliases can have different values. By default In App Notificatons are enabled.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager.startPulsateSessionForAlias(ALIAS, new IPulsateRequestListener() {\\n  :::at:::Override\\n  public void onSucess() {\\n    pulsateManager.setInAppNotificationEnabled(true/false);\\n  }\\n\\n  @Override\\n  public void onError(Throwable e) {\\n\\n  }\\n});\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nIf you want to check if users have In App Notifications Enabled or Disabled use the \"*isInAppNotificationEnabled()*\" method.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"pulsateManager.isInAppNotificationEnabled(new IPulsateValueListener<Boolean>() {\\n  @Override\\n  public void onSuccess(Boolean isEnabled) {\\n    if (isEnabled) {\\n      // Do Something\\n    } else {\\n      // Do Something\\n    }\\n  }\\n\\n  @Override\\n  public void onError(Throwable e) {\\n  }\\n});\\n\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Show the last In App Notification\"\n}\n[/block]\nFor cases where you want to block an In App Notification and show it later you can disable In App Notifications using \"*setInAppNotificationEnabled(false)*\" and later call \"*setInAppNotificationEnabled(true)*\" with \"*showLastInAppNotification()*\" to show it. Example usecase - user needs to give password before being able to see In App Notification.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Before Login\\npulsateManager.setInAppNotificationEnabled(false);\\n\\n// After Login\\npulsateManager.setInAppNotificationEnabled(true);\\npulsateManager.showLastInAppNotification();\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Configuring Small In App Notification Duration\"\n}\n[/block]\nSmall In App Notifications by default are visible 12secs if you need them to be visible longer or shorter use the \"*setSmallInAppNotificationDuration(int seconds)*\" method.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Set Duration to 30secs\\npulsateManager.setSmallInAppNotificationDuration(30);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]","updates":[],"order":6,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5e5019b49e8f240011cc6ad7","project":"54aa7f773b56130b0056c86e","version":{"version":"2.8","version_clean":"2.8.0","codename":"Android SDK","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e5019b49e8f240011cc6a47","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","5e5019b49e8f240011cc6a48","5e5019b49e8f240011cc6a49","5e5019b49e8f240011cc6a4a","5e5019b49e8f240011cc6a4b","5e5019b49e8f240011cc6a4c","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","5e5019b49e8f240011cc6a4d","5e5019b49e8f240011cc6a4e","5c73dd27e8fdc000572a206a","5e5019b49e8f240011cc6a4f","5e501b7e7c8bdc00450ea66a","5e53daa9884b750025b5cad4"],"_id":"5e5019b49e8f240011cc6ade","project":"54aa7f773b56130b0056c86e","forked_from":"5e4fbbbda8fb41028f1861fe","__v":2,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["5e5019b49e8f240011cc6a55","5e5019b49e8f240011cc6a56","5e5019b49e8f240011cc6a57","5e5019b49e8f240011cc6a58","5e5019b49e8f240011cc6a59","5e5019b49e8f240011cc6a5a","5e5019b49e8f240011cc6a5b","5e5019b49e8f240011cc6a5c","5e5019b49e8f240011cc6a5d","5e5019b49e8f240011cc6a5e","5e5019b49e8f240011cc6a68","5e5019b49e8f240011cc6a6b","5e5019b49e8f240011cc6a71","5e5019b49e8f240011cc6a73","5e5019b49e8f240011cc6a7e","5e5019b49e8f240011cc6a80","5e5019b49e8f240011cc6a81","5e5019b49e8f240011cc6a82","5e5019b49e8f240011cc6a84"],"title":"Android SDK","slug":"android-sdk","order":1,"from_sync":false,"reference":false,"_id":"5e5019b49e8f240011cc6a49","version":"5e5019b49e8f240011cc6ade","__v":10,"project":"54aa7f773b56130b0056c86e","createdAt":"2015-01-05T12:44:00.338Z"},"user":"57bc3654b9c7f0220009c77b","createdAt":"2019-04-10T12:18:00.909Z","__v":0,"parentDoc":null}

In App Notifications - Android Pulsate SDK


The Android Pulsate SDK comes with methods that allow Developers to change how In App Notifications work. [block:api-header] { "title": "Enabling / Disabling In App Notifications" } [/block] To Enable / Disable In App Notifications use the "*setInAppNotificationEnabled(boolean enabled)*" method. This setting is per alias, different aliases can have different values. By default In App Notificatons are enabled. [block:code] { "codes": [ { "code": "pulsateManager.startPulsateSessionForAlias(ALIAS, new IPulsateRequestListener() {\n @Override\n public void onSucess() {\n pulsateManager.setInAppNotificationEnabled(true/false);\n }\n\n @Override\n public void onError(Throwable e) {\n\n }\n});", "language": "java" } ] } [/block] If you want to check if users have In App Notifications Enabled or Disabled use the "*isInAppNotificationEnabled()*" method. [block:code] { "codes": [ { "code": "pulsateManager.isInAppNotificationEnabled(new IPulsateValueListener<Boolean>() {\n @Override\n public void onSuccess(Boolean isEnabled) {\n if (isEnabled) {\n // Do Something\n } else {\n // Do Something\n }\n }\n\n @Override\n public void onError(Throwable e) {\n }\n});\n", "language": "java" } ] } [/block] [block:api-header] { "title": "Show the last In App Notification" } [/block] For cases where you want to block an In App Notification and show it later you can disable In App Notifications using "*setInAppNotificationEnabled(false)*" and later call "*setInAppNotificationEnabled(true)*" with "*showLastInAppNotification()*" to show it. Example usecase - user needs to give password before being able to see In App Notification. [block:code] { "codes": [ { "code": "// Before Login\npulsateManager.setInAppNotificationEnabled(false);\n\n// After Login\npulsateManager.setInAppNotificationEnabled(true);\npulsateManager.showLastInAppNotification();", "language": "java" } ] } [/block] [block:api-header] { "title": "Configuring Small In App Notification Duration" } [/block] Small In App Notifications by default are visible 12secs if you need them to be visible longer or shorter use the "*setSmallInAppNotificationDuration(int seconds)*" method. [block:code] { "codes": [ { "code": "// Set Duration to 30secs\npulsateManager.setSmallInAppNotificationDuration(30);", "language": "java" } ] } [/block]