--- title: "Set Callback" slug: "android-set-callback" description: "Set up Insider callbacks to retrieve push, in-app, and session event data with sample deep-link logs." tags: ["android set callback", "set callbacks"] updated: 2026-10-09T12:14:27Z published: 2026-10-09T12:14:27Z canonical: "academy.insiderone.com/android-set-callback" --- > ## Documentation Index > Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt > Use this file to discover all available pages before exploring further. # Set Callback You need to set Insider One callbacks after the SDK initializes. Insider One callbacks, also known as "call-after" functions, help you retrieve useful data when necessary. Your title goes hereIf you need to observe every recorded event, see [Event Listener](/docs/ios-listen-to-recorded-events). It is separate from registerInsiderCallback and does not replace it. Callback types are as follows: - NOTIFICATION_OPEN: The user taps a push notification or one of its action buttons. The payload includes the deep-link fields described under Sample logs. - INAPP_BUTTON_CLICK: The user taps a button inside an In-App message. - TEMP_STORE_CUSTOM_ACTION: An App Template custom action is triggered (e.g., a key-value, URL-scheme, or JSON action). - INAPP_SEEN: An In-App message has been rendered to the user. - SESSION_STARTED: A new Insider One session has started. ## Method Signature ```java public void registerInsiderCallback(InsiderCallback callback) // Callback Types NOTIFICATION_OPEN TEMP_STORE_CUSTOM_ACTION INAPP_SEEN INAPP_BUTTON_CLICK SESSION_STARTED ``` ```custom fun registerInsiderCallback(callback: InsiderCallback) // Callback Types NOTIFICATION_OPEN TEMP_STORE_CUSTOM_ACTION INAPP_SEEN INAPP_BUTTON_CLICK SESSION_STARTED ``` ## Method Example ```java Insider.Instance.registerInsiderCallback(new InsiderCallback() { @Override public void doAction(JSONObject data, InsiderCallbackType callbackType) { switch (callbackType) { case NOTIFICATION_OPEN: Log.d("[INSIDER]", "[NOTIFICATION_OPEN]: " + data); break; case INAPP_SEEN: Log.d("[INSIDER]", "[INAPP_SEEN]: " + data); break; case TEMP_STORE_CUSTOM_ACTION: Log.d("[INSIDER]", "[TEMP_STORE_CUSTOM_ACTION]: " + data); break; case INAPP_BUTTON_CLICK: Log.d("[INSIDER]", "[INAPP_BUTTON_CLICK]: " + data); break; case SESSION_STARTED: Log.d("[INSIDER]", "[SESSION_STARTED]: " + data); break; } } }); ``` ```custom Insider.Instance.registerInsiderCallback { data, callbackType -> when (callbackType) { InsiderCallbackType.NOTIFICATION_OPEN -> println("[INSIDER]").d("[NOTIFICATION_OPEN]: $data") InsiderCallbackType.INAPP_SEEN -> println("[INSIDER]").d("[INAPP_BUTTON_CLICK]: $data") InsiderCallbackType.TEMP_STORE_CUSTOM_ACTION -> println("[INSIDER]").d("[TEMP_STORE_CUSTOM_ACTION]: $data") InsiderCallbackType.INAPP_BUTTON_CLICK -> println("[INSIDER]").d("[INAPP_BUTTON_CLICK]: $data") InsiderCallbackType.SESSION_STARTED -> println("[INSIDER]").d("[SESSION_STARTED]: $data") } } ``` --- Insider One callbacks, also known as "call-after" functions, help you retrieve useful data when necessary. For example, let's take a look at the NotificationOpen callback. Say you have a push notification without a deep link. In this case, no callback will be fired. If you have a push notification with a key-value pair deep link, the NotificationOpen callback will be fired once you open the push notification. The following are sample logs for different deep link types in app pushes and templates: #### Key-Value Pair (Push) > [INSIDER][insiderCallbackTriggered] I Callback Type: NOTIFICATION_OPEN, Data:{ > > "type": 0, > > "data": { > > "received_at": "1748433708", > > "collapse_id": "0_70815_1748433707", > > "source": "Insider", > > "camp_type": "0", > > "key": "value", > > "sound": "Default", > > "camp_id": "70815", > > "isSetPush": true, > > "variant_id": "89159", > > "sent_at": "1748433707" > > } > > } #### Key-Value Pair (Message Action Button) > [INSIDER][insiderCallbackTriggered] Callback Type: NOTIFICATION_OPEN { > > "type": 0, > > "data": { > > "buttonId": 0, > > "source": "Insider", > > "key": "value", > > "buttonText": "key value pair button1" > > } > > } #### Internal URL (Push) > [INSIDER][insiderCallbackTriggered] I Callback Type: NOTIFICATION_OPEN, Data:{ > > "type": 0, > > "data": { > > "received_at": "1748433708", > > "collapse_id": "0_70815_1748433707", > > "source": "Insider", > > "camp_type": "0", > > "ins_dl_internal": "https://www.test.com", > > "sound": "Default", > > "camp_id": "70815", > > "isSetPush": true, > > "variant_id": "89159", > > "sent_at": "1748433707" > > } > > } #### Internal URL (Message Action Button) > [INSIDER][insiderCallbackTriggered] Callback Type: NOTIFICATION_OPEN > > { > > "type": 0, > > "data": { > > "buttonId": 0, > > "source": "Insider", > > "buttonText": "test internal", > > "ins_dl_internal": "https://www.test.com" > > } > > } #### External URL (Push) > [INSIDER][insiderCallbackTriggered] I Callback Type: NOTIFICATION_OPEN, Data:{ > > "type": 0, > > "data": { > > "received_at": "1748433708", > > "collapse_id": "0_70815_1748433707", > > "source": "Insider", > > "camp_type": "0", > > "ins_dl_external": "https://www.test.com", > > "sound": "Default", > > "camp_id": "70815", > > "isSetPush": true, > > "variant_id": "89159", > > "sent_at": "1748433707" > > } > > } #### External URL (Message Action Button) > [INSIDER][insiderCallbackTriggered] Callback Type: NOTIFICATION_OPEN > > { > > "type": 0, > > "data": { > > "ins_dl_external": "https://www.test.com", > > "buttonId": 0, > > "source": "Insider", > > "buttonText": "test external" > > } > > } #### JSON (Push) > [INSIDER][insiderCallbackTriggered] I Callback Type: NOTIFICATION_OPEN, Data:{ > > "type": 0, > > "data": { > > "received_at": "1748433708", > > "collapse_id": "0_70815_1748433707", > > "source": "Insider", > > "camp_type": "0", > > "ins_dl_json": '{"test":"test2"}', > > "sound": "Default", > > "camp_id": "70815", > > "isSetPush": true, > > "variant_id": "89159", > > "sent_at": "1748433707" > > } > > } #### JSON (Message Action Button) > [INSIDER][insiderCallbackTriggered] Callback Type: NOTIFICATION_OPEN > > { > > "type": 0, > > "data": { > > "buttonId": 0, > > "source": "Insider", > > "buttonText": "test json", > > "ins_dl_json": '{"test":"test2"}' > > } > > } #### URL Scheme (Push) > [INSIDER][insiderCallbackTriggered] I Callback Type: NOTIFICATION_OPEN, Data:{ > > "type": 0, > > "data": { > > "received_at": "1748433708", > > "collapse_id": "0_70815_1748433707", > > "source": "Insider", > > "camp_type": "0", > > "ins_dl_url_scheme": "test", > > "sound": "Default", > > "camp_id": "70815", > > "isSetPush": true, > > "variant_id": "89159", > > "sent_at": "1748433707" > > } > > } #### URL Scheme (Message Action Button) > [INSIDER][insiderCallbackTriggered] Callback Type: NOTIFICATION_OPEN > > { > > "type": 0, > > "data": { > > "buttonId": 0, > > "source": "Insider", > > "buttonText": "test url scheme", > > "ins_dl_url_scheme": 'test' > > } > > } #### Key-Value Pair (App template) > [INSIDER][CALLBACK][InsiderCallbackTypeTempStoreCustomAction]: { > > data = { > > InsiderDeepLinkKey = InsiderDeepLinkValue; > > }; > > type = 4; > > } #### URL Scheme (App template) > [INSIDER][DEBUG][processTemplateStoreURL]: { > > action = deepLink; > > dismiss = 12; > > redirection = "https://academy.useinsider.com"; > > } #### JSON (App template) > [INSIDER][DEBUG][processTemplateStoreURL]: { > > action = deepLink; > > custom = { > > json = "{\"insider_key\": \"insider_value\"}"; > > }; > > dismiss = 12; > > } ## Related - [Deep links](/deep-links.md)