### Example Header Parameter Value Source: https://help-en.salesmartly.com/docs/obtain-instructions-for-the-header-parameter-of-api An example of the concatenated string format required for the API request header. ```text Enter your project's "Token"&chat_user_id=64673427382a7760153e9f81&page=1&page_size=50&project_id=1 ``` -------------------------------- ### Monitor plugin resource loading completion with ssq.push('onReady') Source: https://help-en.salesmartly.com/docs/salesmartly-chat-plugin-jssdk-developer-documentation Registers a callback to execute after the plugin's resources finish loading. The example also shows how to attach the callback using the `load` event on the script element with id `ss_chat`. ```javascript ssq.push('onReady', () => { // Execute other events }); // Usage Examples: ``` -------------------------------- ### Initialize SDK Source: https://help-en.salesmartly.com/docs/salesmartly-android-sdk-developer-documentation Initialize the SDK using the provided script URL. ```java SaleSmartyInit.init(Context context,String scriptUrl); ``` -------------------------------- ### Open chat window with ssq.push('chatOpen') Source: https://help-en.salesmartly.com/docs/salesmartly-chat-plugin-jssdk-developer-documentation Use this snippet to programmatically open the chat window, for example to guide users to customer service after a payment failure. The callback status can be 'success', 'failed', or 'ignored' (if already open or interrupted by chatClose). ```javascript ssq.push('chatOpen', function(result) { console.log('chatOpen status:', result.status); }); ``` -------------------------------- ### SaleSmartyInit.init(Context context, String scriptUrl) Source: https://help-en.salesmartly.com/docs/salesmartly-android-sdk-developer-documentation Initializes the SaleSmartly SDK with the application context and the script URL for the JavaScript integration. ```APIDOC ## SaleSmartyInit.init(Context context, String scriptUrl) ### Description Initializes the SaleSmartly SDK with the application context and the script URL for the JavaScript integration. ### Method SaleSmartyInit.init(Context context, String scriptUrl) ### Parameters - context (Context) - Required - The application context. - scriptUrl (String) - Required - The inserted js, such as https://assets.salesmartly.com/js/project_xxxxx.js ### Example SaleSmartyInit.init(Context context, String scriptUrl); ``` -------------------------------- ### ssq.push('onOpenLine'|'onOpenMessenger'|'onOpenEmail'|'onOpenTelegram'|'onOpenWhatsapp'|'onOpenWeixin'|'onOpenVKontakte'|'onOpenTikTok'|'onOpenCustom'|'onOpenZalo'|'onOpenLineApp', callback) Source: https://help-en.salesmartly.com/docs/salesmartly-chat-plugin-jssdk-developer-documentation Listens for click events on various plugin icons. Each event corresponds to a specific messaging platform icon. The callback receives an object with details about the click. ```APIDOC ## ssq.push('onOpenLine'|'onOpenMessenger'|'onOpenEmail'|'onOpenTelegram'|'onOpenWhatsapp'|'onOpenWeixin'|'onOpenVKontakte'|'onOpenTikTok'|'onOpenCustom'|'onOpenZalo'|'onOpenLineApp', callback) ### Description Perform corresponding actions by listening to different plug-in icon click events. This approach can help you track user interaction behavior. ### Method ssq.push ### Parameters - **eventName** (string) - Required - One of the following event names: 'onOpenLine', 'onOpenMessenger', 'onOpenEmail', 'onOpenTelegram', 'onOpenWhatsapp', 'onOpenWeixin', 'onOpenVKontakte', 'onOpenTikTok', 'onOpenCustom', 'onOpenZalo', 'onOpenLineApp'. - **callback** (function) - Required - Function that receives an object with click details. For 'onOpenCustom', the object contains id (custom_1, custom_2, custom_3) and content. ### Request Example ```javascript // Listening for clicks Line ssq.push('onOpenLine', (obj) => { console.log('Line icon clicked', obj); }); // Listening for clicks Messenger ssq.push('onOpenMessenger', (obj) => { console.log('Messenger icon clicked', obj); }); // Listening for clicks Email ssq.push('onOpenEmail', (obj) => { console.log('Email icon clicked', obj); }); // Listening for clicks Telegram ssq.push('onOpenTelegram', (obj) => { console.log('Telegram icon clicked', obj); }); // Listening for clicks Whatsapp ssq.push('onOpenWhatsapp', (obj) => { console.log('Whatsapp icon clicked', obj); }); // Listening for clicks WeChat ssq.push('onOpenWeixin', (obj) => { console.log('WeChat icon clicked', obj); }); // Listening for clicks VKontakte ssq.push('onOpenVKontakte', (obj) => { console.log('VKontakteicon clicked', obj); }); // Listening for clicks TikTok ssq.push('onOpenTikTok', (obj) => { console.log('TikTok clicked', obj); }); // Listening for clicks Custom ssq.push('onOpenCustom', (obj) => { // obj = { // id, // custom_1、custom_2、custom_3 // content, // } console.log('Custom clicked', obj); }); // Listening for clicks Zalo ssq.push('onOpenZalo', (obj) => { console.log('Zalo icon clicked', obj); }); // Listening for clicks LineApp ssq.push('onOpenLineApp', (obj) => { console.log('LineApp icon clicked', obj); }); ``` ### Response No explicit response documented. ``` -------------------------------- ### Get Unread Message Count Source: https://help-en.salesmartly.com/docs/salesmartly-android-sdk-developer-documentation Set a listener to receive the count of unread messages as an integer. ```java SaleSmartyInit.setUnReadMessagesListener(c var0); ```