Ionic FirebaseX getToken() not return any data

413 views Asked by At

I start connecting Firebase Cloud Messaging to Ionic + Angular, but when I call method const token = await this.firebase.getToken(); I don't get anything. Application keeps working, but I still don't get the token. Full code:

async getToken() {
  const hasPermission = await this.firebase.hasPermission();
  if (Capacitor.getPlatform() === 'ios' && !hasPermission) {
    await this.firebase.grantPermission();
  }

  const token = await this.firebase.getToken();
  this.saveToken(token);
}

I added GoogleService-Info.plist to the root of my app:

GoogleService-Info.plist

In addition, in my firebase account I already upload my APNs Auth Key and I created certificates on AppleDeveloper Acc. The application identificator the same in Apple, Application and Firebase.

What I did wrong?

0

There are 0 answers