Skip to content

Commit dcf82bc

Browse files
Add JS API: Instabug.setColorTheme
1 parent 093da66 commit dcf82bc

File tree

1 file changed

+18
-1
lines changed
  • sampleApp/platforms/android/platform_www/plugins/instabug-cordova/www

1 file changed

+18
-1
lines changed

sampleApp/platforms/android/platform_www/plugins/instabug-cordova/www/instabug.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ var getLocales = function () {
4949
};
5050
};
5151

52+
var getColorThemes = function () {
53+
return {
54+
light: 'light',
55+
dark: 'dark',
56+
};
57+
};
58+
5259
var Instabug = function () {
5360
};
5461

@@ -79,7 +86,7 @@ Instabug.startWithToken = function (token, events, options, success, error) {
7986
if (validatedEvents !== undefined || validatedEvents.length != 0) {
8087
exec(success, error, 'IBGPlugin', 'startWithToken', [token, validatedEvents, options]);
8188
} else {
82-
console.log('Could not activate Instabug - invocation event is not valid.');
89+
console.log('Could not activate Instabug - invocation event is not valid.');
8390
}
8491
};
8592

@@ -222,6 +229,16 @@ Instabug.setLocale = function (locale, success, error) {
222229
}
223230
};
224231

232+
Instabug.setColorTheme = function (colorTheme, success, error) {
233+
var validatedColorTheme = getColorThemes()[colorTheme];
234+
235+
if (validatedColorTheme) {
236+
exec(success, error, 'IBGPlugin', 'setColorTheme', [validatedColorTheme]);
237+
} else {
238+
console.log('Could not set color theme - "' + colorTheme + '" is not valid.');
239+
}
240+
};
241+
225242
module.exports = Instabug;
226243

227244
});

0 commit comments

Comments
 (0)