Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
Ionic/cloud-angular FacebookAuth gives empty error

I've added ionic cloud services to my app and want to use the native FaceBook authentication.

import { FacebookAuth } from '@ionic/cloud-angular';

this.facebookAuth.login()

When running this function on an Android phone, as expected I get the Facebook prompt to ask if my app can get permissions to read profile and email. When I click YES, the function returns an empty ERROR object:

Object {}

I'm sure I am catching it right, because when I choose CANCEL on the FB prompt, I get this error object:

Object {errorCode: "4201", errorMessage: "User cancelled dialog"}

Note: I'm using remote web inspector in chrome to see the full console. Unfortunately, as this requires a real device I can not Plunker this. However, I hope someone has an idea why this could happen. I have followed all these steps, including the FB developer settings, the hash and the ionic.io settings.

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I have done that and it's working fine on the real device.If you have any question, please comment below.

Play with Git Repo

enter image description here

app.module.ts

import { CloudSettings, CloudModule } from '@ionic/cloud-angular';

const cloudSettings: CloudSettings = {
  'core': {
    'app_id': 'd32c02d2'
  },
  'auth': {
    'facebook': {
      'scope': ['public_profile', 'email']
    }
  }
};

@NgModule({
  declarations: [
   ],
  imports: [
    CloudModule.forRoot(cloudSettings)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
   ],
  providers: [

  ]
})
export class AppModule { }

home.html

 <button ion-button block type="button" (click)="fbLogin()">Fb Login</button>

home.ts

import { Component } from '@angular/core';
import { FacebookAuth, User } from '@ionic/cloud-angular';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public facebookAuth: FacebookAuth, public user: User) {

  }

  fbLogin() {
    this.facebookAuth.login();
  }

}
about 4 years ago · Santiago Trujillo Relatório

0

Ok it's quite silly, but the first root cause was that the FB user I was trying to log in with was not registered as a tester. Apparently in that case, an empty error is returned by the plugin.

After adding as a tester, I received a real error (Andoird manifest dod not allow internet access). After fixing that issue, again I'm getting an empty error.

So my assumption is that some of the errors returned by FB are not well communicated by the plugin and so any other FB error can be causing this issue.

UPDATE 23/04: There seems to be a change from FB side, now the FB login screen did not succeed but gave an error about the hashing key. After fixing that issue, the FB login is working now.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda