Skip to content

Commit 229f550

Browse files
akz92ihadeed
authored andcommitted
feat(rollbar): add Rollbar plugin (#832)
* Add Rollbar plugin * Add documentation * Add return type to init function * Remove init params
1 parent 70c15c3 commit 229f550

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ import { PinDialog } from './plugins/pin-dialog';
9090
import { PowerManagement } from './plugins/power-management';
9191
import { Printer } from './plugins/printer';
9292
import { Push } from './plugins/push';
93+
import { Rollbar } from './plugins/rollbar';
9394
import { SafariViewController } from './plugins/safari-view-controller';
9495
import { Screenshot } from './plugins/screenshot';
9596
import { SecureStorage } from './plugins/securestorage';
@@ -204,6 +205,7 @@ export * from './plugins/plugin';
204205
export * from './plugins/power-management';
205206
export * from './plugins/printer';
206207
export * from './plugins/push';
208+
export * from './plugins/rollbar';
207209
export * from './plugins/safari-view-controller';
208210
export * from './plugins/screen-orientation';
209211
export * from './plugins/screenshot';
@@ -319,6 +321,7 @@ window['IonicNative'] = {
319321
ScreenOrientation,
320322
PinDialog,
321323
PowerManagement,
324+
Rollbar,
322325
SafariViewController,
323326
Screenshot,
324327
SecureStorage,

src/plugins/rollbar.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Plugin, Cordova } from './plugin';
2+
3+
/**
4+
* @name Rollbar
5+
* @description
6+
* This plugin adds Rollbar App monitoring to your application
7+
*
8+
* @usage
9+
* ```
10+
* import { Rollbar } from 'ionic-native';
11+
*
12+
* Rollbar.init();
13+
*
14+
* ```
15+
*/
16+
@Plugin({
17+
pluginName: 'Rollbar',
18+
plugin: 'resgrid-cordova-plugins-rollbar',
19+
pluginRef: 'Rollbar',
20+
repo: 'https://github.com/Resgrid/cordova-plugins-rollbar',
21+
platforms: ['Android', 'iOS'],
22+
install: 'ionic plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"'
23+
})
24+
export class Rollbar {
25+
26+
/**
27+
* This function initializes the monitoring of your application
28+
* @return {Promise<any>} Returns a promise that resolves when the plugin successfully initializes
29+
*/
30+
@Cordova()
31+
static init(): Promise<any> { return; }
32+
33+
}

0 commit comments

Comments
 (0)