Skip to content

Commit 1a79a88

Browse files
authored
docs: migration guide to capacitor 4 (#221)
1 parent 0a1f4ff commit 1a79a88

File tree

3 files changed

+593
-319
lines changed

3 files changed

+593
-319
lines changed

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# CapacitorGoogleAuth
22

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

2423
#### 1. Install package
2524

26-
```bash
25+
```sh
2726
npm i --save @codetrix-studio/capacitor-google-auth
28-
29-
# or for Capacitor 2.x.x
30-
npm i --save @codetrix-studio/[email protected]
3127
```
3228

3329
#### 2. Update capacitor deps
@@ -36,14 +32,12 @@ npm i --save @codetrix-studio/[email protected]
3632
npx cap update
3733
```
3834

39-
#### 3. Migrate from 2 to 3 version
35+
## Updating
4036

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

4339
## Usage
4440

45-
for capacitor 2.x.x use [instruction](https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/79129ab37288f5f5d0bb9a568a95890e852cebc2/README.md)
46-
4741
### WEB
4842

4943
Register plugin and manually initialize
@@ -59,7 +53,7 @@ GoogleAuth.initialize({
5953
});
6054
```
6155

62-
or if need use meta tags
56+
or if need use meta tags (Optional):
6357

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

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

194-
195188
Provide configuration in root `capacitor.config.json`
196189

197190
```json
@@ -226,6 +219,16 @@ export default config;
226219

227220
## Migration guide
228221

222+
#### Migrate from 3.1.x to 3.2.x
223+
224+
Install version 3.2.x:
225+
226+
```sh
227+
npm i --save @codetrix-studio/capacitor-google-auth
228+
```
229+
230+
Follow instruction for you project [Updating from Capacitor 3 to Capacitor 4](https://capacitorjs.com/docs/updating/4-0).
231+
229232
#### Migrate from 3.0.2 to 3.1.0
230233

231234
```diff
@@ -235,6 +238,12 @@ export default config;
235238

236239
#### Migrate from 2 to 3
237240

241+
Install version 3.x.x:
242+
243+
```sh
244+
npm i --save @codetrix-studio/capacitor-google-auth@3
245+
```
246+
238247
After [migrate to Capcitor 3](https://capacitorjs.com/docs/updating/3-0) updating you projects, see diff:
239248

240249
##### WEB
@@ -248,3 +257,17 @@ After [migrate to Capcitor 3](https://capacitorjs.com/docs/updating/3-0) updatin
248257
+ GoogleAuth.init()
249258
+ GoogleAuth.signIn()
250259
```
260+
261+
#### Migrate from 1 to 2
262+
263+
Install version 2.x.x:
264+
265+
```sh
266+
npm i --save @codetrix-studio/capacitor-google-auth@2
267+
```
268+
269+
for capacitor 2.x.x use [instruction](https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/79129ab37288f5f5d0bb9a568a95890e852cebc2/README.md)
270+
271+
## License
272+
273+
[MIT](./LICENSE)

0 commit comments

Comments
 (0)