mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
fix(web-intent): registerBroadcastReceiver as Observable (#2491)
* Correcting format of registerBroadcastReceiver, current implementation provides no way to receive the registered broadcasts.
Usage is as follows:
webintent.registerBroadcastReceiver({
filterActions: [
'com.example.ACTION'
],
filterCategories: [
'android.intent.category.DEFAULT'
]
}).subscribe((intent) => {console.log('Received Intent: ' + JSON.stringify(intent.extras));});
* Resolving linting errors
* Resolving additional linting error
This commit is contained in:
@@ -194,9 +194,14 @@ export class WebIntent extends IonicNativePlugin {
|
||||
/**
|
||||
* Registers a broadcast receiver for the specified filters
|
||||
* @param filters {any}
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
registerBroadcastReceiver(filters: any): void {}
|
||||
@Cordova({
|
||||
observable: true
|
||||
})
|
||||
registerBroadcastReceiver(filters: any): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters a broadcast receiver
|
||||
|
||||
Reference in New Issue
Block a user