Advanced Usage

Using multiple site slugs

To use multiple site slugs inside your application, you have to do next steps:

  1. Add credentials for each site you are going to use inside your manifest file. Format is the same as from corresponding Getting Started section.

  2. Add deep linking schemas handlers into your main activity entry for each site you are going to use too. Format is the same as from corresponding Getting Started section.

  3. Set default site slug.

    It can be done by adding this information to the manifest file into <application> entry:

            android:value="{{YOUR_DEFAULT_SITE_SLUG}}" />

    or by passing through Talkable.initialize in the Application:

    import com.talkable.sdk.Talkable;
    public class App extends Application {
        public void onCreate() {
            Talkable.initialize(this, "your-default-site-slug");


    You can set site slug at any time after initialization in the following way:

    Talkable.setSiteSlug(context, "some-site-slug");

    Make sure to add credentials for this site inside the manifest file. Otherwise, an exception will be raised.

Sharing via Facebook

By default sharing via Facebook is disabled. You can enable it by setting up your project with the Facebook SDK: Android - Getting Started

Overriding default behaviour

  1. Create a new fragment in your app which extends TalkableOfferFragment and override methods there. Example:

    import com.talkable.sdk.TalkableOfferFragment;
    public class OverriddenTalkableOfferFragment extends TalkableOfferFragment {
        public void copyToClipboard(String string) {
            Toast.makeText(getActivity(), "Text copied!", Toast.LENGTH_LONG).show();
  2. Pass Class of an activity you want to run a fragment in and the overriden fragment to Talkable.showOffer call:

    Talkable.showOffer(activity, affiliateMember, MyFragmentActivity.class, OverridenTalkableOfferFragment.class);


    You can just override TalkableOfferFragment and use default TalkableActivity from Talkable SDK. In this case, you shouldn’t change the manifest (if you did steps from Getting Started section).

    Talkable.showOffer(activity, affiliateMember, TalkableActivity.class, OverridenTalkableOfferFragment.class);

Using TalkableOfferFragment directly

To use instance of TalkableOfferFragment you have to implement TalkableOfferFragmentListener interface from TalkableOfferFragment class inside your activity.

import com.talkable.sdk.TalkableOfferFragment.TalkableOfferFragmentListener;

public class MyActivity implements TalkableOfferFragmentListener {


    public void onOfferClosed() {
        if (mTalkableOfferFragment.isOfferLoaded()) {


Then you should create an origin and pass it to TalkableOfferFragment instance via Bundle. After this you can start using the fragment.

AffiliateMember affiliateMember = new AffiliateMember();

Bundle arguments = new Bundle();
arguments.putParcelable(TalkableOfferFragment.ORIGIN_PARAM, affiliateMember);

TalkableOfferFragment talkableOfferFragment = new TalkableOfferFragment();