{"_id":"5caddef814f2cf004422dc6e","project":"54aa7f773b56130b0056c86e","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":8,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z","categories":["55781fe35129590d003ff4f8","55781fe35129590d003ff4f9","55781fe35129590d003ff4fa","55781fe35129590d003ff4fb","55781fe35129590d003ff4fc","55781fe35129590d003ff4fd","55781fe35129590d003ff4fe","564bbc7e8841060d00abb2ee","565b66c446118c0d00dcb0bb","56898269f8dc340d00308c13","582318b23b961a0f009516a1","594a848c9f4771001a43c959","5c73dd27e8fdc000572a206a","5c77ac5af94a920045cb80ca"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"55781fe35129590d003ff4fc","pages":["55781fe45129590d003ff50d","55781fe45129590d003ff50e","55781fe45129590d003ff50f","55781fe45129590d003ff510","55781fe45129590d003ff511","55781fe45129590d003ff512","55781fe45129590d003ff513","55781fe45129590d003ff514","55781fe45129590d003ff515","55781fe45129590d003ff516","55f692b4fe4cce21005c78b0","55f7e91e60cc850d008a7a45","56333cab9c607719001b85e4","564462ed9ce94c0d00068ce9","564f54fa48a1df1700836653","565ee9e7413e06170093dde0","5661a8fdb401c70d00dde6fa","5671348860c8e70d006c96a1","568ce9707d3bf02300aa7734"],"version":"55781fe25129590d003ff4f7","__v":10,"project":"54aa7f773b56130b0056c86e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-05T12:44:00.338Z","from_sync":false,"order":4,"slug":"android-sdk","title":"Android SDK"},"user":"57bc3654b9c7f0220009c77b","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-04-10T12:18:00.909Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"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\": \"boolean isEnabled = pulsateManager.isInAppNotificationEnabled();\\nif (isEnabled) {\\n\\t// Do Something\\n} else {\\n\\t// Do Something\\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]","excerpt":"","slug":"in-app-notifications-android-pulsate-sdk","type":"basic","title":"In App Notifications - Android Pulsate SDK"}

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": "boolean isEnabled = pulsateManager.isInAppNotificationEnabled();\nif (isEnabled) {\n\t// Do Something\n} else {\n\t// Do Something\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]