Skip to content

Commit

Permalink
fix(one-signal): return Observable instead of promise (#352)
Browse files Browse the repository at this point in the history
* Added OneSignal wrapper

* documentation

* Changes for callback of notification revieced

* fixes for @cordova decorators without Promise return

* Merge

* Improvements to OneSignal
extended init function with notificationOpenedCallback as an optional parameter

* Platforms removed
OneSignal supports more than only these 3 platforms. It's available to nearly all Cordova platforms.

* Init method turned into observable
  • Loading branch information
Aaron Czichon authored and ihadeed committed Jul 25, 2016
1 parent 8b9e317 commit 08fe04e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/plugins/onesignal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';


/**
Expand Down Expand Up @@ -28,8 +29,7 @@ import { Cordova, Plugin } from './plugin';
@Plugin({
plugin: 'onesignal-cordova-plugin',
pluginRef: 'plugins.OneSignal',
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK',
platforms: ['Android', 'iOS', 'Windows Phone 8']
repo: 'https://github.com/OneSignal/OneSignal-Cordova-SDK'
})
export class OneSignal {

Expand All @@ -38,14 +38,14 @@ export class OneSignal {
*
* @param {appId} Your AppId from your OneSignal app
* @param {options} The Google Project Number (which you can get from the Google Developer Potal) and the autoRegister option.
* @returns {Promise} Returns a Promise that resolves when remote notification was recieved.
* @returns {Observable} when a notification is received. Handle your notification action here.
*/
@Cordova()
@Cordova({ observable: true })
static init(appId: string,
options: {
googleProjectNumber: string,
autoRegister: boolean
}): Promise<any> { return; }
}): Observable<any> { return; }


/**
Expand Down Expand Up @@ -253,4 +253,4 @@ export class OneSignal {
visualLevel: number
}): void { }

}
}

0 comments on commit 08fe04e

Please sign in to comment.