Skip to content

Commit 02b8110

Browse files
authored
Merge pull request #108 from reslear/patch-2
add migration guide
2 parents bd0202b + cce398b commit 02b8110

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
# CapacitorGoogleAuth
22
Capacitor plugin for Google Auth.
33

4-
### Install
4+
## Install
5+
6+
#### 1. Install package
57
```bash
68
npm i --save @codetrix-studio/capacitor-google-auth
79

10+
# or for Capacitor 2.x.x
11+
npm i --save @codetrix-studio/[email protected]
12+
```
13+
14+
#### 2. Update capacitor deps
15+
```sh
816
npx cap update
917
```
18+
#### 3. Migrate from 2 to 3 version
19+
if your migrate from Capacitor 2 to Capacitor 3 [see instruction for migrate plugin to new version](#migrate-from-2-to-3)
20+
21+
## Usage
22+
for capacitor 2.x.x use [instruction](https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/79129ab37288f5f5d0bb9a568a95890e852cebc2/README.md)
1023

1124
### WEB
1225
Add [`clientId`](https://developers.google.com/identity/sign-in/web/sign-in#specify_your_apps_client_id) meta tag to head.
@@ -84,7 +97,7 @@ this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
8497
}});
8598
```
8699

87-
### Configure
100+
## Configure
88101
Provide configuration in root `capacitor.config.json`
89102
```json
90103
{
@@ -100,3 +113,21 @@ Provide configuration in root `capacitor.config.json`
100113
```
101114

102115
Note : `forceCodeForRefreshToken` force user to select email address to regenerate AuthCode used to get a valid refreshtoken (work on iOS and Android) (This is used for offline access and serverside handling)
116+
117+
118+
### Migration guide
119+
120+
#### Migrate from 2 to 3
121+
122+
After [migrate to Capcitor 3](https://capacitorjs.com/docs/updating/3-0) updating you projects, see diff:
123+
124+
##### WEB
125+
```diff
126+
- import "@codetrix-studio/capacitor-google-auth";
127+
- import { Plugins } from '@capacitor/core';
128+
+ import { GoogleAuth } from '@codetrix-studio/core';
129+
130+
- Plugins.GoogleAuth.signIn();
131+
+ GoogleAuth.init()
132+
+ GoogleAuth.signIn()
133+
```

0 commit comments

Comments
 (0)