HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center

SDK 8.1 Migration Guide

The main objective of this release is to give you more control over the Instabug products you use.

For example, let's say that from the Prompt Options menu, you want your app users to be able to "Report a problem" and "Suggest an improvement", but not "Ask a question"¹, but you still want to be able to have conversations with users who send you bugs and feedback.

Starting from SDK V8.1, you can achieve this by keeping BugReporting enabled, disabling a new class for Chats, and enabling a new class for Replies.

To provide this level of control, we introduced new classes, moved some APIs, renamed others and deprecated old versions. These changes affect users of all Instabug products across all OS platforms.

This migration guide explains the details related to each change, how to drop the old APIs, and how to adopt the new ones.

¹ "Ask a question" is the new default copy in the Prompt Options menu, replacing "Talk to us"


Summary of Changes

  • Introduced new classes:
  • Chats
  • Replies
  • Added new APIs to the following classes:
  • BugReporting
  • Instabug
  • Moved some APIs from Instabug to Replies.
  • Renamed some APIs.
  • Deprecated some APIs in BugReporting.

In the following sections, you can find detailed changes related to each class.


invoke

Previous Usage

BugReporting.invoke();

New Usage

Instabug.show();

invoke with Mode

Previous Usage

// Compose a new bug report
BugReporting.invoke(InvocationMode.NEW_BUG);
// Compose new feedback
BugReporting.invoke(InvocationMode.NEW_FEEDBACK);
// Compose new chat
BugReporting.invoke(InvocationMode.NEW_CHAT);
// Show chat history
BugReporting.invoke(InvocationMode.CHATS_LIST);

New Usage

// Compose a new bug report
BugReporting.show(BugReporting.ReportType.BUG)
// Compose new feedback
BugReporting.show(BugReporting.ReportType.FEEDBACK)
// Compose new chat
Chats.show();
// Show chat history
Replies.show();

hasChats

New Usage

📘

Check if your user has a chat history with you

The show API inside the Replies class opens the list of messages in your app only if the user already has a chat history. Otherwise, this API has no effect. If you manually show the replies page, we recommend using the new API hasChats.

Use the API below to check whether the user has a chat history with your team, then show them the replies page or not.

Replies.hasChats();

setInvocationOptions

Previous Usage

BugReporting.setInvocationOptions(InvocationOption.EMAIL_FIELD_OPTIONAL);

New Usage

BugReporting.setOptions(Option.EMAIL_FIELD_OPTIONAL);

setPromptOptions

Previous Usage

BugReporting.setPromptOptionsEnabled(PromptOption.BUG, PromptOption.CHAT);

New Usage

📘

New Prompt Options Experience

In older versions of the SDK, the "Talk to us" option would open a new chat if the user did not have a chat history with you. If the user did have a chat history, selecting this option would open the list of conversations.

Starting from SDK V8.1, the default copy for this button is now "Ask a question", and selecting this option will now always open a new chat. If the user has a chat history with you, a new button appears in the top-right of the modal that opens the list of replies. "Ask a question" and the button to open the list of replies can be enabled and disabled independently of one another.

1440

The default Prompt Options menu starting from Instabug Android SDK V8.1 and above.

// Disable Bug Reporting & Feedback. If disabled, both "Report a problem" and "Suggest an improvement" are removed from the Prompt Options menu, and manually showing Bug Reporting & Feedback has no effect.
BugReporting.setState(Feature.State.DISABLED);

// Disable In-App Chat. If disabled, "Ask a question" (new default copy instead of "Talk to us") is removed from the Prompt Options menu, the compose button in the replies list is removed, and manually showing the compose view of In-App Chat has no effect.
Chats.setState(Feature.State.DISABLED);

// Disable Replies. If disabled, the button to view the replies list is removed from the Prompt Options menu, in-app notifications are disabled, and manually showing the replies list has no effect.
Replies.setState(Feature.State.DISABLED);

promptOptionsEnabledReportTypes

New Usage

If you want to enable or disable the "Report a problem" (submit a bug report) and/or "Suggest an improvement" (submit feedback) Prompt Options independently, you can use the promptOptionsEnabledReportTypes property as displayed​ below.

BugReporting.setReportTypes(BugReporting.ReportType.BUG, BugReporting.ReportType.FEEDBACK);

setOnNewReplyReceivedCallback

Previous Usage

Instabug.setOnNewReplyRecievedCallback(new Runnable() {
	//Your code goes here.
});

New Usage

Replies.setOnNewReplyReceivedCallback(new Runnable() {
	//Your code goes here.
});

setReplyNotificationEnabled

Previous Usage

Instabug.setReplyNotificationEnabled(false);

New Usage

Replies.setInAppNotificationEnabled(false);

getUnreadMessagesCount

Previous Usage

Instabug.getUnreadMessagesCount();

New Usage

Replies.getUnreadRepliesCount();

setPushNotificationState

Previous Usage

new Instabug.Builder(this, "APP_TOKEN")
      .setPushNotificationState(ENABLED)
      .build():

New Usage

Replies.setPushNotificationState(Feature.State.ENABLED);

setPushNotificationRegistrationToken

Previous Usage

Instabug.setPushNotificationRegistrationToken("PUSH_NOTIFICATION_TOKEN");

New Usage

Replies.setPushNotificationRegistrationToken("PUSH_NOTIFICATION_TOKEN");

isInstabugNotification

Previous Usage

Instabug.isInstabugNotification(Bundle data);
Instabug.isInstabugNotification(Map<String, String> data);

New Usage

Replies.isInstabugNotification(Bundle data);
Replies.isInstabugNotification(Map<String, String> data);

showNotification

Previous Usage

if(Instabug.isInstabugNotification(data)){
  //Shown notification related to Instabug
  Instabug.showNotification(data);
}

New Usage

if(Replies.isInstabugNotification(data)){
  //Shown notification related to Instabug
  Replies.showNotification(data);
}

setInAppReplyNotificationSound

Previous Usage

Instabug.setInAppNotificationEnabled(false);

New Usage

Replies.setInAppNotificationEnabled(false);

setSystemReplyNotificationSoundEnabled

Previous Usage

Instabug.setSystemReplyNotificationSoundEnabled(boolean shouldPlaySound);

New Usage

Replies.setSystemReplyNotificationSoundEnabled(boolean shouldPlaySound);

setShouldPlayConversationSounds

Previous Usage

Instabug.setShouldPlayConversationSounds(false);

New Usage

Replies.setShouldPlayConversationSounds(false);

setNotificationIcon

Previous Usage

Instabug.setNotificationIcon(@DrawableRes int notificationIcon);

New Usage

Replies.setNotificationIcon(@DrawableRes int notificationIcon);

setPushNotificationChannelId

Previous Usage

Instabug.setPushNotificationChannelId(String pushNotificationChannelId);

New Usage

Replies.setPushNotificationChannelId(String pushNotificationChannelId);

setCrashReportingState

Previous Usage

// Enable
setCrashReportingState(Feature.State.ENABLED);
// Disable
setCrashReportingState(Feature.State.DISABLED);

New Usage

// Enable
CrashReporting.setState(Feature.State.ENABLED);
// Disable
CrashReporting.setState(Feature.State.DISABLED);

setSurveysState

Previous Usage

// Enable
setSurveysState(Feature.State.ENABLED);
// Disable
setSurveysState(Feature.State.DISABLED);

New Usage

// Enable
Surveys.setState(Feature.State.ENABLED);
// Disable
Surveys.setState(Feature.State.DISABLED);