Skip to content

Documentation

Yousef Hamza edited this page Feb 8, 2017 · 3 revisions

Instabug

Instabug

Instabug.invocationEvent : enum

The event used to invoke the feedback form

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
none number Instabug.invocationEventNone
shake number Instabug.invocationEventShake
screenshot number Instabug.invocationEventScreenshot
twoFingersSwipe number Instabug.invocationEventTwoFingersSwipe
floatingButton number Instabug.invocationEventFloatingButton

Instabug.dismissType : enum

Type of SDK dismiss

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
submit number Instabug.dismissTypeSubmit
cancel number Instabug.dismissTypeCancel
addAttachment number Instabug.dismissTypeAddAttachment

Instabug.reportType : enum

Type of report to be submit

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
bug number Instabug.reportTypeBug
feedback number Instabug.reportTypeFeedback

Instabug.invocationMode : enum

The mode used upon invocating the SDK

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
NA number Instabug.invocationModeNA
newBug number Instabug.invocationModeNewBug
newFeedback number Instabug.invocationModeNewFeedback
newChat number Instabug.invocationModeNewChat
chatsList number Instabug.invocationModeChatsList

Instabug.locale : enum

The supported locales

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
arabic number Instabug.localeArabic
chineseSimplified number Instabug.localeChineseSimplified
chineseTraditional number Instabug.localeChineseTraditional
czech number Instabug.localeCzech
danish number Instabug.localeDanish
english number Instabug.localeEnglish
french number Instabug.localeFrench
german number Instabug.localeGerman
italian number Instabug.localeItalian
japanese number Instabug.localeJapanese
polish number Instabug.localePolish
portugueseBrazil number Instabug.localePortugueseBrazil
russian number Instabug.localeRussian
spanish number Instabug.localeSpanish
swedish number Instabug.localeSwedish
turkish number Instabug.localeTurkish

Instabug.colorTheme : enum

The color theme of the different UI elements

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
light number Instabug.colorThemeLight
dark number Instabug.colorThemeDark

Instabug.rectEdge : enum

Rectangle edges

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
minX number Instabug.rectMinXEdge
minY number Instabug.rectMinYEdge
maxX number Instabug.rectMaxXEdge
maxY number Instabug.rectMaxYEdge

Instabug.strings : enum

Instabug strings

Kind: static enum of Instabug
Read only: true
Properties

Name Type Default
shakeHint number Instabug.shakeHint
swipeHint number Instabug.swipeHint
edgeSwipeStartHint number Instabug.edgeSwipeStartHint
startAlertText number Instabug.startAlertText
invalidEmailMessage number Instabug.invalidEmailMessage
invalidEmailTitle number Instabug.invalidEmailTitle
invalidCommentMessage number Instabug.invalidCommentMessage
invalidCommentTitle number Instabug.invalidCommentTitle
invocationHeader number Instabug.invocationHeader
talkToUs number Instabug.talkToUs
reportBug number Instabug.reportBug
reportFeedback number Instabug.reportFeedback
emailFieldHint number Instabug.emailFieldHint
commentFieldHintForBugReport number Instabug.commentFieldHintForBugReport
commentFieldHintForFeedback number Instabug.commentFieldHintForFeedback
addVideoMessage number Instabug.addVideoMessage
addVoiceMessage number Instabug.addVoiceMessage
addImageFromGallery number Instabug.addImageFromGallery
addExtraScreenshot number Instabug.addExtraScreenshot
audioRecordingPermissionDeniedTitle number Instabug.audioRecordingPermissionDeniedTitle
audioRecordingPermissionDeniedMessage number Instabug.audioRecordingPermissionDeniedMessage
microphonePermissionAlertSettingsButtonText number Instabug.microphonePermissionAlertSettingsButtonText
recordingMessageToHoldText number Instabug.recordingMessageToHoldText
recordingMessageToReleaseText number Instabug.recordingMessageToReleaseText
conversationsHeaderTitle number Instabug.conversationsHeaderTitle
screenshotHeaderTitle number Instabug.screenshotHeaderTitle
chatsNoConversationsHeadlineText number Instabug.chatsNoConversationsHeadlineText
doneButtonText number Instabug.doneButtonText
okButtonText number Instabug.okButtonText
cancelButtonText number Instabug.cancelButtonText
thankYouText number Instabug.thankYouText
audio number Instabug.audio
video number Instabug.video
image number Instabug.image
chatsHeaderTitle number Instabug.chatsHeaderTitle
team number Instabug.team
messageNotification number Instabug.messageNotification
messagesNotificationAndOthers number Instabug.messagesNotificationAndOthers

Instabug.startWithToken(token, invocationEvent)

Starts the SDK. This is the main SDK method that does all the magic. This is the only method that SHOULD be called. Should be called in constructor of the app registery component

Kind: static method of Instabug

Param Type Description
token string The token that identifies the app, you can find it on your dashboard.
invocationEvent invocationEvent The event that invokes the SDK's UI.

Instabug.invoke()

Invokes the SDK manually with the default invocation mode. Shows a view that asks the user whether they want to start a chat, report a problem or suggest an improvement.

Kind: static method of Instabug

Instabug.invokeWithInvocationMode(invocationMode)

Invokes the SDK with a specific mode. Invokes the SDK and show a specific view, instead of showing a prompt for users to choose from.

Kind: static method of Instabug

Param Type Description
invocationMode invocationMode Specifies which mode the SDK is going to start with.

Instabug.dismiss()

Dismisses any Instabug views that are currently being shown.

Kind: static method of Instabug

Instabug.setFileAttachment(fileLocation)

Attaches a file to each report being sent. A new copy of the file at fileLocation will be attached with each bug report being sent. Each call to this method overrides the file to be attached. The file has to be available locally at the provided path.

Kind: static method of Instabug

Param Type Description
fileLocation string Path to a file that's going to be attached to each report.

Instabug.setUserData(userData)

Attaches user data to each report being sent. Each call to this method overrides the user data to be attached. Maximum size of the string is 1,000 characters.

Kind: static method of Instabug

Param Type Description
userData string A string to be attached to each report, with a maximum size of 1,000 characters.

Instabug.IBGLog(log)

Adds custom logs that will be sent with each report.

Kind: static method of Instabug

Param Type Description
log string Message to be logged.

Instabug.setUserStepsEnabled(isUserStepsEnabled)

Sets whether the SDK is tracking user steps or not. Enabling user steps would give you an insight on the scenario a user has performed before encountering a bug or a crash. User steps are attached with each report being sent.

Kind: static method of Instabug

Param Type Description
isUserStepsEnabled boolean A boolean to set user steps tracking to being enabled or disabled.

Instabug.setPreSendingHandler(preSendingHandler)

Sets a block of code to be executed before sending each report. This block is executed in the background before sending each report. Could be used for attaching logs and extra data to reports.

Kind: static method of Instabug

Param Type Description
preSendingHandler preSendingHandler A callback that gets executed before sending each bug report.

Instabug.setPreInvocationHandler(preInvocationHandler)

Sets a block of code to be executed just before the SDK's UI is presented. This block is executed on the UI thread. Could be used for performing any UI changes before the SDK's UI is shown.

Kind: static method of Instabug

Param Type Description
preInvocationHandler preInvocationHandler A callback that gets executed before invoking the SDK

Instabug.setPostInvocationHandler(postInvocationHandler)

Sets a block of code to be executed right after the SDK's UI is dismissed. This block is executed on the UI thread. Could be used for performing any UI changes after the SDK's UI is dismissed.

Kind: static method of Instabug

Param Type Description
postInvocationHandler postInvocationHandler A callback to get executed after dismissing the SDK.

Instabug.showIntroMessage()

Present a view that educates the user on how to invoke the SDK with the currently set invocation event.

Kind: static method of Instabug

Instabug.setUserEmail(userEmail)

Sets the default value of the user's email and hides the email field from the reporting UI. Defaults to an empty string.

Kind: static method of Instabug

Param Type Description
userEmail string An email address to be set as the user's email.

Instabug.setUserName(userName)

Sets the default value of the user's name to be included with all reports. Defaults to an empty string.

Kind: static method of Instabug

Param Type Description
userName string Name of the user to be set.

Instabug.setWillSkipScreenshotAnnotation(willSkipScreenshotAnnotation)

Enables/disables screenshot view when reporting a bug/improvement. By default, screenshot view is shown when reporting a bug, but not when sending feedback.

Kind: static method of Instabug

Param Type Description
willSkipScreenshotAnnotation boolean sets whether screenshot view is shown or not. Passing YES will show screenshot view for both feedback and bug reporting, while passing NO will disable it for both.

Instabug.getUnreadMessagesCount(messageCountCallback)

Returns the number of unread messages the user currently has. Use this method to get the number of unread messages the user has, then possibly notify them about it with your own UI.

Kind: static method of Instabug

Param Type Description
messageCountCallback messageCountCallback callback with argument Notifications count, or -1 incase the SDK has not been initialized.

Instabug.setInvocationEvent(invocationEvent)

Sets the event that invoke the feedback form. Default is set by Instabug.startWithToken.

Kind: static method of Instabug

Param Type Description
invocationEvent invocationEvent Event that invokes the feedback form.

Instabug.setPushNotificationsEnabled(isPushNotificationEnabled)

Enables/disables the use of push notifications in the SDK. Defaults to YES.

Kind: static method of Instabug

Param Type Description
isPushNotificationEnabled boolean A boolean to indicate whether push notifications are enabled or disabled.

Instabug.setEmailFieldRequired(isEmailFieldRequired)

Sets whether users are required to enter an email address or not when sending reports. Defaults to YES.

Kind: static method of Instabug

Param Type Description
isEmailFieldRequired boolean A boolean to indicate whether email field is required or not.

Instabug.setCommentFieldRequired(isCommentFieldRequired)

Sets whether users are required to enter a comment or not when sending reports. Defaults to NO.

Kind: static method of Instabug

Param Type Description
isCommentFieldRequired boolean A boolean to indicate whether comment field is required or not.

Instabug.setShakingThresholdForIPhone(iPhoneShakingThreshold, iPadShakingThreshold)

Sets the threshold value of the shake gesture for iPhone/iPod Touch and iPad. Default for iPhone is 2.5. Default for iPad is 0.6.

Kind: static method of Instabug

Param Type Description
iPhoneShakingThreshold number Threshold for iPhone.
iPadShakingThreshold number Threshold for iPad.

Instabug.setFloatingButtonEdge(floatingButtonEdge, offsetFromTop)

Sets the default edge and offset from the top at which the floating button will be shown. Different orientations are already handled. Default for floatingButtonEdge is rectEdge.maxX. Default for floatingButtonOffsetFromTop is 50

Kind: static method of Instabug

Param Type Description
floatingButtonEdge rectEdge maxX to show on the right, or minX to show on the left.
offsetFromTop number floatingButtonOffsetFromTop Top offset for floating button.

Instabug.setLocale(locale)

Sets the SDK's locale. Use to change the SDK's UI to different language. Defaults to the device's current locale.

Kind: static method of Instabug

Param Type Description
locale locale A locale to set the SDK to.

Instabug.setIntroMessageEnabled(isIntroMessageEnabled)

Sets whether the intro message that gets shown on launching the app is enabled or not. Defaults to YES.

Kind: static method of Instabug

Param Type Description
isIntroMessageEnabled boolean A boolean to indicate whether the intro message is enabled or not.

Instabug.setColorTheme(colorTheme)

Sets the color theme of the SDK's whole UI. the SDK's UI to.

Kind: static method of Instabug

Param
colorTheme

Instabug.setPrimaryColor(primaryColor)

Sets the primary color of the SDK's UI. Sets the color of UI elements indicating interactivity or call to action. To use, import processColor and pass to it with argument the color hex as argument.

Kind: static method of Instabug

Param Type Description
primaryColor color A color to set the UI elements of the SDK to.

Instabug.appendTags(tags)

Appends a set of tags to previously added tags of reported feedback, bug or crash.

Kind: static method of Instabug

Param Type Description
tags Array.<string> An array of tags to append to current tags.

Instabug.resetTags()

Manually removes all tags of reported feedback, bug or crash.

Kind: static method of Instabug

Instabug.getTags(tagsCallback)

Gets all tags of reported feedback, bug or crash.

Kind: static method of Instabug

Param Type Description
tagsCallback tagsCallback callback with argument tags of reported feedback, bug or crash.

Instabug.setStringToKey(string, key)

Overrides any of the strings shown in the SDK with custom ones. Allows you to customize any of the strings shown to users in the SDK.

Kind: static method of Instabug

Param Type Description
string string String value to override the default one.
key strings Key of string to override.

Instabug.setAttachmentTypesEnabled(screenshot, extraScreenshot, galleryImage, voiceNote, screenRecording)

Sets whether attachments in bug reporting and in-app messaging are enabled or not.

Kind: static method of Instabug

Param Type Description
screenshot boolean A boolean to enable or disable screenshot attachments.
extraScreenshot boolean A boolean to enable or disable extra screenshot attachments.
galleryImage boolean A boolean to enable or disable gallery image attachments. In iOS 10+,NSPhotoLibraryUsageDescription should be set in info.plist to enable gallery image attachments.
voiceNote boolean A boolean to enable or disable voice note attachments. In iOS 10+, NSMicrophoneUsageDescription should be set in info.plist to enable voiceNote attachments.
screenRecording boolean A boolean to enable or disable screen recording attachments.

Instabug.setChatNotificationEnabled(isChatNotificationEnabled)

Enables/disables showing in-app notifications when the user receives a new message.

Kind: static method of Instabug

Param Type Description
isChatNotificationEnabled boolean A boolean to set whether notifications are enabled or disabled.

Instabug.setOnNewMessageHandler(onNewMessageHandler)

Sets a block of code that gets executed when a new message is received.

Kind: static method of Instabug

Param Type Description
onNewMessageHandler onNewMessgaeHandler A callback that gets executed when a new message is received.

Instabug.setPromptOptions(isBugReportingEnabled, isFeedbackReportingEnabled, isChatEnabled)

Enables/disables prompt options when SDK is invoked. When only a single option is enabled, it become the default invocation mode. If all options are disabled, bug reporting becomes the default invocation mode. By default, all three options are enabled.

Kind: static method of Instabug

Param Type Description
isBugReportingEnabled boolean A boolean to indicate whether bug reports are enabled or disabled.
isFeedbackReportingEnabled boolean A boolean to indicate whether feedback is enabled or disabled.
isChatEnabled boolean A boolean to indicate whether chat is enabled or disabled.

Instabug.isInstabugNotification(dict, isInstabugNotificationCallback)

Checks if a notification is from Instabug. If you are using push notifications, use this method to check whether an incoming notification is from Instabug or not. If this method returns YES, you should call didReceiveRemoteNotification: to let the Instabug handle the notification. Otherwise, handle the notification on your own.

Kind: static method of Instabug

Param Type Description
dict Object Notification's userInfo
isInstabugNotificationCallback isInstabugNotificationCallback callback with argument isInstabugNotification

Instabug~preSendingHandler : function

A callback that gets executed before sending each bug report.

Kind: inner typedef of Instabug

Instabug~preSendingHandler : function

Sets a block of code to be executed just before the SDK's UI is presented. This block is executed on the UI thread. Could be used for performing any UI changes before the SDK's UI is shown.

Kind: inner typedef of Instabug

Instabug~postInvocationHandler : function

A callback that gets executed after the SDK's UI is dismissed.

Kind: inner typedef of Instabug

Param Type Description
dismissType dismissType How the SDK was dismissed.
reportType reportType Type of report that has been sent. Will be set to IBGReportTypeBug in case the SDK has been dismissed without selecting a report type, so you might need to check issueState before reportType

Instabug~messageCountCallback : function

return callback

Kind: inner typedef of Instabug
Param{number}: responseCount Notifications count, or -1 incase the SDK has not been initialized.

Instabug~tagsCallback : function

return callback

Kind: inner typedef of Instabug

Param Type Description
tags Array.<string> of reported feedback, bug or crash.

Instabug~onNewMessgaeHandler : function

A callback that gets executed when a new message is received.

Kind: inner typedef of Instabug

Instabug~isInstabugNotificationCallback : function

return callback

Kind: inner typedef of Instabug

Param Type
isInstabugNotification boolean
Clone this wiki locally