0
import { Injectable } from '@angular/core';
import { AngularFireMessaging } from '@angular/fire/messaging';

@Injectable()
export class FcmService {

    constructor(private messaging: AngularFireMessaging) {}

    getToken() {
        this.messaging.requestToken
            .subscribe(
                (token) => {
                    alert('Permission granted! Save to the server!' + token);
                },
                (error) => {
                    alert(error);
                },
            );
    }
}

and after i build the app and launch it in android i am getting

FirebaseError: Messaging: this browser doesn't support the API's required to use the firebase SDK. (messaging/unsupported-browser)

harry
  • 31
  • 5

0 Answers0