Skip to content

Commit

Permalink
docs: migration guide to capacitor 4 (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
reslear authored Aug 14, 2022
1 parent 0a1f4ff commit 1a79a88
Show file tree
Hide file tree
Showing 3 changed files with 593 additions and 319 deletions.
47 changes: 35 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# CapacitorGoogleAuth


[![npm](https://img.shields.io/npm/v/@codetrix-studio/capacitor-google-auth)](https://www.npmjs.com/package/@codetrix-studio/capacitor-google-auth)
![npm](https://img.shields.io/npm/dt/@codetrix-studio/capacitor-google-auth)
![npm](https://img.shields.io/npm/dw/@codetrix-studio/capacitor-google-auth)
Expand All @@ -23,11 +22,8 @@ PRs for features that are not aligned with the official Google Auth library are

#### 1. Install package

```bash
```sh
npm i --save @codetrix-studio/capacitor-google-auth

# or for Capacitor 2.x.x
npm i --save @codetrix-studio/capacitor-google-auth@2.1.3
```

#### 2. Update capacitor deps
Expand All @@ -36,14 +32,12 @@ npm i --save @codetrix-studio/capacitor-google-auth@2.1.3
npx cap update
```

#### 3. Migrate from 2 to 3 version
## Updating

if your migrate from Capacitor 2 to Capacitor 3 [see instruction for migrate plugin to new version](#migrate-from-2-to-3)
If need migrate to different Capacitor versions [see instruction for migrate plugin to new version](#migration-guide).

## Usage

for capacitor 2.x.x use [instruction](https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/79129ab37288f5f5d0bb9a568a95890e852cebc2/README.md)

### WEB

Register plugin and manually initialize
Expand All @@ -59,7 +53,7 @@ GoogleAuth.initialize({
});
```

or if need use meta tags
or if need use meta tags (Optional):

```html
<meta name="google-signin-client_id" content="{your client id here}" />
Expand Down Expand Up @@ -183,15 +177,14 @@ this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
## Configure

| Name | Type | Description |
|--------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------|
| ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| clientId | string | The app's client ID, found and created in the Google Developers Console. |
| iosClientId | string | Specific client ID key for iOS |
| androidClientId | string | Specific client ID key for Android |
| scopes | string[] | Scopes that you might need to request to access Google APIs<br>https://developers.google.com/identity/protocols/oauth2/scopes |
| serverClientId | string | This ClientId used for offline access and server side handling |
| forceCodeForRefreshToken | boolean | Force user to select email address to regenerate AuthCode <br>used to get a valid refreshtoken (work on iOS and Android) |


Provide configuration in root `capacitor.config.json`

```json
Expand Down Expand Up @@ -226,6 +219,16 @@ export default config;

## Migration guide

#### Migrate from 3.1.x to 3.2.x

Install version 3.2.x:

```sh
npm i --save @codetrix-studio/capacitor-google-auth
```

Follow instruction for you project [Updating from Capacitor 3 to Capacitor 4](https://capacitorjs.com/docs/updating/4-0).

#### Migrate from 3.0.2 to 3.1.0

```diff
Expand All @@ -235,6 +238,12 @@ export default config;

#### Migrate from 2 to 3

Install version 3.x.x:

```sh
npm i --save @codetrix-studio/capacitor-google-auth@3
```

After [migrate to Capcitor 3](https://capacitorjs.com/docs/updating/3-0) updating you projects, see diff:

##### WEB
Expand All @@ -248,3 +257,17 @@ After [migrate to Capcitor 3](https://capacitorjs.com/docs/updating/3-0) updatin
+ GoogleAuth.init()
+ GoogleAuth.signIn()
```

#### Migrate from 1 to 2

Install version 2.x.x:

```sh
npm i --save @codetrix-studio/capacitor-google-auth@2
```

for capacitor 2.x.x use [instruction](https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/79129ab37288f5f5d0bb9a568a95890e852cebc2/README.md)

## License

[MIT](./LICENSE)
Loading

0 comments on commit 1a79a88

Please sign in to comment.