File tree Expand file tree Collapse file tree 1 file changed +30
-7
lines changed
Expand file tree Collapse file tree 1 file changed +30
-7
lines changed Original file line number Diff line number Diff line change @@ -14,20 +14,19 @@ Add [`clientId`](https://developers.google.com/identity/sign-in/web/sign-in#spec
1414<meta name =" google-signin-client_id" content =" {your client id here}" >
1515```
1616
17- Register the plugin by importing it.
17+ Register plugin and manually initialize
1818``` ts
19- import " @codetrix-studio/capacitor-google-auth" ;
19+ import { GoogleAuth } from ' @codetrix-studio/core' ;
20+
21+ GoogleAuth .init ()
2022```
2123
2224Use it
2325``` ts
24- import { Plugins } from ' @capacitor/core' ;
25- Plugins .GoogleAuth .signIn ();
26+ GoogleAuth .signIn ()
2627```
2728
28-
29-
30- ### AngularFire2
29+ #### AngularFire2
3130``` ts
3231async googleSignIn () {
3332 let googleUser = await Plugins .GoogleAuth .signIn ();
@@ -36,6 +35,30 @@ async googleSignIn() {
3635}
3736```
3837
38+ #### Vue 3
39+ ``` ts
40+ // App.vue
41+ import { defineComponent , onMounted } from ' vue'
42+ import { GoogleAuth } from ' @codetrix-studio/capacitor-google-auth'
43+
44+ export default defineComponent ({
45+ setup() {
46+ onMounted (() => {
47+ GoogleAuth .init ()
48+ })
49+
50+ const logIn = async () => {
51+ const response = await GoogleAuth .signIn ()
52+ console .log (response )
53+ }
54+
55+ return {
56+ logIn
57+ }
58+ }
59+ })
60+ ```
61+
3962### iOS
4063Make sure you have ` GoogleService-Info.plist ` with ` CLIENT_ID `
4164
You can’t perform that action at this time.
0 commit comments