Customizing

There are several ways you can make RevTwo support experience more personal.  This is achieved through various customization methods provided in the library.

Setting User

If your application implements user Sign In method, you may want to take advantage of setting the active user using the following method:

public static void setUser(String name, String email, Context context);

Usage example:

RevTwo.setUser(“John Doe”, “user@mail.com”, this);

After setting a user, you may invoke listUserTickets and getUnreadMessages methods to retrieve Tickets and Messages for the logged in user.  Otherwise, Tickets and Messages will be retrieved for a device.

Customizing Incoming Call Screen

The following methods can be used to customize the Message appearing on the Incoming Call screen, as well as Message Color and Logo.  By default, Incoming Call message will say: “Incoming call from RevTwo Support” in white.

// Customize Incoming Call Message
public static void customizeIncomingCallText(String text, Context context);

// Customize Incoming Call Message Color
public static void customizeIncomingCallTextColor(String colorHexCode, Context context);

// Customize Incoming Call Logo
public static void customizeIncomingCallImage(@DrawableRes int imgResource, Context context);

Usage example:

RevTwo.customizeIncomingCallText("Incoming call", this);

Customizing Chat Screen

If you would like to customize the Chat Screen to better fit your application layout, you may use the following parameters:

  • PARAM_TITLE_VIEW_LAYOUT — Integer.  Override chat navigation layout at the top of Chat Screen.
  • PARAM_BACK_BUTTON_ICON_RES — Integer.  Drawable resource that will be used instead of default Back button.
  • PARAM_ENABLE_AVATAR — Boolean.  Default: false.  Enable / disable avatars in chats.  If true — user avatars will be displayed next to chat bubbles.  If false — each user’s chat bubbles will have their own color.
  • PARAM_DISABLE_CLOSE_TICKET_BUTTON — Boolean.  Default: false.  Hides the Close button used to close user owned tickets.
  • PARAM_DISABLE_SENDING_MESSAGES — Boolean.  Default: false.  Hides the input text field and Send button for adding new Chat Messages.
  • PARAM_ENABLE_REPORTING — Boolean.  Default: false.  If enabled — user will be able to report abusive or inappropriate chats for moderation by clicking on chat bubbles.

Here is how you can set above parameters:

// Open Chat Activity
Intent intent = new Intent(getActivity(), ChatActivity.class);

// Provide Title Layout for Chat Activity
intent.putExtra(ChatActivity.PARAM_TITLE_VIEW_LAYOUT, R.layout.yours_title_layout);

// Customize other parameters here...

startActivity(intent);