Menu

SaleSmartly Android SDK Developer Documentation

Note: Android version >= 7.0 Webview component version >= 53

App Manifest Required Permissions

Copy
 <code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/&gt;
</code>

aar package address

Portal

  1. Initialize SDK

Copy
 <code>    SaleSmartyInit.init(Context context,String scriptUrl);
</code>

scriptUrl is the inserted js, such as https://assets.salesmartly.com/js/project\_xxxxx.js

  1. Initialize the SaleSmarty webpage

Copy
 <code>    SaleSmartyInit.initSaleSmartyView(Activity activity);
</code>

Note: Initialize the browser as early as possible in the Activity

  1. Add the browser to the parent layout

Copy
 <code>    SaleSmartyInit.addSaleSmartyView(ViewGroup viewGroup);
</code>

Note: The Activity where the added parent layout is located must be consistent with the Activity that executes the initialization of the salesmarty web page

  1. Upload user information

Copy
 <code>    SaleSmartyInit.uploadUserMessage(String user_id,
                                     String user_name,
                                     String language,
                                     String phone,
                                     String email,
                                     String description,
                                     String[] label_names);
</code>

Note: Uploading user information does not support callbacks at the moment, user_id and user_name are required

  1. Open the window

Copy
 <code>    SaleSmartyInit.openSaleSmartyView();
</code>
  1. Close the window

Copy
 <code>    SaleSmartyInit.closeSaleSmartyView();
</code>
  1. Get the number of unread messages

Copy
 <code>    SaleSmartyInit.setUnReadMessagesListener(c var0);
</code>

Note: The parameter c interface will return an int value, which is the number of unread messages.

  1. File selection callback

Copy
 <code>    SaleSmartyInit.upLoadFiles(int requestCode,Intent var0);
</code>

Note: SaleSmartyInit should be called in the onActivityResult of the Activity that initializes the salesmarty web page

  1. Listen for loading completion (supported from version 1.2.0)

Copy
 <code>    SaleSmartyInit.setOnReadyListener(c var0);
</code>
  1. The monitoring window opens

Copy
 <code>    SaleSmartyInit.setOnOpenSaleSmartyViewListener(c var0);
    // 1.2.0版本默认执行打开操作
</code>
  1. The monitoring window is closed

Copy
 <code>    SaleSmartyInit.setOnCloseSaleSmartyViewListener(c var0);
</code>

Demo Example

SaleSmartly Android SDK Demo example, click to download

Last modified: 2025-05-21Powered by