{"_id":"55781fe45129590d003ff514","user":"54aa7f3f9bb00c0b00cb899b","__v":11,"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"},"githubsync":"","project":"54aa7f773b56130b0056c86e","version":{"_id":"55781fe25129590d003ff4f7","project":"54aa7f773b56130b0056c86e","forked_from":"54aa7f773b56130b0056c871","__v":6,"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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Developers","version_clean":"2.0.0","version":"2.0"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-05T14:13:51.634Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":10,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Showing / Hiding Inbox\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"Please make sure that you're familiar with the [Running the Pulsate SDK](https://pulsate.readme.io/v2.0/docs/running-the-pulsate-sdk-android) tutorial.\"\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 a message 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  \"title\": \"Removing Floating Action Button from Feed\"\n}\n[/block]\nThe Floating Action Button in the Feed allows users to create talks 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    private String TAG = \\\"PULSATEAPP\\\";\\n    private static IPulsateManager manager;\\n\\n    :::at:::Override\\n    protected void attachBaseContext(Context base) {\\n        super.attachBaseContext(base);\\n        MultiDex.install(base);\\n    }\\n\\n    @Override\\n    public void onCreate() {\\n        super.onCreate();\\n        Pulsate.install(this);\\n        getPulsateManager();\\n    }\\n\\n    public static IPulsateManager getPulsateManager() {\\n        if (manager == null) {\\n            manager = PulsateFactory.getInstance();\\n            manager.setNewThreadButtonEnabled(false);\\n        }\\n        return manager;\\n    }\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Getting amount of unread messages\"\n}\n[/block]\nYou can easily get the amount of unread messages using the *getUnreadCount* method. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"manager.getUnreadCount(new GetUnreadCountRequestListener() {\\n            @Override\\n            public void onRequestFinished(int unread) {\\n                //Code to be done\\n            }\\n\\n            @Override\\n            public void onRequestFailed() {\\n\\n            }\\n        });\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nYou need to pass an *GetUnreadCountRequestListener* to the method. The listener has a callback named *onRequestFinished* - this callback returns the number of unread messages.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Customizing the Pulsate Inbox\"\n}\n[/block]\nYou can easily change the colors and strings in the inbox. You can also change the arrangement of the Inbox fragments.\n\nTo learn more about customizing the strings check this link - https://pulsate.readme.io/docs/android-sdk-language-localization.\n\nTo learn more about customizing the colors check this link - https://pulsate.readme.io/docs/custom-theming-the-pulsate-sdk\n\nTo learn more about rearranging the fragments check this link - https://pulsate.readme.io/docs/showing-the-inbox-using-fragments","excerpt":"","slug":"showing--hiding-the-message-inbox","type":"basic","title":"Configuring the Pulsate Inbox"}

Configuring the Pulsate Inbox


[block:api-header] { "type": "basic", "title": "Showing / Hiding Inbox" } [/block] [block:callout] { "type": "success", "body": "Please make sure that you're familiar with the [Running the Pulsate SDK](https://pulsate.readme.io/v2.0/docs/running-the-pulsate-sdk-android) tutorial." } [/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 a message 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] { "title": "Removing Floating Action Button from Feed" } [/block] The Floating Action Button in the Feed allows users to create talks 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 private String TAG = \"PULSATEAPP\";\n private static IPulsateManager manager;\n\n @Override\n protected void attachBaseContext(Context base) {\n super.attachBaseContext(base);\n MultiDex.install(base);\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n Pulsate.install(this);\n getPulsateManager();\n }\n\n public static IPulsateManager getPulsateManager() {\n if (manager == null) {\n manager = PulsateFactory.getInstance();\n manager.setNewThreadButtonEnabled(false);\n }\n return manager;\n }\n}", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Getting amount of unread messages" } [/block] You can easily get the amount of unread messages using the *getUnreadCount* method. [block:code] { "codes": [ { "code": "manager.getUnreadCount(new GetUnreadCountRequestListener() {\n @Override\n public void onRequestFinished(int unread) {\n //Code to be done\n }\n\n @Override\n public void onRequestFailed() {\n\n }\n });", "language": "java" } ] } [/block] You need to pass an *GetUnreadCountRequestListener* to the method. The listener has a callback named *onRequestFinished* - this callback returns the number of unread messages. [block:api-header] { "type": "basic", "title": "Customizing the Pulsate Inbox" } [/block] You can easily change the colors and strings in the inbox. You can also change the arrangement of the Inbox fragments. To learn more about customizing the strings check this link - https://pulsate.readme.io/docs/android-sdk-language-localization. To learn more about customizing the colors check this link - https://pulsate.readme.io/docs/custom-theming-the-pulsate-sdk To learn more about rearranging the fragments check this link - https://pulsate.readme.io/docs/showing-the-inbox-using-fragments