这是indexloc提供的服务,不要输入任何密码
Skip to content

FCM Messaging breaks in version 7.0.0 or after #2590

@basvandenheuvel

Description

@basvandenheuvel
  • Operating System version: Windows 10
  • Browser version: Chrome 79
  • Firebase SDK version: 7.0.0+
  • Firebase Product: Messaging

Problem

Currently we are using Firebase SDK 6.5.0. Whenever we update to version 7.0.0 or later (we tried multiple versions including 7.0.0 and 7.8.0) Messaging stops working.
It looks like the background messaging keeps working when the website does not have focus. However when the website does have focus the FCM messaging does not work.

Ofcourse we followed the changelog and enabled the FCM Messaging API.

Relevant Code:

The following code is used in version 6.5.0 and works fine, but breaks in 7.0.0 or after:

// Imports
import * as firebase from 'firebase/app';
import 'firebase/messaging';
// Messaging
this.messaging = firebase.messaging();
// Subscribing to messages 
this.messaging.onMessage((result: any) => {
    console.log(result);
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions