You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ⚠️ From plugin version 6.0.0 the minimum required cordova-ios version is 4.5.0. Need to use a lower cordova-ios version? Use plugin version 5.3.2 or lower.
16
12
@@ -40,15 +36,15 @@ This plugin only wraps access to the Google Sign-In API. Further API access shou
'webClientId':'client id of the web app/server side', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.
222
218
'offline':true// optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server
223
219
},
224
-
function (obj) {
225
-
alert(JSON.stringify(obj)); // do something useful instead of alerting
220
+
function (json) {
221
+
alert(json); // do something useful instead of alerting
226
222
},
227
-
function (msg) {
228
-
alert('error: '+msg);
223
+
function (json) {
224
+
alert('error: '+json);
229
225
}
230
226
);
231
227
```
232
228
233
-
The success callback (second argument) gets a JSON object with the following contents, with example data of my Google account:
229
+
The success callback (second argument) gets a JSON string with the following contents, with example data of my Google account:
234
230
```javascript
235
-
obj.email// 'eddyverbruggen@gmail.com'
231
+
obj.email// 'recifra@gmail.com'
236
232
obj.userId// user id
237
233
obj.displayName// 'Eddy Verbruggen'
238
234
obj.familyName// 'Verbruggen'
@@ -245,16 +241,16 @@ The success callback (second argument) gets a JSON object with the following con
245
241
246
242
Additional user information is available by use case. Add the scopes needed to the scopes option then return the info to the result object being created in the `handleSignInResult` and `didSignInForUser` functions on Android and iOS, respectively.
247
243
248
-
On Android, the error callback (third argument) receives an error status code if authentication was not successful. A description of those status codes can be found on Google's android developer website at [GoogleSignInStatusCodes](https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes).
244
+
On Android, the error callback (third argument) receives an JSON string with error status and code into message if authentication was not successful. A description of those status codes can be found on Google's android developer website at [GoogleSignInStatusCodes](https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes).
249
245
250
246
On iOS, the error callback will include an [NSError localizedDescription](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSError_Class/).
251
247
252
248
### logout
253
249
This will clear the OAuth2 token.
254
250
```javascript
255
251
window.plugins.googleplus.logout(
256
-
function (msg) {
257
-
alert(msg); // do something useful instead of alerting
252
+
function (json) {
253
+
alert(json); // do something useful instead of alerting
This will clear the OAuth2 token, forget which account was used to login, and disconnect that account from the app. This will require the user to allow the app access again next time they sign in. Be aware that this effect is not always instantaneous. It can take time to completely disconnect.
264
260
```javascript
265
261
window.plugins.googleplus.disconnect(
266
-
function (msg) {
267
-
alert(msg); // do something useful instead of alerting
262
+
function (json) {
263
+
alert(json); // do something useful instead of alerting
0 commit comments