@capgo/capacitor-social-login 8.2.2 → 8.2.3
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/android/src/main/java/ee/forgr/capacitor/social/login/SocialLoginPlugin.java +1 -1
- package/ios/Sources/SocialLoginPlugin/FacebookProvider.swift +16 -24
- package/ios/Sources/SocialLoginPlugin/OAuth2Provider.swift +1 -5
- package/ios/Sources/SocialLoginPlugin/SocialLoginPlugin.swift +1 -1
- package/ios/Sources/SocialLoginPlugin/TwitterProvider.swift +1 -5
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ import org.json.JSONObject;
|
|
|
19
19
|
@CapacitorPlugin(name = "SocialLogin")
|
|
20
20
|
public class SocialLoginPlugin extends Plugin {
|
|
21
21
|
|
|
22
|
-
private final String pluginVersion = "8.2.
|
|
22
|
+
private final String pluginVersion = "8.2.3";
|
|
23
23
|
|
|
24
24
|
public static String LOG_TAG = "CapgoSocialLogin";
|
|
25
25
|
|
|
@@ -21,11 +21,7 @@ class FacebookProvider {
|
|
|
21
21
|
private let dateFormatter = ISO8601DateFormatter()
|
|
22
22
|
|
|
23
23
|
init() {
|
|
24
|
-
|
|
25
|
-
dateFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
|
26
|
-
} else {
|
|
27
|
-
dateFormatter.formatOptions = [.withInternetDateTime]
|
|
28
|
-
}
|
|
24
|
+
dateFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
|
29
25
|
}
|
|
30
26
|
|
|
31
27
|
private func dateToJS(_ date: Date) -> String {
|
|
@@ -172,27 +168,23 @@ class FacebookProvider {
|
|
|
172
168
|
|
|
173
169
|
func requestTracking(completion: @escaping (Result<String, Error>) -> Void) {
|
|
174
170
|
#if canImport(AppTrackingTransparency)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
statusString = "notDetermined"
|
|
190
|
-
}
|
|
191
|
-
completion(.success(statusString))
|
|
171
|
+
DispatchQueue.main.async {
|
|
172
|
+
ATTrackingManager.requestTrackingAuthorization { status in
|
|
173
|
+
let statusString: String
|
|
174
|
+
switch status {
|
|
175
|
+
case .authorized:
|
|
176
|
+
statusString = "authorized"
|
|
177
|
+
case .denied:
|
|
178
|
+
statusString = "denied"
|
|
179
|
+
case .notDetermined:
|
|
180
|
+
statusString = "notDetermined"
|
|
181
|
+
case .restricted:
|
|
182
|
+
statusString = "restricted"
|
|
183
|
+
@unknown default:
|
|
184
|
+
statusString = "notDetermined"
|
|
192
185
|
}
|
|
186
|
+
completion(.success(statusString))
|
|
193
187
|
}
|
|
194
|
-
} else {
|
|
195
|
-
completion(.success("notDetermined"))
|
|
196
188
|
}
|
|
197
189
|
#else
|
|
198
190
|
completion(.success("notDetermined"))
|
|
@@ -191,10 +191,7 @@ class OAuth2Provider: NSObject {
|
|
|
191
191
|
self.handleCallback(providerId: providerId, config: config, callbackURL: callbackURL, redirectUri: redirect, completion: completion)
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
session.presentationContextProvider = self
|
|
196
|
-
}
|
|
197
|
-
|
|
194
|
+
session.presentationContextProvider = self
|
|
198
195
|
session.prefersEphemeralWebBrowserSession = true
|
|
199
196
|
currentSession = session
|
|
200
197
|
session.start()
|
|
@@ -558,7 +555,6 @@ class OAuth2Provider: NSObject {
|
|
|
558
555
|
}
|
|
559
556
|
|
|
560
557
|
extension OAuth2Provider: ASWebAuthenticationPresentationContextProviding {
|
|
561
|
-
@available(iOS 13.0, *)
|
|
562
558
|
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
|
|
563
559
|
return UIApplication.shared.windows.first { $0.isKeyWindow } ?? ASPresentationAnchor()
|
|
564
560
|
}
|
|
@@ -15,7 +15,7 @@ import GoogleSignIn
|
|
|
15
15
|
*/
|
|
16
16
|
@objc(SocialLoginPlugin)
|
|
17
17
|
public class SocialLoginPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
18
|
-
private let pluginVersion: String = "8.2.
|
|
18
|
+
private let pluginVersion: String = "8.2.3"
|
|
19
19
|
public let identifier = "SocialLoginPlugin"
|
|
20
20
|
public let jsName = "SocialLogin"
|
|
21
21
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -139,10 +139,7 @@ class TwitterProvider: NSObject {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
session.presentationContextProvider = self
|
|
144
|
-
}
|
|
145
|
-
|
|
142
|
+
session.presentationContextProvider = self
|
|
146
143
|
session.prefersEphemeralWebBrowserSession = true
|
|
147
144
|
currentSession = session
|
|
148
145
|
session.start()
|
|
@@ -364,7 +361,6 @@ class TwitterProvider: NSObject {
|
|
|
364
361
|
}
|
|
365
362
|
|
|
366
363
|
extension TwitterProvider: ASWebAuthenticationPresentationContextProviding {
|
|
367
|
-
@available(iOS 13.0, *)
|
|
368
364
|
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
|
|
369
365
|
return UIApplication.shared.windows.first { $0.isKeyWindow } ?? ASPresentationAnchor()
|
|
370
366
|
}
|