Skip to content

Commit

Permalink
chore(update-plugins): Sat Jun 17 08:05:26 UTC 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
nativescript-oss committed Jun 17, 2023
1 parent 7768fd8 commit 17ff6c0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 362 deletions.
20 changes: 0 additions & 20 deletions plugins/geolocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,6 @@ The following are the properties of the options object that you pass to the geol

## Known issues

### Version conflicts with Google Play Services

If you have installed multiple plugins that use the Google Play Services you might run into version conflicts. For example, you may encounter the error below when using the [nativescript-google-maps-sdk](https://github.com/dapriett/nativescript-google-maps-sdk) plugin:

```ts
'Cannot enable the location service. Error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbck;'
```

To fix that error, you might pin the version number in your `app/App_Resources/Android/before-plugins.gradle` file (if the file does not exist, create it):

```gradle
android {  
// other stuff here
project.ext {
googlePlayServicesVersion = "16.+"
}
}
```

### openSettingsIfLocationHasBeenDenied on Android API level 30

If the user declines the permission twice during the installation lifetime of the app on Android API level 30 , the user won't be taken to the settings even if the `openSettingsIfLocationHasBeenDenied` option is true for `enableLocationRequest()`.
Expand Down
38 changes: 29 additions & 9 deletions plugins/google-signin.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ link: https://raw.githubusercontent.com/NativeScript/plugins/main/packages/googl

# @nativescript/google-signin

A plugin that allows you to authenticate users with Google Sign-In.

## Contents

- [Installation](#installation)
Expand All @@ -35,6 +33,10 @@ A plugin that allows you to authenticate users with Google Sign-In.
- [User](#user)
- [GoogleSignInButton](#googlesigninbutton)

## Intro

A plugin that allows you to authenticate users with Google Sign-In.

## Installation

Install the plugin by running the following command at the root of the project.
Expand All @@ -53,7 +55,27 @@ npm install @nativescript/google-signin

You don't need to include the `google-services.json` file mentioned in [Add a Firebase configuration file](https://firebase.google.com/docs/android/setup#add-config-file) in your app unless you are using other Google services that require it.

2. Enable the OAuth APIs that you want, using the [Google Cloud Platform API manager](https://console.developers.google.com/).
2. Generate debug SHA-1 fingerprint and add it to your Firebase project.

Generate the SHA-1 fingerprint for the debug keystore on your machine and add it to your app's Firebase project. Failure to do so will result in the `Error: 10` error.

To generate the SHA-1 fingerprint for the debug keystore with the following commands. For the debug keystore, the password is `android`.

- **macOS/Linux**

```cli
keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
```

- **Windows**

```cli
keytool -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
```

3. Enable the OAuth APIs that you want, using the [Google Cloud Platform API manager](https://console.developers.google.com/).
Make sure you've filled out all the required fields in the console for [OAuth consent screen](https://console.developers.google.com/apis/credentials/consent). Otherwise, you may encounter APIException errors.

## iOS prerequisites
Expand Down Expand Up @@ -106,8 +128,6 @@ To sign in a user with GoogleSignIn, follow the steps below.

1. Register and add the [GoogleSignInButton](#googlesigninbutton) to your markup to be able to initiate GoogleSigIn.

1. Register and add the [GoogleSignInButton](#googlesigninbutton) to your markup to be able to initiate GoogleSigIn.

- **Core**

```xml
Expand All @@ -134,9 +154,9 @@ Next, add it to your `html` file setting the desired option for `colorScheme` an
<GoogleSignInButton colorScheme='auto' colorStyle='standard' (tap)="yourGoogleSigninFunction()"></GoogleSignInButton>
```

- **Vue**
#### Vue

Register the button by adding the following code to the `main.ts` file.
To register the button, add the following code to the `main.ts` file.

```ts
registerElement(
Expand All @@ -153,13 +173,13 @@ Then use it in a `.vue` file as follows:

2. Call the [signIn()](#signin) method on GoogleSignInButton tap

Before you call the [signIn()](#signin) or the [signInSilently()](#signinsilently) method to sign in the user, call `configure()` to initialize Firebase.
Before you call the [signIn()](#signin) or the [signInSilently()](#signinsilently) method to sign in the user, call `configure()` to initialize Firebase. If you do want to set any configuration options, you can pass an empty object `{}` as a parameter to [configure](#configure).

```ts
import { GoogleSignin } from '@nativescript/google-signin'

try {
await GoogleSignin.configure()
await GoogleSignin.configure({})
const user = await GoogleSignin.signIn()
} catch (e) {}
```
Expand Down
Loading

0 comments on commit 17ff6c0

Please sign in to comment.