Skip to content

Commit

Permalink
fix(messaging): Fix for the binding issue and onTokenRefresh for Mess…
Browse files Browse the repository at this point in the history
…aging
  • Loading branch information
jamesdaniels committed Sep 21, 2018
1 parent b4eca1b commit e170da1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/messaging/messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class AngularFireMessaging {
);

const tokenChanges = this.messaging.pipe(
switchMap(messaging => new Observable(messaging.onTokenRefresh)),
switchMap(messaging => new Observable(messaging.onTokenRefresh.bind(messaging)).pipe(
switchMap(() => messaging.getToken())
)),
runOutsideAngular(zone)
);

Expand All @@ -62,7 +64,7 @@ export class AngularFireMessaging {
);

this.messages = this.messaging.pipe(
switchMap(messaging => new Observable(messaging.onMessage)),
switchMap(messaging => new Observable(messaging.onMessage.bind(messaging))),
runOutsideAngular(zone)
);

Expand Down

0 comments on commit e170da1

Please sign in to comment.