﻿{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-installing-intercom/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","admonition"]},"type":"markdown"},"seo":{"title":"Using Intercom","projectTitle":"Intercom and Fin Developer Platform","description":"Faster resolutions, higher CSAT, and lighter support volumes with the only platform to combine the power of automation and human customer support.","siteUrl":"https://developers.intercom.com","image":"/assets/og-image.9c9ef3a6cedbceee0e1d52fae2ffcce97f5a189639cf24e473331da9ad02c5f8.b1bff462.png","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"using-intercom","__idx":0},"children":["Using Intercom"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Track who your users are and what they do in your mobile app and customize the Intercom Messenger. Here’s how to configure Intercom for Android:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"user-login","__idx":1},"children":["User Login"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You’ll now need to login your users before you can talk to them and track their activity in your app."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are two type of users that can be created in Intercom: identified and unidentified."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Identified users"]},": If users need to login to your app to use it, such as Facebook, Instagram, or Slack, they would be considered identified users."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Unidentified users"]},": If your app does not have a login option, like Angry Birds or a flashlight app, you have unidentified users."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are three ways to log users into Intercom that visit your app:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Only login identified users"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Only login unidentified users"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Login both identified and unidentified users - an example of this is where your app has a login option, but it’s not essential for users to login to use your app, like Google Maps or YouTube."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The option you choose should be informed by the design of your app, namely whether you have a login option."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"login-your-identified-logged-in-users-into-intercom","__idx":2},"children":["Login your identified (logged in) users into Intercom"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["First you'll have to create an user"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"val registration = Registration.create().withUserId(\"123456\")\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Registration registration = Registration.create().withUserId(\"123456\");\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Then can login your user, like this:"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"private fun successfulLogin() {\n        /* For best results, use a unique user_id if you have one. */\n        val registration = Registration.create().withUserId(\"123456\")\n        Intercom.client().loginIdentifiedUser(\n            userRegistration = registration,\n            intercomStatusCallback = object : IntercomStatusCallback{\n                override fun onSuccess() {\n                    // Handle success\n                }\n\n                override fun onFailure(intercomError: IntercomError) {\n                    // Handle failure\n                }\n\n            }\n        )\n}\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"private void successfulLogin() {\n    /* For best results, use a unique user_id if you have one. */\n    Registration registration = Registration.create().withUserId(\"123456\");\n    Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() {\n                @Override\n                public void onSuccess() {\n                    // Handle success\n                }\n\n                @Override\n                public void onFailure(@NonNull IntercomError intercomError) {\n                    // Handle failure\n                }\n            });\n}\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"No User ID?"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you don't have a unique userId to use here, or if you have a userId and an email, you can use with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email(String email)"]}," on the Registration object."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You’ll also need to register your user anywhere they sign in. Just call:"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"if (loggedIn) {\n/* We're logged in, we can register the user with Intercom */\n    val registration = Registration.create().withUserId(\"123456\")\n    Intercom.client().loginIdentifiedUser(\n            userRegistration = registration,\n            intercomStatusCallback = object : IntercomStatusCallback{\n                override fun onSuccess() {\n                    // Handle success\n                }\n\n                override fun onFailure(intercomError: IntercomError) {\n                    // Handle failure\n                }\n\n            }\n        )\n}\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"if (loggedIn) {\n    /* We're logged in, we can register the user with Intercom */\n    Registration registration = Registration.create().withUserId(\"123456\");\n    Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() {\n                @Override\n                public void onSuccess() {\n                    // Handle success\n                }\n\n                @Override\n                public void onFailure(@NonNull IntercomError intercomError) {\n                    // Handle failure\n                }\n            });\n}\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"login-your-unidentified-users-visitors","__idx":3},"children":["Login your unidentified users (visitors)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow these instructions to login your unidentified users:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"override fun onCreate() {\n    super.onCreate()\n    Intercom.initialize(this, \"your api key\", \"your app id\")\n    Intercom.client().loginUnidentifiedUser(\n            intercomStatusCallback = object : IntercomStatusCallback{\n                override fun onSuccess() {\n                    // Handle success\n                }\n\n                override fun onFailure(intercomError: IntercomError) {\n                    // Handle failure\n                }\n\n            }\n        )\n}\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"@Override public void onCreate() {\n    super.onCreate();\n    Intercom.initialize(this, \"your api key\", \"your app id\");\n    Intercom.client().loginUnidentifiedUser(new IntercomStatusCallback() {\n            @Override\n            public void onSuccess() {\n                // Handle success\n            }\n\n            @Override\n            public void onFailure(@NonNull IntercomError intercomError) {\n                // Handle failure\n            }\n        });\n}\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"login-your-users-and-visitors","__idx":4},"children":["Login your users and visitors"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["First, you’ll need to login your user, like this:"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"private fun successfulLogin() {\n    /* For best results, use a unique user_id if you have one. */\n    val registration = Registration.create().withUserId(\"123456\")\n    Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() {\n                @Override\n                public void onSuccess() {\n                    // Handle success\n                }\n\n                @Override\n                public void onFailure(@NonNull IntercomError intercomError) {\n                    // Handle failure\n                }\n            });\n}\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"private void successfulLogin() {\n    /* For best results, use a unique user_id if you have one. */\n    Registration registration = Registration.create().withUserId(\"123456\");\n    Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() {\n                @Override\n                public void onSuccess() {\n                    // Handle success\n                }\n\n                @Override\n                public void onFailure(@NonNull IntercomError intercomError) {\n                    // Handle failure\n                }\n            });\n}\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"No User ID?"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you don't have a unique userId to use here, or if you have a userId and an email, you can use with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["withEmail(String email)"]}," on the Registration object."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You’ll also need to login your user anywhere they sign in. Just call:"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"if (loggedIn) {\n    /* We're logged in, we can login the user with Intercom */\n    val registration = Registration.create().withUserId(\"123456\")\n    Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() {\n                @Override\n                public void onSuccess() {\n                    // Handle success\n                }\n\n                @Override\n                public void onFailure(@NonNull IntercomError intercomError) {\n                    // Handle failure\n                }\n            });\n} else {\n    /* Since we aren't logged in, we are an unidentified user. \n     * Let's tell Intercom. */\n    Intercom.client().loginUnidentifiedUser(new IntercomStatusCallback() {\n            @Override\n            public void onSuccess() {\n                // Handle success\n            }\n\n            @Override\n            public void onFailure(@NonNull IntercomError intercomError) {\n                // Handle failure\n            }\n        });\n}\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"if (loggedIn) {\n    /* We're logged in, we can register the user with Intercom */\n    Registration registration = Registration.create().withUserId(\"123456\");\n    Intercom.client().loginIdentifiedUser(registration, new IntercomStatusCallback() {\n                @Override\n                public void onSuccess() {\n                    // Handle success\n                }\n\n                @Override\n                public void onFailure(@NonNull IntercomError intercomError) {\n                    // Handle failure\n                }\n            });\n} else {\n    /* Since we aren't logged in, we are an unidentified user. \n     * Let's register. */\n    Intercom.client().loginUnidentifiedUser(new IntercomStatusCallback() {\n            @Override\n            public void onSuccess() {\n                // Handle success\n            }\n\n            @Override\n            public void onFailure(@NonNull IntercomError intercomError) {\n                // Handle failure\n            }\n        });\n}\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-logout-a-user","__idx":5},"children":["How to logout a user"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When users want to log out of your app, simply call logout like so:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"private fun logout() {\n    /* This clears the Intercom SDK's cache of your user's identity\n     * and wipes the slate clean. */\n    Intercom.client().logout()\n}\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"private void logout() {\n    /* This clears the Intercom SDK's cache of your user's identity\n     * and wipes the slate clean. */\n    Intercom.client().logout();\n}\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"best-practices-for-logging-in-users","__idx":6},"children":["Best practices for logging in users"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Don’t use an email address as a userId as this field is unique and cannot be changed or updated later. If you only have an email address, you can just register a user with that."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If you login users with an email address, the email must be a unique field in your app. Otherwise we won't know which user to update and the mobile integration won't work."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"User registration"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Intercom knows when your app is backgrounded and comes alive again, so you won’t need to re-register your users."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"update-a-user","__idx":7},"children":["Update a user"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"updateUser(\n        userAttributes: UserAttributes,\n        intercomStatusCallback: IntercomStatusCallback\n)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"void updateUser(\n        UserAttributes userAttributes,\n        IntercomStatusCallback intercomStatusCallback\n);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters","__idx":8},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["userAttributes : The userAttributes object with the attributes to be set on the user in Intercom."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["intercomStatusCallback : IntercomStatusCallback to listen to success and failure"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage","__idx":9},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can send any data you like to Intercom from standard user attributes that are common to all Intercom users to custom user attributes that are unique to your app."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The complete list of standard user attributes that can be updated are described in the UserAttributes object. Standard user attributes such as a user's name or email address can be updated by calling:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"val userAttributes = UserAttributes.Builder()\n        .withName(\"Bob\")\n        .withEmail(\"bob@example.com\")\n        .build()\nIntercom.client().updateUser(\n            userAttributes = userAttributes,\n            intercomStatusCallback = object : IntercomStatusCallback {\n                override fun onSuccess() {\n                    // Handle success\n                }\n\n                override fun onFailure(intercomError: IntercomError) {\n                    // Handle failure\n                }\n            }\n        )\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"UserAttributes userAttributes = new UserAttributes.Builder()\n        .withName(\"Bob\")\n        .withEmail(\"bob@example.com\")\n        .build();\nIntercom.client().updateUser(userAttributes, new IntercomStatusCallback() {\n            @Override\n            public void onSuccess() {\n                // Handle success\n            }\n\n            @Override\n            public void onFailure(@NonNull IntercomError intercomError) {\n                // Handle failure\n            }\n        });\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Typically our customers see a lot of value in sending custom data that relates to customer development, such as price plan, value of purchases, etc. Custom user attributes must first be created in Intercom using one of the methods described ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.intercom.com/help/en/articles/179-create-and-track-custom-data-attributes-cdas"},"children":["here"]},". They can then be modified by calling withCustomAttribute(key, value) on the UserAttributes object."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"val userAttributes = UserAttributes.Builder()\n        .withCustomAttribute(\"paid_subscriber\", \"Yes\")\n        .withCustomAttribute(\"monthly_spend\", 155.5)\n        .withCustomAttribute(\"team_mates\", 3)\n        .build()\nIntercom.client().updateUser(\n            userAttributes = userAttributes,\n            intercomStatusCallback = object : IntercomStatusCallback {\n                override fun onSuccess() {\n                    // Handle success\n                }\n\n                override fun onFailure(intercomError: IntercomError) {\n                    // Handle failure\n                }\n            }\n        )\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"UserAttributes userAttributes = new UserAttributes.Builder()\n        .withCustomAttribute(\"paid_subscriber\", \"Yes\")\n        .withCustomAttribute(\"monthly_spend\", 155.5)\n        .withCustomAttribute(\"team_mates\", 3)\n        .build();\nIntercom.client().updateUser(userAttributes, new IntercomStatusCallback() {\n            @Override\n            public void onSuccess() {\n                // Handle success\n            }\n\n            @Override\n            public void onFailure(@NonNull IntercomError intercomError) {\n                // Handle failure\n            }\n        });\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"danger","name":"Attribute creation"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom attributes must be created in Intercom using one of the methods described ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.intercom.com/help/en/articles/179-create-and-track-custom-data-attributes-cdas"},"children":["here"]}," before they can be updated."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also set company data on your user with the Company object, like:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"val company = Company.Builder()\n        .withName(\"My Company\")\n        .withCompanyId(\"abc1234\")\n        .build()\nval userAttributes = UserAttributes.Builder()\n        .withCompany(company)\n        .build()\nIntercom.client().updateUser(\n            userAttributes = userAttributes,\n            intercomStatusCallback = object : IntercomStatusCallback {\n                override fun onSuccess() {\n                    // Handle success\n                }\n\n                override fun onFailure(intercomError: IntercomError) {\n                    // Handle failure\n                }\n            }\n        )\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Company company = new Company.Builder()\n        .withName(\"My Company\")\n        .withCompanyId(\"abc1234\")\n        .build();\nUserAttributes userAttributes = new UserAttributes.Builder()\n        .withCompany(company)\n        .build();\nIntercom.client().updateUser(userAttributes, new IntercomStatusCallback() {\n            @Override\n            public void onSuccess() {\n                // Handle success\n            }\n\n            @Override\n            public void onFailure(@NonNull IntercomError intercomError) {\n                // Handle failure\n            }\n        });\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"danger","name":"ID required for Company objects"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," is a required field for adding or modifying a company. The Company object describes all the standard attributes you can modify."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"submit-an-event","__idx":10},"children":["Submit an event"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"logEvent(name: String?, metaData: Map<String, *>?)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"void logEvent(String name, Map<String, *> metaData);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-1","__idx":11},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]}," : The name of the event you wish to track."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metaData"]}," : a map of simple types to present to Intercom"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage-1","__idx":12},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Data-Events/data_event/"},"children":["log events in Intercom "]},"that record what users do in your app and when they do it. For example, you could record the item a user ordered from your mobile app, and when they ordered it."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"val eventData = mapOf(\n    \"order_date\" to \"1392036272\",\n    \"stripe_invoice\" to \"38572984\"\n)\nIntercom.client().logEvent(\"sent_invitation\", eventData)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Map<String, Object> eventData = new HashMap<>();\neventData.put(\"order_date\", \"1392036272\");\neventData.put(\"stripe_invoice\", \"38572984\");\nIntercom.client().logEvent(\"sent_invitation\", eventData);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You’ll find more details about how events work and how to submit them ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Data-Events/data_event/"},"children":["here"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"present-intercom-spaces","__idx":13},"children":["Present Intercom Spaces"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"present(space: IntercomSpace)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"void present(IntercomSpace space);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-2","__idx":14},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["space"]}," : The IntercomSpace enum for the space to be presented"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage-2","__idx":15},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Spaces are different areas of the messenger that you can open directly. Intercom defines 4 possible spaces:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Home"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Help Center"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Messages"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Tickets"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These spaces can be presented by:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().present(space = IntercomSpace.Home)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().present(IntercomSpace.Home);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This opens Intercom and displays Home space."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Similarly, you can present HelpCenter and Messages by passing the respective enum.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Not providing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["space"]}," and calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Intercom.client().present()"]}," will open Home by default"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"present-intercom-content","__idx":16},"children":["Present Intercom Content"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"presentContent(content: IntercomContent)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"void presentContent(IntercomContent content);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-3","__idx":17},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["content"]}," : The IntercomContent to be presented"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage-3","__idx":18},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are various ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IntercomContent"]}," that you can present. The available types are:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Article"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Survey"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Carousel"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Help Center Collections"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Conversations"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To present an Intercom content you create the respective ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IntercomContent"]}," object and then call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["presentContent"]}," with that object"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, you can present an Article as follows"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().presentContent(content = IntercomContent.Article(id = \"12345\"))\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().presentContent(IntercomContent.Article(id = \"12345\"));\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Similarly, you can can present Surveys, Carousels and Help Center Collections."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Make sure your content is live"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A piece of content must be ‘live’ to be used in this feature. If it is in a draft or paused state, end-users will see an error if the app tries to open the content."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You may also present conversations using their IDs."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().presentContent(content = IntercomContent.Conversation(id = \"12345\"))\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().presentContent(IntercomContent.Conversation(id = \"12345\"));\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"customize-the-intercom-messenger","__idx":19},"children":["Customize the Intercom Messenger"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We definitely recommend that you customize the Intercom Messenger so that it feels completely at home on your product, site or mobile app. Here’s how:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.intercom.com/help/en/articles/6612589-set-up-and-customize-the-messenger"},"children":["Select the color and language of the Messenger"]}," and how personalize your profiles."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Follow the below steps to choose how the launcher appears and opens for your users."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"choose-how-the-launcher-appears-and-opens-for-your-users","__idx":20},"children":["Choose how the launcher appears and opens for your users"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you’d like the standard launcher to appear on the bottom right-hand side of your screen, just call:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().setLauncherVisibility(Visibility.VISIBLE)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().setLauncherVisibility(Visibility.VISIBLE);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you want to set the bottom padding for the Messenger, which dictates how far from the bottom of the screen the default launcher and in-app messages will appear, you can call:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().setBottomPadding(bottomPadding)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().setBottomPadding(int bottomPadding);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-custom-launcher","__idx":21},"children":["Create a custom launcher"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["However, if you’d like the Messenger to open from another location in your mobile app, you can create a custom launcher. This allows you to specify a button, link or element that opens the Messenger. For example, you can trigger the launcher to open when a customer clicks on your ‘Help and Support’ button."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/4dfc348-helpandsupport.75af5e663aed2578a9a7a31ddc829151c0b462ab936913483dd2061f2e848dfb.71a4f21c.png","alt":"","title":"helpAndSupport.png"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you have a custom launcher, you can call:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().present()\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().present();\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you want to open the Messenger to the composer screen with message field pre-populated you can call:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().displayMessageComposer(\"Message\")\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().displayMessageComposer(\"Message\");\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"show-your-users-unread-message-count","__idx":22},"children":["Show your user’s unread message count"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now you can show how many unread conversations your user has on your custom launcher. Even if a user dismisses a notification, they’ll still have a persistent indicator of unread conversations."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/2fb3a49-6036b92-unread_api_cropped.27e4ba7a512044bca3fdb1d5034a1d4a6547558df11560a4f4109ab0ffd2acf5.71a4f21c.png","alt":"","title":"6036b92-Unread_API_Cropped.png"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Just grab the current count with this method:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().getUnreadConversationCount()\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().getUnreadConversationCount();\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then, start listening for updates using:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().addUnreadConversationCountListener(listener)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().addUnreadConversationCountListener(listener);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-4","__idx":23},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listener"]}," : An ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UnreadConversationCountListener"]}," that will be called when the unread count changes"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage-4","__idx":24},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can implement the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UnreadConversationCountListener"]}," interface to receive updates:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"val listener = object : UnreadConversationCountListener {\n    override fun onCountChanged(unreadCount: Int) {\n        // Update your UI with the new unread count\n        updateBadgeCount(unreadCount)\n    }\n}\nIntercom.client().addUnreadConversationCountListener(listener)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"UnreadConversationCountListener listener = new UnreadConversationCountListener() {\n    @Override\n    public void onCountChanged(int unreadCount) {\n        // Update your UI with the new unread count\n        updateBadgeCount(unreadCount);\n    }\n};\nIntercom.client().addUnreadConversationCountListener(listener);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Don't forget to remove the listener when you no longer need it:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().removeUnreadConversationCountListener(listener)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().removeUnreadConversationCountListener(listener);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-theme-mode","__idx":25},"children":["Set theme mode"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"setThemeMode(themeMode: ThemeMode?)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"void setThemeMode(ThemeMode themeMode);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-5","__idx":26},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["themeMode"]}," : The theme mode to set (LIGHT, DARK, SYSTEM, or null to use server-provided theme)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage-5","__idx":27},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can override the server-provided theme setting for the current session only. The theme mode controls whether the SDK displays in light mode, dark mode, or follows the system theme. The theme selection will be reset when the app restarts."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"// Enable dark mode\nIntercom.client().setThemeMode(ThemeMode.DARK)\n\n// Enable light mode\nIntercom.client().setThemeMode(ThemeMode.LIGHT)\n\n// Use system preference\nIntercom.client().setThemeMode(ThemeMode.SYSTEM)\n\n// Clear override and use server-provided theme\nIntercom.client().setThemeMode(null)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"// Enable dark mode\nIntercom.client().setThemeMode(ThemeMode.DARK);\n\n// Enable light mode\nIntercom.client().setThemeMode(ThemeMode.LIGHT);\n\n// Use system preference\nIntercom.client().setThemeMode(ThemeMode.SYSTEM);\n\n// Clear override and use server-provided theme\nIntercom.client().setThemeMode(null);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Available since version 17.0.0"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This method was introduced in version 17.0.0 of the Android SDK."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"change-workspace","__idx":28},"children":["Change workspace"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"changeWorkspace(apiKey: String?, appId: String?)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"void changeWorkspace(String apiKey, String appId);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-6","__idx":29},"children":["Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]}," : The Android SDK API key found on the Intercom for Android settings page."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["appId"]}," : The app ID of your Intercom app."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage-6","__idx":30},"children":["Usage"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this to change the workspace that the SDK is connected to. This will also logout the current user and clear all data from Intercom SDK. Once called, the SDK will no longer communicate with Intercom until a further registration is made."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().changeWorkspace(\"your_new_api_key\", \"your_new_app_id\")\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().changeWorkspace(\"your_new_api_key\", \"your_new_app_id\");\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Available since version 16.1.0"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This method was introduced in version 16.1.0 of the Android SDK."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"User logout required"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This method will automatically logout the current user and clear all SDK data. You will need to register a user again after changing workspaces."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"temporarily-hide-notifications","__idx":31},"children":["Temporarily hide notifications"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can prevent in app messages from popping up in certain parts of your app by calling:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().setInAppMessageVisibility(Visibility.GONE)\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().setInAppMessageVisibility(Visibility.GONE);\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["📘 Mobile Carousels and Surveys Visibility"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The method ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["setInAppMessageVisibility"]}," does not apply to Mobile Carousels or Surveys. They will always be displayed."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can hide any Intercom screen in your app, by calling:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Kotlin","key":"Kotlin"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Kotlin","header":{"controls":{"copy":{}}},"source":"Intercom.client().hideIntercom()\n","lang":"Kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","key":"Java"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"Java","header":{"controls":{"copy":{}}},"source":"Intercom.client().hideIntercom();\n","lang":"Java"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"whats-next","__idx":32},"children":["What's next?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now that you have Intercom configured you can:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.intercom.com/docs/android-identity-verification"},"children":["Enable Identity Verification"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.intercom.com/installing-intercom/docs/push-notifications-android"},"children":["Configure Android Push Notifications"]},"."]}]}]},"headings":[{"value":"Using Intercom","id":"using-intercom","depth":1},{"value":"User Login","id":"user-login","depth":2},{"value":"Login your identified (logged in) users into Intercom","id":"login-your-identified-logged-in-users-into-intercom","depth":3},{"value":"Login your unidentified users (visitors)","id":"login-your-unidentified-users-visitors","depth":3},{"value":"Login your users and visitors","id":"login-your-users-and-visitors","depth":3},{"value":"How to logout a user","id":"how-to-logout-a-user","depth":2},{"value":"Best practices for logging in users","id":"best-practices-for-logging-in-users","depth":2},{"value":"Update a user","id":"update-a-user","depth":2},{"value":"Parameters","id":"parameters","depth":3},{"value":"Usage","id":"usage","depth":3},{"value":"Submit an event","id":"submit-an-event","depth":2},{"value":"Parameters","id":"parameters-1","depth":3},{"value":"Usage","id":"usage-1","depth":3},{"value":"Present Intercom Spaces","id":"present-intercom-spaces","depth":2},{"value":"Parameters","id":"parameters-2","depth":3},{"value":"Usage","id":"usage-2","depth":3},{"value":"Present Intercom Content","id":"present-intercom-content","depth":2},{"value":"Parameters","id":"parameters-3","depth":3},{"value":"Usage","id":"usage-3","depth":3},{"value":"Customize the Intercom Messenger","id":"customize-the-intercom-messenger","depth":2},{"value":"Choose how the launcher appears and opens for your users","id":"choose-how-the-launcher-appears-and-opens-for-your-users","depth":2},{"value":"Create a custom launcher","id":"create-a-custom-launcher","depth":2},{"value":"Show your user’s unread message count","id":"show-your-users-unread-message-count","depth":2},{"value":"Parameters","id":"parameters-4","depth":3},{"value":"Usage","id":"usage-4","depth":3},{"value":"Set theme mode","id":"set-theme-mode","depth":2},{"value":"Parameters","id":"parameters-5","depth":3},{"value":"Usage","id":"usage-5","depth":3},{"value":"Change workspace","id":"change-workspace","depth":2},{"value":"Parameters","id":"parameters-6","depth":3},{"value":"Usage","id":"usage-6","depth":3},{"value":"Temporarily hide notifications","id":"temporarily-hide-notifications","depth":2},{"value":"What's next?","id":"whats-next","depth":1}],"frontmatter":{"seo":{"title":"Using Intercom"}},"lastModified":"2025-08-21T06:19:48.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/installing-intercom/android/using-intercom","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}