Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rollbar): Add Rollbar plugin #832

Merged
merged 4 commits into from
Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,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 @@ -195,6 +196,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 @@ -305,6 +307,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; }

}