@capawesome/capacitor-google-sign-in 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/android/build.gradle +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ No configuration required for this plugin.
|
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
87
|
import { GoogleSignIn } from '@capawesome/capacitor-google-sign-in';
|
|
88
|
+
import { Capacitor } from '@capacitor/core';
|
|
88
89
|
|
|
89
90
|
const initialize = async () => {
|
|
90
91
|
await GoogleSignIn.initialize({
|
|
@@ -103,6 +104,19 @@ const signIn = async () => {
|
|
|
103
104
|
console.log(result.serverAuthCode);
|
|
104
105
|
};
|
|
105
106
|
|
|
107
|
+
const handleRedirectCallback = async () => {
|
|
108
|
+
if (Capacitor.getPlatform() !== 'web') {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const result = await GoogleSignIn.handleRedirectCallback();
|
|
112
|
+
console.log(result.idToken);
|
|
113
|
+
console.log(result.userId);
|
|
114
|
+
console.log(result.email);
|
|
115
|
+
console.log(result.displayName);
|
|
116
|
+
console.log(result.accessToken);
|
|
117
|
+
console.log(result.serverAuthCode);
|
|
118
|
+
};
|
|
119
|
+
|
|
106
120
|
const signOut = async () => {
|
|
107
121
|
await GoogleSignIn.signOut();
|
|
108
122
|
};
|
package/android/build.gradle
CHANGED
|
@@ -33,7 +33,7 @@ android {
|
|
|
33
33
|
buildTypes {
|
|
34
34
|
release {
|
|
35
35
|
minifyEnabled false
|
|
36
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
36
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
lintOptions {
|