@capgo/capacitor-social-login 8.2.2 → 8.2.4

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/Package.swift CHANGED
@@ -16,7 +16,7 @@ let package = Package(
16
16
  // Add Google Sign-In dependency
17
17
  .package(url: "https://github.com/google/GoogleSignIn-iOS.git", .upToNextMajor(from: "9.0.0")),
18
18
  // Alamofire
19
- .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.9.0"))
19
+ .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.11.0"))
20
20
  ],
21
21
  targets: [
22
22
  .target(
@@ -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.2";
22
+ private final String pluginVersion = "8.2.4";
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
- if #available(iOS 11.2, *) {
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
- if #available(iOS 14, *) {
176
- DispatchQueue.main.async {
177
- ATTrackingManager.requestTrackingAuthorization { status in
178
- let statusString: String
179
- switch status {
180
- case .authorized:
181
- statusString = "authorized"
182
- case .denied:
183
- statusString = "denied"
184
- case .notDetermined:
185
- statusString = "notDetermined"
186
- case .restricted:
187
- statusString = "restricted"
188
- @unknown default:
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
- if #available(iOS 13.0, *) {
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.2"
18
+ private let pluginVersion: String = "8.2.4"
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
- if #available(iOS 13.0, *) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-social-login",
3
- "version": "8.2.2",
3
+ "version": "8.2.4",
4
4
  "description": "All social logins in one plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",