@capgo/capacitor-social-login 0.0.10

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.
Files changed (35) hide show
  1. package/CapgoCapacitorSocialLogin.podspec +21 -0
  2. package/Package.swift +37 -0
  3. package/README.md +457 -0
  4. package/android/build.gradle +64 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/java/ee/forgr/capacitor/social/login/AppleProvider.java +376 -0
  7. package/android/src/main/java/ee/forgr/capacitor/social/login/FacebookProvider.java +175 -0
  8. package/android/src/main/java/ee/forgr/capacitor/social/login/GoogleProvider.java +305 -0
  9. package/android/src/main/java/ee/forgr/capacitor/social/login/SocialLoginPlugin.java +161 -0
  10. package/android/src/main/java/ee/forgr/capacitor/social/login/helpers/JsonHelper.java +18 -0
  11. package/android/src/main/java/ee/forgr/capacitor/social/login/helpers/SocialProvider.java +13 -0
  12. package/android/src/main/res/.gitkeep +0 -0
  13. package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
  14. package/android/src/main/res/layout/dialog_custom_layout.xml +43 -0
  15. package/android/src/main/res/values/styles.xml +14 -0
  16. package/dist/docs.json +613 -0
  17. package/dist/esm/definitions.d.ts +191 -0
  18. package/dist/esm/definitions.js +2 -0
  19. package/dist/esm/definitions.js.map +1 -0
  20. package/dist/esm/index.d.ts +4 -0
  21. package/dist/esm/index.js +7 -0
  22. package/dist/esm/index.js.map +1 -0
  23. package/dist/esm/web.d.ts +17 -0
  24. package/dist/esm/web.js +29 -0
  25. package/dist/esm/web.js.map +1 -0
  26. package/dist/plugin.cjs.js +43 -0
  27. package/dist/plugin.cjs.js.map +1 -0
  28. package/dist/plugin.js +46 -0
  29. package/dist/plugin.js.map +1 -0
  30. package/ios/Sources/SocialLoginPlugin/AppleProvider.swift +516 -0
  31. package/ios/Sources/SocialLoginPlugin/FacebookProvider.swift +108 -0
  32. package/ios/Sources/SocialLoginPlugin/GoogleProvider.swift +165 -0
  33. package/ios/Sources/SocialLoginPlugin/SocialLoginPlugin.swift +322 -0
  34. package/ios/Tests/SocialLoginPluginTests/SocialLoginPluginTests.swift +15 -0
  35. package/package.json +87 -0
package/dist/docs.json ADDED
@@ -0,0 +1,613 @@
1
+ {
2
+ "api": {
3
+ "name": "SocialLoginPlugin",
4
+ "slug": "socialloginplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "initialize",
10
+ "signature": "(options: InitializeOptions) => Promise<void>",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "InitializeOptions"
16
+ }
17
+ ],
18
+ "returns": "Promise<void>",
19
+ "tags": [
20
+ {
21
+ "name": "description",
22
+ "text": "initialize the plugin with the required options"
23
+ }
24
+ ],
25
+ "docs": "Initialize the plugin",
26
+ "complexTypes": [
27
+ "InitializeOptions"
28
+ ],
29
+ "slug": "initialize"
30
+ },
31
+ {
32
+ "name": "login",
33
+ "signature": "(options: LoginOptions) => Promise<LoginResult>",
34
+ "parameters": [
35
+ {
36
+ "name": "options",
37
+ "docs": "",
38
+ "type": "LoginOptions"
39
+ }
40
+ ],
41
+ "returns": "Promise<LoginResult>",
42
+ "tags": [
43
+ {
44
+ "name": "description",
45
+ "text": "login with the selected provider"
46
+ }
47
+ ],
48
+ "docs": "Login with the selected provider",
49
+ "complexTypes": [
50
+ "LoginResult",
51
+ "LoginOptions"
52
+ ],
53
+ "slug": "login"
54
+ },
55
+ {
56
+ "name": "logout",
57
+ "signature": "(options: { provider: \"apple\" | \"google\" | \"facebook\"; }) => Promise<void>",
58
+ "parameters": [
59
+ {
60
+ "name": "options",
61
+ "docs": "",
62
+ "type": "{ provider: 'facebook' | 'google' | 'apple'; }"
63
+ }
64
+ ],
65
+ "returns": "Promise<void>",
66
+ "tags": [
67
+ {
68
+ "name": "description",
69
+ "text": "logout the user"
70
+ }
71
+ ],
72
+ "docs": "Logout",
73
+ "complexTypes": [],
74
+ "slug": "logout"
75
+ },
76
+ {
77
+ "name": "isLoggedIn",
78
+ "signature": "(options: isLoggedInOptions) => Promise<{ isLoggedIn: boolean; }>",
79
+ "parameters": [
80
+ {
81
+ "name": "options",
82
+ "docs": "",
83
+ "type": "isLoggedInOptions"
84
+ }
85
+ ],
86
+ "returns": "Promise<{ isLoggedIn: boolean; }>",
87
+ "tags": [
88
+ {
89
+ "name": "description",
90
+ "text": "logout the user"
91
+ }
92
+ ],
93
+ "docs": "IsLoggedIn",
94
+ "complexTypes": [
95
+ "isLoggedInOptions"
96
+ ],
97
+ "slug": "isloggedin"
98
+ },
99
+ {
100
+ "name": "getAuthorizationCode",
101
+ "signature": "(options: AuthorizationCodeOptions) => Promise<AuthorizationCode>",
102
+ "parameters": [
103
+ {
104
+ "name": "options",
105
+ "docs": "",
106
+ "type": "AuthorizationCodeOptions"
107
+ }
108
+ ],
109
+ "returns": "Promise<AuthorizationCode>",
110
+ "tags": [
111
+ {
112
+ "name": "description",
113
+ "text": "get the current access token"
114
+ }
115
+ ],
116
+ "docs": "Get the current access token",
117
+ "complexTypes": [
118
+ "AuthorizationCode",
119
+ "AuthorizationCodeOptions"
120
+ ],
121
+ "slug": "getauthorizationcode"
122
+ },
123
+ {
124
+ "name": "refresh",
125
+ "signature": "(options: LoginOptions) => Promise<void>",
126
+ "parameters": [
127
+ {
128
+ "name": "options",
129
+ "docs": "",
130
+ "type": "LoginOptions"
131
+ }
132
+ ],
133
+ "returns": "Promise<void>",
134
+ "tags": [
135
+ {
136
+ "name": "description",
137
+ "text": "refresh the access token"
138
+ }
139
+ ],
140
+ "docs": "Refresh the access token",
141
+ "complexTypes": [
142
+ "LoginOptions"
143
+ ],
144
+ "slug": "refresh"
145
+ }
146
+ ],
147
+ "properties": []
148
+ },
149
+ "interfaces": [
150
+ {
151
+ "name": "InitializeOptions",
152
+ "slug": "initializeoptions",
153
+ "docs": "",
154
+ "tags": [],
155
+ "methods": [],
156
+ "properties": [
157
+ {
158
+ "name": "facebook",
159
+ "tags": [],
160
+ "docs": "",
161
+ "complexTypes": [],
162
+ "type": "{ appId: string; } | undefined"
163
+ },
164
+ {
165
+ "name": "google",
166
+ "tags": [],
167
+ "docs": "",
168
+ "complexTypes": [],
169
+ "type": "{ clientId: string; } | undefined"
170
+ },
171
+ {
172
+ "name": "apple",
173
+ "tags": [],
174
+ "docs": "",
175
+ "complexTypes": [],
176
+ "type": "{ clientId: string; redirectUrl: string; } | undefined"
177
+ }
178
+ ]
179
+ },
180
+ {
181
+ "name": "LoginResult",
182
+ "slug": "loginresult",
183
+ "docs": "",
184
+ "tags": [],
185
+ "methods": [],
186
+ "properties": [
187
+ {
188
+ "name": "provider",
189
+ "tags": [
190
+ {
191
+ "text": "select provider to login with",
192
+ "name": "description"
193
+ }
194
+ ],
195
+ "docs": "Provider",
196
+ "complexTypes": [],
197
+ "type": "'facebook' | 'google' | 'apple' | 'twitter'"
198
+ },
199
+ {
200
+ "name": "result",
201
+ "tags": [
202
+ {
203
+ "text": "payload to login with",
204
+ "name": "description"
205
+ }
206
+ ],
207
+ "docs": "Payload",
208
+ "complexTypes": [
209
+ "FacebookLoginResponse",
210
+ "GoogleLoginResponse",
211
+ "AppleProviderResponse"
212
+ ],
213
+ "type": "FacebookLoginResponse | GoogleLoginResponse | AppleProviderResponse"
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "name": "FacebookLoginResponse",
219
+ "slug": "facebookloginresponse",
220
+ "docs": "",
221
+ "tags": [],
222
+ "methods": [],
223
+ "properties": [
224
+ {
225
+ "name": "accessToken",
226
+ "tags": [],
227
+ "docs": "",
228
+ "complexTypes": [
229
+ "AccessToken"
230
+ ],
231
+ "type": "AccessToken | null"
232
+ },
233
+ {
234
+ "name": "profile",
235
+ "tags": [],
236
+ "docs": "",
237
+ "complexTypes": [],
238
+ "type": "{ fields: readonly string[]; }"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "name": "AccessToken",
244
+ "slug": "accesstoken",
245
+ "docs": "",
246
+ "tags": [],
247
+ "methods": [],
248
+ "properties": [
249
+ {
250
+ "name": "applicationId",
251
+ "tags": [],
252
+ "docs": "",
253
+ "complexTypes": [],
254
+ "type": "string | undefined"
255
+ },
256
+ {
257
+ "name": "declinedPermissions",
258
+ "tags": [],
259
+ "docs": "",
260
+ "complexTypes": [],
261
+ "type": "string[] | undefined"
262
+ },
263
+ {
264
+ "name": "expires",
265
+ "tags": [],
266
+ "docs": "",
267
+ "complexTypes": [],
268
+ "type": "string | undefined"
269
+ },
270
+ {
271
+ "name": "isExpired",
272
+ "tags": [],
273
+ "docs": "",
274
+ "complexTypes": [],
275
+ "type": "boolean | undefined"
276
+ },
277
+ {
278
+ "name": "lastRefresh",
279
+ "tags": [],
280
+ "docs": "",
281
+ "complexTypes": [],
282
+ "type": "string | undefined"
283
+ },
284
+ {
285
+ "name": "permissions",
286
+ "tags": [],
287
+ "docs": "",
288
+ "complexTypes": [],
289
+ "type": "string[] | undefined"
290
+ },
291
+ {
292
+ "name": "token",
293
+ "tags": [],
294
+ "docs": "",
295
+ "complexTypes": [],
296
+ "type": "string"
297
+ },
298
+ {
299
+ "name": "userId",
300
+ "tags": [],
301
+ "docs": "",
302
+ "complexTypes": [],
303
+ "type": "string | undefined"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ "name": "GoogleLoginResponse",
309
+ "slug": "googleloginresponse",
310
+ "docs": "",
311
+ "tags": [],
312
+ "methods": [],
313
+ "properties": [
314
+ {
315
+ "name": "accessToken",
316
+ "tags": [],
317
+ "docs": "",
318
+ "complexTypes": [
319
+ "AccessToken"
320
+ ],
321
+ "type": "AccessToken | null"
322
+ },
323
+ {
324
+ "name": "idToken",
325
+ "tags": [],
326
+ "docs": "",
327
+ "complexTypes": [],
328
+ "type": "string | null"
329
+ },
330
+ {
331
+ "name": "profile",
332
+ "tags": [],
333
+ "docs": "",
334
+ "complexTypes": [],
335
+ "type": "{ email: string | null; familyName: string | null; givenName: string | null; id: string | null; name: string | null; imageUrl: string | null; }"
336
+ }
337
+ ]
338
+ },
339
+ {
340
+ "name": "AppleProviderResponse",
341
+ "slug": "appleproviderresponse",
342
+ "docs": "",
343
+ "tags": [],
344
+ "methods": [],
345
+ "properties": [
346
+ {
347
+ "name": "user",
348
+ "tags": [],
349
+ "docs": "",
350
+ "complexTypes": [],
351
+ "type": "string | null"
352
+ },
353
+ {
354
+ "name": "email",
355
+ "tags": [],
356
+ "docs": "",
357
+ "complexTypes": [],
358
+ "type": "string | null"
359
+ },
360
+ {
361
+ "name": "givenName",
362
+ "tags": [],
363
+ "docs": "",
364
+ "complexTypes": [],
365
+ "type": "string | null"
366
+ },
367
+ {
368
+ "name": "familyName",
369
+ "tags": [],
370
+ "docs": "",
371
+ "complexTypes": [],
372
+ "type": "string | null"
373
+ },
374
+ {
375
+ "name": "identityToken",
376
+ "tags": [],
377
+ "docs": "",
378
+ "complexTypes": [],
379
+ "type": "string | null"
380
+ },
381
+ {
382
+ "name": "authorizationCode",
383
+ "tags": [],
384
+ "docs": "",
385
+ "complexTypes": [],
386
+ "type": "string"
387
+ }
388
+ ]
389
+ },
390
+ {
391
+ "name": "LoginOptions",
392
+ "slug": "loginoptions",
393
+ "docs": "",
394
+ "tags": [],
395
+ "methods": [],
396
+ "properties": [
397
+ {
398
+ "name": "provider",
399
+ "tags": [
400
+ {
401
+ "text": "select provider to login with",
402
+ "name": "description"
403
+ }
404
+ ],
405
+ "docs": "Provider",
406
+ "complexTypes": [],
407
+ "type": "'facebook' | 'google' | 'apple' | 'twitter'"
408
+ },
409
+ {
410
+ "name": "options",
411
+ "tags": [
412
+ {
413
+ "text": "payload to login with",
414
+ "name": "description"
415
+ }
416
+ ],
417
+ "docs": "Options",
418
+ "complexTypes": [
419
+ "FacebookLoginOptions",
420
+ "GoogleLoginOptions",
421
+ "AppleProviderOptions"
422
+ ],
423
+ "type": "FacebookLoginOptions | GoogleLoginOptions | AppleProviderOptions"
424
+ }
425
+ ]
426
+ },
427
+ {
428
+ "name": "FacebookLoginOptions",
429
+ "slug": "facebookloginoptions",
430
+ "docs": "",
431
+ "tags": [],
432
+ "methods": [],
433
+ "properties": [
434
+ {
435
+ "name": "permissions",
436
+ "tags": [
437
+ {
438
+ "text": "select permissions to login with",
439
+ "name": "description"
440
+ }
441
+ ],
442
+ "docs": "Permissions",
443
+ "complexTypes": [],
444
+ "type": "string[]"
445
+ }
446
+ ]
447
+ },
448
+ {
449
+ "name": "GoogleLoginOptions",
450
+ "slug": "googleloginoptions",
451
+ "docs": "",
452
+ "tags": [],
453
+ "methods": [],
454
+ "properties": [
455
+ {
456
+ "name": "scopes",
457
+ "tags": [
458
+ {
459
+ "text": "[\"profile\", \"email\"]",
460
+ "name": "example"
461
+ },
462
+ {
463
+ "text": " [Google OAuth2 Scopes](https://developers.google.com/identity/protocols/oauth2/scopes)",
464
+ "name": "see"
465
+ }
466
+ ],
467
+ "docs": "Specifies the scopes required for accessing Google APIs\nThe default is defined in the configuration.",
468
+ "complexTypes": [],
469
+ "type": "string[] | undefined"
470
+ },
471
+ {
472
+ "name": "grantOfflineAccess",
473
+ "tags": [
474
+ {
475
+ "text": "false",
476
+ "name": "default"
477
+ },
478
+ {
479
+ "text": "3.1.0",
480
+ "name": "since"
481
+ }
482
+ ],
483
+ "docs": "Set if your application needs to refresh access tokens when the user is not present at the browser.\nIn response use `serverAuthCode` key",
484
+ "complexTypes": [],
485
+ "type": "boolean | undefined"
486
+ }
487
+ ]
488
+ },
489
+ {
490
+ "name": "AppleProviderOptions",
491
+ "slug": "appleprovideroptions",
492
+ "docs": "",
493
+ "tags": [],
494
+ "methods": [],
495
+ "properties": [
496
+ {
497
+ "name": "scopes",
498
+ "tags": [
499
+ {
500
+ "text": "select scopes to login with",
501
+ "name": "description"
502
+ }
503
+ ],
504
+ "docs": "Scopes",
505
+ "complexTypes": [],
506
+ "type": "string[] | undefined"
507
+ },
508
+ {
509
+ "name": "redirectURI",
510
+ "tags": [
511
+ {
512
+ "text": "redirect URI",
513
+ "name": "description"
514
+ }
515
+ ],
516
+ "docs": "Redirect URI",
517
+ "complexTypes": [],
518
+ "type": "string"
519
+ },
520
+ {
521
+ "name": "nonce",
522
+ "tags": [
523
+ {
524
+ "text": "nonce",
525
+ "name": "description"
526
+ }
527
+ ],
528
+ "docs": "Nonce",
529
+ "complexTypes": [],
530
+ "type": "string | undefined"
531
+ },
532
+ {
533
+ "name": "state",
534
+ "tags": [
535
+ {
536
+ "text": "state",
537
+ "name": "description"
538
+ }
539
+ ],
540
+ "docs": "State",
541
+ "complexTypes": [],
542
+ "type": "string | undefined"
543
+ }
544
+ ]
545
+ },
546
+ {
547
+ "name": "isLoggedInOptions",
548
+ "slug": "isloggedinoptions",
549
+ "docs": "",
550
+ "tags": [],
551
+ "methods": [],
552
+ "properties": [
553
+ {
554
+ "name": "provider",
555
+ "tags": [
556
+ {
557
+ "text": "Provider for the isLoggedIn",
558
+ "name": "description"
559
+ }
560
+ ],
561
+ "docs": "Provider",
562
+ "complexTypes": [],
563
+ "type": "'facebook' | 'google' | 'apple'"
564
+ }
565
+ ]
566
+ },
567
+ {
568
+ "name": "AuthorizationCode",
569
+ "slug": "authorizationcode",
570
+ "docs": "",
571
+ "tags": [],
572
+ "methods": [],
573
+ "properties": [
574
+ {
575
+ "name": "jwt",
576
+ "tags": [
577
+ {
578
+ "text": "A JSON web token",
579
+ "name": "description"
580
+ }
581
+ ],
582
+ "docs": "Jwt",
583
+ "complexTypes": [],
584
+ "type": "string"
585
+ }
586
+ ]
587
+ },
588
+ {
589
+ "name": "AuthorizationCodeOptions",
590
+ "slug": "authorizationcodeoptions",
591
+ "docs": "",
592
+ "tags": [],
593
+ "methods": [],
594
+ "properties": [
595
+ {
596
+ "name": "provider",
597
+ "tags": [
598
+ {
599
+ "text": "Provider for the authorization code",
600
+ "name": "description"
601
+ }
602
+ ],
603
+ "docs": "Provider",
604
+ "complexTypes": [],
605
+ "type": "'facebook' | 'google' | 'apple'"
606
+ }
607
+ ]
608
+ }
609
+ ],
610
+ "enums": [],
611
+ "typeAliases": [],
612
+ "pluginConfigs": []
613
+ }