Skip to content

Commit

Permalink
feat(rollbar): add Rollbar plugin (#832)
Browse files Browse the repository at this point in the history
* Add Rollbar plugin

* Add documentation

* Add return type to init function

* Remove init params
  • Loading branch information
akz92 authored and ihadeed committed Jan 20, 2017
1 parent 70c15c3 commit 229f550
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ import { PinDialog } from './plugins/pin-dialog';
import { PowerManagement } from './plugins/power-management';
import { Printer } from './plugins/printer';
import { Push } from './plugins/push';
import { Rollbar } from './plugins/rollbar';
import { SafariViewController } from './plugins/safari-view-controller';
import { Screenshot } from './plugins/screenshot';
import { SecureStorage } from './plugins/securestorage';
Expand Down Expand Up @@ -204,6 +205,7 @@ export * from './plugins/plugin';
export * from './plugins/power-management';
export * from './plugins/printer';
export * from './plugins/push';
export * from './plugins/rollbar';
export * from './plugins/safari-view-controller';
export * from './plugins/screen-orientation';
export * from './plugins/screenshot';
Expand Down Expand Up @@ -319,6 +321,7 @@ window['IonicNative'] = {
ScreenOrientation,
PinDialog,
PowerManagement,
Rollbar,
SafariViewController,
Screenshot,
SecureStorage,
Expand Down
33 changes: 33 additions & 0 deletions src/plugins/rollbar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Plugin, Cordova } from './plugin';

/**
* @name Rollbar
* @description
* This plugin adds Rollbar App monitoring to your application
*
* @usage
* ```
* import { Rollbar } from 'ionic-native';
*
* Rollbar.init();
*
* ```
*/
@Plugin({
pluginName: 'Rollbar',
plugin: 'resgrid-cordova-plugins-rollbar',
pluginRef: 'Rollbar',
repo: 'https://github.com/Resgrid/cordova-plugins-rollbar',
platforms: ['Android', 'iOS'],
install: 'ionic plugin add resgrid-cordova-plugins-rollbar --variable ROLLBAR_ACCESS_TOKEN="YOUR_ROLLBAR_ACCEESS_TOKEN" --variable ROLLBAR_ENVIRONMENT="ROLLBAR_ENVIRONMENT"'
})
export class Rollbar {

/**
* This function initializes the monitoring of your application
* @return {Promise<any>} Returns a promise that resolves when the plugin successfully initializes
*/
@Cordova()
static init(): Promise<any> { return; }

}

0 comments on commit 229f550

Please sign in to comment.