mkloubert / nativescript-social-login

NativeScript plugin for social (token based) log-ins.
MIT License
42 stars 44 forks source link

IOS Google Login not working #38

Open ntaylor2 opened 6 years ago

ntaylor2 commented 6 years ago

Hi,

I have a NativeScript application set up that is using the following: nativescript-social-login: 3.0.8 tns-core-modules: 3.4.0 tns-ios: 3.4.1 iOS Simulator: iPhone X w/ iOS version 11.2

I followed all of the instructions to set up logging in with Google, but when I call loginWithGoogle(..) the app crashes. The only relevant line in the iOS simulator log I can find is the following:

Feb 22 20:12:51 ntaylor com.apple.CoreSimulator.SimDevice.FDFA920F-2D38-4B59-A765-E5F23F0788CD[77084] (UIKitApplication:com.edufinity.LabStudyGuide[0x63e5][77110][77576]): Service exited due to signal: Segmentation fault: 11 sent by exc handler[0]

Any ideas how to get past this issue?

jogboms commented 6 years ago

@ntaylor2 Thanks for reporting this. But could you confirm if the demo app run in your environment?

ntaylor2 commented 6 years ago

@jogboms The demo app is showing an error in my local environment.

Domain=com.google.GIDSignIn Code=-2 UserInfo=(NSLocalizedDescription=keychain error)

Am I doing something incorrect when running the demo app? I added a server client ID for Google on the setup screen.

jogboms commented 6 years ago

@ntaylor2 I have a feeling that has to do with xcode and keychains. I saw a similar issue here. Take a look and see if it helps

NikicaAsanin commented 6 years ago

Same problem here with google login.

jogboms commented 6 years ago

@NikicaAsanin can you also see here?

valeraf commented 6 years ago

Hi, I have same problem with login with Google, demo app is working, had to change something in package.json, but it doesn't really matters

After hours of trials, I give up ...

Here is my package.json

{
  "description": "Purff beauty application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.purff",
    "tns-ios": {
      "version": "3.4.1"
    },
    "tns-android": {
      "version": "3.4.2"
    }
  },
  "scripts": {
    "lint": "tslint \"app/**/*.ts\""
  },
  "dependencies": {
    "@angular/animations": "~5.2.0",
    "@angular/common": "~5.2.0",
    "@angular/compiler": "~5.2.0",
    "@angular/core": "~5.2.0",
    "@angular/forms": "~5.2.0",
    "@angular/http": "~5.2.0",
    "@angular/platform-browser": "~5.2.0",
    "@angular/platform-browser-dynamic": "~5.2.0",
    "@angular/router": "~5.2.0",
    "nativescript-angular": "~5.2.0",
    "nativescript-social-login": "^4.0.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-calendar": "^3.5.1",
    "nativescript-ui-dataform": "^3.5.2",
    "nativescript-ui-listview": "^3.5.2",
    "nativescript-ui-sidedrawer": "^3.5.1",
    "reflect-metadata": "~0.1.10",
    "rxjs": "~5.5.5",
    "tns-core-modules": "^4.0.0",
    "zone.js": "~0.8.18"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~5.2.0",
    "@ngtools/webpack": "~1.9.4",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "codelyzer": "~4.0.2",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "~1.3.5",
    "nativescript-dev-typescript": "~0.6.0",
    "nativescript-dev-webpack": "~0.9.1",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "sass-loader": "~6.0.6",
    "tns-platform-declarations": "^4.0.0",
    "tslint": "~5.8.0",
    "typescript": "~2.6.2",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0"
  },
  "author": "Valerii Fazli"
}

info.plist file

....
<key>CFBundleURLTypes</key>
    <array>
        <!-- GOOGLE START -->
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.googleusercontent.apps.460640157837-vlpjb09auurgof7jjk8ht5ppv5u8v36e</string>
            </array>
        </dict>
        <!-- GOOGLE END -->
        <!-- FACEBOOK START -->
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb1402026049901890</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>FacebookAppID</key>
        <string>1402026049901890</string>
    <key>FacebookDisplayName</key>
    <string>Purff</string>
<!-- FACEBOOK END -->

GoogleService-Info.plist downloaded from google console:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CLIENT_ID</key>
  <string>460640157837-vlpjb09auurgof7jjk8ht5ppv5u8v36e.apps.googleusercontent.com</string>
  <key>REVERSED_CLIENT_ID</key>
  <string>com.googleusercontent.apps.460640157837-vlpjb09auurgof7jjk8ht5ppv5u8v36e</string>
  <key>PLIST_VERSION</key>
  <string>1</string>
  <key>BUNDLE_ID</key>
  <string>org.nativescript.purff</string>
</dict>
</plist>

Login to Facebook - working Login to Google - not

Could you please check/recommend me something ?

Thanks

jogboms commented 6 years ago

@valeraf If you have a similar issue, can you also see here?

valeraf commented 6 years ago

@jogboms sure, i Checked there too. I didn't understand how to enable keychain sharing Also checked your demo app, and in your app, from what I can see, Keychain sharing is disabled. So maybe not the case ?

jogboms commented 6 years ago

Oh. Okay.

mdconaway commented 6 years ago

Is there a distinct place in the social login code that is known to be causing this issue? I am trying to port an Android app to iOS, and google login fails. (needed for anything else in the app to work)

If it is being caused by key sharing, is there a way to enable key sharing as part of the nativescript ios configuration?

I am currently running XCode 9.3.

jogboms commented 6 years ago

@mdconaway @valeraf @NikicaAsanin @ntaylor2 honestly, I really don't see why it should fail hence why I've labeled this issue as help is needed since I use this in an app in production and everything works as expected. Even running the demo app works as expected on my machine. There hasn't been any way to debug these new issues as I have also not had any free time of late.

valeraf commented 6 years ago

@mdconaway @valeraf @NikicaAsanin @ntaylor2 @jogboms Probably found a way to make it work,

  1. added this hook
  2. created app.entitlements file in the app/App_Resources/iOS folder which contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.keystore.access-keychain-keys</key>
    <true/>
    <key>com.apple.keystore.device</key>
    <true/>
</dict>
</plist>

After that app stoped crashing on Google SignIn.

gogoout commented 6 years ago

@valeraf I've installed the hook and also added the app.entitlements. Seems the app still crashing on Google SignIn. Did you have any other changes?

vivek-aecor commented 4 years ago

App crashing on google sign in. same issue Same problem here with google login.