Skip to content

Commit 6316411

Browse files
authored
Feature/ibgcore 5521 (#32)
* πŸ”₯ Remove native Android SDK deprecated APIs * ✨ Map new Android APIs for splitting chats * ✨ Add new string for starting chats * πŸ“ Change APIs that have been moved to the Replies module in Android * πŸ› fix all API calls to be static in Android * ✨ Add new iOS enums for splitting chats * πŸ”₯ Remove deprecated methods from JS mappings * πŸ”₯ remove deprecated methods from native iOS SDK * ✨ Add new iOS APIs for splitting chats * πŸ”₯ Deprecate old bug reporting APIs * ✨ Add new JS APIs and modules for splitting chats * πŸ”₯ Remove BugReporting.dismiss() * πŸ“ Move BugReporting.onReportSubmitHandler to Instabug.onReportSubmitHandler * πŸ”₯ Clean up iOS native mapping class * ✨ Add helper js event emitter * ✨ Move chats APIs from Instabug to Replies * πŸ”₯ Deprecate chats APIs in the module Instabug * πŸ“ Add android deprecation logs and fix some methods that were changed from native * πŸ“ Move crash APIs to new CrashReporting module * πŸ“ changes in ios mapping class to match native changes and add deprecation logger * πŸ“ change sample app to use newly added APIs instead of deprecated ones
1 parent 1e1c196 commit 6316411

File tree

68 files changed

+1409
-1777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1409
-1777
lines changed

β€ŽInstabugSample/App.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ScrollView
1717
} from 'react-native';
1818

19-
import Instabug, {BugReporting, FeatureRequests, Surveys} from'instabug-reactnative';
19+
import Instabug, {BugReporting, FeatureRequests, Surveys, Chats, CrashReporting, Replies} from'instabug-reactnative';
2020

2121

2222
const instructions = Platform.select({
@@ -36,8 +36,7 @@ export default class App extends Component<{}> {
3636
};
3737

3838
Instabug.startWithToken("APP_TOKEN", [Instabug.invocationEvent.shake]);
39-
Instabug.setReportCategories("Performance","UI","Flow","Other");
40-
Instabug.setPromptOptionsEnabled(true, true, true);
39+
BugReporting.setReportTypes([BugReporting.reportType.bug, BugReporting.reportType.feedback]);
4140
Instabug.setLocale(Instabug.locale.english);
4241
}
4342

@@ -140,7 +139,7 @@ export default class App extends Component<{}> {
140139
}
141140

142141
invoke() {
143-
BugReporting.invoke();
142+
Instabug.show();
144143
}
145144

146145
showMultipleQuestionSurvey() {
@@ -156,20 +155,21 @@ export default class App extends Component<{}> {
156155
}
157156

158157
sendBugReport() {
159-
BugReporting.invokeWithInvocationModeAndOptions(BugReporting.invocationMode.newBug, []);
158+
BugReporting.showWithOptions(BugReporting.reportType.bug);
160159
}
161160

162161
sendCrashReport() {
163162
try {
164163
throw new Error('Text Handled Exception From Instabug Test App');
165164
} catch (Exception) {
166-
Instabug.reportJSException(Exception);
165+
CrashReporting.reportJSException(Exception);
167166
alert('Crash report Sent!');
168167
}
169168
}
170169

171170
sendFeedback() {
172-
BugReporting.invokeWithInvocationModeAndOptions(BugReporting.invocationMode.newFeedback, []);
171+
BugReporting.showWithOptions(BugReporting.reportType.feedback, [BugReporting.option.emailFieldHidden]);
172+
173173
}
174174

175175
changeInvocationEvent(invocationEvent) {
@@ -186,11 +186,11 @@ export default class App extends Component<{}> {
186186
}
187187

188188
startNewConversation() {
189-
BugReporting.invokeWithInvocationModeAndOptions(BugReporting.invocationMode.newChat, []);
189+
Chats.show();
190190
}
191191

192192
showUnreadMessagesCount() {
193-
Instabug.getUnreadMessagesCount((count) => {
193+
Replies.getUnreadRepliesCount((count) => {
194194
alert("Messages: " + count);
195195
});
196196
}

β€ŽInstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public boolean getUseDeveloperSupport() {
2424
protected List<ReactPackage> getPackages() {
2525
return Arrays.<ReactPackage>asList(
2626
new MainReactPackage(),
27-
new RNInstabugReactnativePackage.Builder("068ba9a8c3615035e163dc5f829c73be",MainApplication.this)
27+
new RNInstabugReactnativePackage.Builder("APP_TOKEN",MainApplication.this)
2828
.setInvocationEvent("shake")
2929
.setPrimaryColor("#1D82DC")
3030
.setFloatingEdge("right")

β€ŽInstabugSample/package-lock.json

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žandroid/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525

2626
dependencies {
2727
implementation 'com.facebook.react:react-native:+'
28-
api ('com.instabug.library:instabug:8.0.18'){
28+
api ('com.instabug.library:instabug:8.1.1'){
2929
exclude group: 'com.android.support:appcompat-v7'
3030
}
3131
}

0 commit comments

Comments
Β (0)