{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Pulsate Inbox","type":"basic","slug":"configuring-the-pulsate-inbox","excerpt":"","body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Showing the Inbox\"\n}\n[/block]\nOne of the core parts of the Pulsate SDK is the Pulsate inbox. The message inbox is a fully featured interface that sits directly within your mobile App, it allows incoming campaign and conversation content to be rendered to your customers. It also allows customers to compose new messages directly to you.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/sPxtQHQM2UeYHF5rw35w_Screen%20Shot%202015-03-05%20at%2014.51.12.png\",\n        \"Screen Shot 2015-03-05 at 14.51.12.png\",\n        \"651\",\n        \"1016\",\n        \"#158ab8\",\n        \"\"\n      ],\n      \"caption\": \"\"\n    }\n  ]\n}\n[/block]\nIn order to show the Feed / Inbox simply call the showFeed() method of the Pulsate SDK:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"//Starts a new activity to show the Feed\\nmanager.showFeed();\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nThe piece of code above will show the message inbox.\n\nThe message inbox can be closed by tapping on the *Back Button*.\n\nThe list of messages are fetched from the Pulsate server and cached locally for offline reading. Pulsate also offers campaign distribution to allow you to send custom campaigns via the message inbox.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Getting the amount of unread messages\"\n}\n[/block]\nYou can easily get the amount of unread messages using the *setUnreadCountUpdateListener* method. \n\nYou need to pass an *IPulsateUnreadCountUpdateListener* to the method. The listener has a callback named *onUnreadCountUpdate* - this callback returns the number of unread messages.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"manager.setUnreadCountUpdateListener(new IPulsateUnreadCountUpdateListener() {\\n  :::at:::Override\\n  public void onUnreadCountUpdate(int unread) {\\n\\n  }\\n});\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Enabling / Disabling users from creating new Threads\"\n}\n[/block]\nThe Floating Action Button in the Feed allows users to create threads and send feedback from the App to Pulsate. By default this button is enabled, if you want to disable it all you need to do is call \"*setNewThreadButtonEnabled(false)*\". Make sure to call it in the onCreate methd of your Application.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public class PulsateUniversalApp extends Application {\\n    @Override\\n    public void onCreate() {\\n        super.onCreate();\\n        IPulsateManager pulsateManager = PulsateFactory.getInstance();\\n        pulsateManager.setNewThreadButtonEnabled(false);\\n    }\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Adding custom button to Toolbar\"\n}\n[/block]\nWith the release of version 2.13.14 Developers can now add an additional button in the Pulsate Feed. The button will appear in the main Feed Toolbar in the right corner.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e3c5b45-Screenshot_20190304-162115.png\",\n        \"Screenshot_20190304-162115.png\",\n        1080,\n        1920,\n        \"#2e261d\"\n      ]\n    }\n  ]\n}\n[/block]\nTo add this button you need to add a new drawable called \"ic_pulsate_inbox_toolbar_right_button\" and call the *setOnInboxRightButtonClickListener* method and pass an *OnClickListener*. This should be done in the Application class under *onCreate()*.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public class PulsateUniversalApp extends Application {\\n    @Override\\n    public void onCreate() {\\n        super.onCreate();\\n        IPulsateManager pulsateManager = PulsateFactory.getInstance();\\n        pulsateManager.setOnInboxRightButtonClickListener(new View.OnClickListener() {\\n          @Override\\n          public void onClick(View v) {\\n          }\\n        });\\n    }\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"User Avatar Customization\"\n}\n[/block]\nThe user avatar by default is set to use the user initials when possible, when not available the user avatar will be an anonymous icon. With the release of version 2.13.14 Developers can now disable showing initials as the user avatar, this will cause the avatar to be the anonymous icon even if FirstName and LatName are set. This can be done by calling the new *useInitialsForUserAvatar* method. This should be done in the Application class under *onCreate()*.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public class PulsateUniversalApp extends Application {\\n    @Override\\n    public void onCreate() {\\n        super.onCreate();\\n        IPulsateManager pulsateManager = PulsateFactory.getInstance();\\n        pulsateManager.useInitialsForUserAvatar(false);\\n    }\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Color / String Customization\"\n}\n[/block]\nYou can easily change the colors and strings in the inbox.\n\nTo learn more about customizing the strings check this link - https://pulsate.readme.io/v2.8/docs/sdk-language-localization.\n\nTo learn more about customizing the colors check this link - https://pulsate.readme.io/v2.8/docs/custom-theming-the-pulsate-sdk-1.","updates":[],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5f2ab295a056fc06ae8cb169","createdAt":"2020-08-05T13:22:29.435Z","user":"57bc3654b9c7f0220009c77b","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"SDK Basic","slug":"sdk-basic","order":2,"from_sync":false,"reference":false,"_id":"5f2ab1e9448d87068b348f9c","createdAt":"2020-08-05T13:19:37.517Z","version":"5e5019b49e8f240011cc6ade","project":"54aa7f773b56130b0056c86e","__v":0},"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","5f2ab0dfbf70f7063ad0c4f3","5f2ab1e9448d87068b348f9c","5f2ab1f9c1644603559149ac","5f2ab205bc35e507e8cead35"],"_id":"5e5019b49e8f240011cc6ade","project":"54aa7f773b56130b0056c86e","forked_from":"5e4fbbbda8fb41028f1861fe","__v":6,"createdAt":"2015-06-10T11:30:42.700Z","releaseDate":"2015-06-10T11:30:42.700Z"},"project":"54aa7f773b56130b0056c86e","__v":0,"parentDoc":null}
[block:api-header] { "type": "basic", "title": "Showing the Inbox" } [/block] One of the core parts of the Pulsate SDK is the Pulsate inbox. The message inbox is a fully featured interface that sits directly within your mobile App, it allows incoming campaign and conversation content to be rendered to your customers. It also allows customers to compose new messages directly to you. [block:image] { "images": [ { "image": [ "https://files.readme.io/sPxtQHQM2UeYHF5rw35w_Screen%20Shot%202015-03-05%20at%2014.51.12.png", "Screen Shot 2015-03-05 at 14.51.12.png", "651", "1016", "#158ab8", "" ], "caption": "" } ] } [/block] In order to show the Feed / Inbox simply call the showFeed() method of the Pulsate SDK: [block:code] { "codes": [ { "code": "//Starts a new activity to show the Feed\nmanager.showFeed();", "language": "java" } ] } [/block] The piece of code above will show the message inbox. The message inbox can be closed by tapping on the *Back Button*. The list of messages are fetched from the Pulsate server and cached locally for offline reading. Pulsate also offers campaign distribution to allow you to send custom campaigns via the message inbox. [block:api-header] { "type": "basic", "title": "Getting the amount of unread messages" } [/block] You can easily get the amount of unread messages using the *setUnreadCountUpdateListener* method. You need to pass an *IPulsateUnreadCountUpdateListener* to the method. The listener has a callback named *onUnreadCountUpdate* - this callback returns the number of unread messages. [block:code] { "codes": [ { "code": "manager.setUnreadCountUpdateListener(new IPulsateUnreadCountUpdateListener() {\n @Override\n public void onUnreadCountUpdate(int unread) {\n\n }\n});", "language": "java" } ] } [/block] [block:api-header] { "title": "Enabling / Disabling users from creating new Threads" } [/block] The Floating Action Button in the Feed allows users to create threads and send feedback from the App to Pulsate. By default this button is enabled, if you want to disable it all you need to do is call "*setNewThreadButtonEnabled(false)*". Make sure to call it in the onCreate methd of your Application. [block:code] { "codes": [ { "code": "public class PulsateUniversalApp extends Application {\n @Override\n public void onCreate() {\n super.onCreate();\n IPulsateManager pulsateManager = PulsateFactory.getInstance();\n pulsateManager.setNewThreadButtonEnabled(false);\n }\n}", "language": "java" } ] } [/block] [block:api-header] { "title": "Adding custom button to Toolbar" } [/block] With the release of version 2.13.14 Developers can now add an additional button in the Pulsate Feed. The button will appear in the main Feed Toolbar in the right corner. [block:image] { "images": [ { "image": [ "https://files.readme.io/e3c5b45-Screenshot_20190304-162115.png", "Screenshot_20190304-162115.png", 1080, 1920, "#2e261d" ] } ] } [/block] To add this button you need to add a new drawable called "ic_pulsate_inbox_toolbar_right_button" and call the *setOnInboxRightButtonClickListener* method and pass an *OnClickListener*. This should be done in the Application class under *onCreate()*. [block:code] { "codes": [ { "code": "public class PulsateUniversalApp extends Application {\n @Override\n public void onCreate() {\n super.onCreate();\n IPulsateManager pulsateManager = PulsateFactory.getInstance();\n pulsateManager.setOnInboxRightButtonClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n }\n });\n }\n}", "language": "java" } ] } [/block] [block:api-header] { "title": "User Avatar Customization" } [/block] The user avatar by default is set to use the user initials when possible, when not available the user avatar will be an anonymous icon. With the release of version 2.13.14 Developers can now disable showing initials as the user avatar, this will cause the avatar to be the anonymous icon even if FirstName and LatName are set. This can be done by calling the new *useInitialsForUserAvatar* method. This should be done in the Application class under *onCreate()*. [block:code] { "codes": [ { "code": "public class PulsateUniversalApp extends Application {\n @Override\n public void onCreate() {\n super.onCreate();\n IPulsateManager pulsateManager = PulsateFactory.getInstance();\n pulsateManager.useInitialsForUserAvatar(false);\n }\n}", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Color / String Customization" } [/block] You can easily change the colors and strings in the inbox. To learn more about customizing the strings check this link - https://pulsate.readme.io/v2.8/docs/sdk-language-localization. To learn more about customizing the colors check this link - https://pulsate.readme.io/v2.8/docs/custom-theming-the-pulsate-sdk-1.