Skip to content

Commit

Permalink
fix(web-intent): registerBroadcastReceiver as Observable (#2491)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
darryncampbell authored and danielsogl committed May 1, 2018
1 parent a1c54f3 commit 47f7397
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/@ionic-native/plugins/web-intent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47f7397

Please sign in to comment.