Deploying in a native Android app

Deploying in a native Android app

Written by Grace Williamson
Last update: Friday, Dec 20, 2024

Locate your Public brand key.

  • Sign in to your account.

  • Click on Deploy over on the left sidebar and then click on Brand keys.

Setup:

In your project build.gradle file (Project:...), merge the following line with your existing repositories configurations:

allprojects {
    repositories {
      maven { url 'https://jitpack.io' }
    }  
}

In your app module build.gradle file (Module:app), add the following dependency:

implementation 'com.github.%{polaria-begin}polaria%{polaria-end}slaaskhq:android-sdk:1.0'

In your MainActivity class, add:

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        Slaask.initialize(this, "spk-..."); // Replace with your own brand public and private keys

        // Your code here ...
    }
}

You'll also need to add internet permissions to your AndroidManifest.xml

Show your Slaask livechat

To show the chatbox to your users, call the Slaask.show() function.

// Example code:

myButton.setOnClickListener { view ->
    Slaask.show()
}

Verify that everything is working as it should.

Once you've built your app code (including the Slaask snippet):

  • Click on the button where the show() method is called and your Slaask chatbox should appear.

  • Type something (such as: "Hey! Do you read me?").

  • Open up your Slack (exactly the same way you would when using Slack for normal communication purposes). Your message should appear in a dedicated conversation channel on your Slack.

  • %{polaria-begin} Open up your Polaria account. Your message should appear in a dedicated conversation in your Polaria. %{polaria-end}

  • If you can see your message appearing within a conversation channel, this means that your Slaask integration was a success. Congrats! Otherwise, if you believe you've followed this process correctly and that Slaask isn't working on your mobile app as it should, please contact us so that we may help you resolve the issue.

Android SDK

4 articles in this category.
Written by Grace Williamson.