Deploying in a native Android app

Deploying in a native Android app

Última actualización viernes, dic 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}:android-sdk:1.0'

In your MainActivity class, add:

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        Xeno.initialize(this, "xpk-..."); // 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 Xeno livechat

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

// Example code:

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

Verify that everything is working as it should.

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

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

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

  • %{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 Xeno integration was a success. Congrats! Otherwise, if you believe you've followed this process correctly and that Xeno 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 artículo en esta categoria.