baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

After login it doesn't redirect to app #149

Closed walljm closed 3 years ago

walljm commented 3 years ago

I'm probably just missing something...

I've followed the guide in the readme. Everything builds fine. I click login on my app and it jumps me to chrome and asks me to login with a google account, which I do, then the tab closes and it just stops there.

here is my capacitor config:


    "CapacitorFirebaseAuth": {
      "providers": ["google.com"],
      "languageCode": "en",
      "nativeAuth": true,
      "properties": {},
      "permissions": {
           "google": [
             "profile",
             "https://www.googleapis.com/auth/drive",
             "https://www.googleapis.com/auth/contacts.readonly"
            ]
       }
    }

Its like my app isn't picking up the intent...

My app is an angular application. Here is the package.json

{
  "name": "dynamicbible",
  "version": "4.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "test-headless-watch": "ng test --watch=true --browsers=ChromeHeadlessNoSandbox ",
    "test-headless": "ng test --watch=false --browsers=ChromeHeadlessNoSandbox ",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "copy": "npx cap copy",
    "all": "ng lint & ng test --watch=false --browsers=ChromeHeadlessNoSandbox  & ng build --prod & npx cap copy"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~10.0.4",
    "@angular/cdk": "^10.0.2",
    "@angular/common": "~10.0.4",
    "@angular/compiler": "~10.0.4",
    "@angular/core": "~10.0.4",
    "@angular/fire": "^6.0.2",
    "@angular/forms": "~10.0.4",
    "@angular/material": "^10.0.2",
    "@angular/platform-browser": "~10.0.4",
    "@angular/platform-browser-dynamic": "~10.0.4",
    "@angular/router": "~10.0.4",
    "@capacitor/android": "^2.4.0",
    "@capacitor/cli": "^2.4.6",
    "@capacitor/core": "^2.4.6",
    "@capacitor/ios": "^2.4.6",
    "@ngx-pwa/local-storage": "^10.0.1",
    "@types/mathjs": "^6.0.5",
    "angular2-uuid": "^1.1.1",
    "capacitor-firebase-auth": "^2.3.5",
    "component": "^1.1.0",
    "firebase": "^7.13.1",
    "ngx-md": "^8.1.6",
    "redux": "^4.0.5",
    "reselect": "^4.0.0",
    "rxjs": "~6.5.5",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1000.3",
    "@angular/cli": "~10.0.3",
    "@angular/compiler-cli": "~10.0.4",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~3.3.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.9.5",
    "@angular-devkit/architect": ">= 0.900 < 0.1100",
    "firebase-tools": "^8.0.0",
    "fuzzy": "^0.1.3",
    "inquirer": "^6.2.2",
    "inquirer-autocomplete-prompt": "^1.0.1",
    "open": "^7.0.3"
  }
}

Any help you can offer would be appreciated.

walljm commented 3 years ago

I should add that everything works fine on the web (to rule out basic angular firebase auth setup concerns)

walljm commented 3 years ago

I've double checked that my SHA hashes have been added to my firebase project. And my package and app name are also correct.

walljm commented 3 years ago

ah... sigh.

It turned out that I assumed this would just allow the @angular/fire library to do its thing. You have to call the plugin.

Sorry!

pkvince commented 3 years ago

Hey @walljm, I am having the same issue as you. I am curious as to how you managed to resolve it. It is working properly on iOS, but not on Android, which leads me to believe there is something wrong with my Capacitor/Android config.

My frontend app is React and not Angular. Any help you can provide would be really appreciated! :)

Cheers!

walljm commented 3 years ago

hey! @pkvince i never did get this to work properly. Mostly because i couldn't figure out how to integrate the provided library with the firebase library i was using, so I resorted to using this plugin instead: https://github.com/CodetrixStudio/CapacitorGoogleAuth