react-native-plaid-link-sdk 12.8.8 → 12.8.9

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 (39) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/README.md +1 -0
  3. package/android/src/main/AndroidManifest.xml +1 -1
  4. package/dist/src/PlaidLink.js +1 -4
  5. package/dist/src/Types.d.ts +43 -2
  6. package/dist/src/Types.js +12 -0
  7. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +2 -0
  8. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +13 -0
  9. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/PLKPlaid.h +49 -0
  10. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
  11. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
  12. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +2352 -1094
  13. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +29 -0
  14. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  15. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +29 -0
  16. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  17. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Threads_Threads.bundle/Info.plist +0 -0
  18. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +17 -17
  19. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +26 -0
  20. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/PLKPlaid.h +49 -0
  21. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
  22. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
  23. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +2352 -1094
  24. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +29 -0
  25. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  26. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +29 -0
  27. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
  28. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +2352 -1094
  29. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +29 -0
  30. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  31. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +29 -0
  32. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  33. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Threads_Threads.bundle/Info.plist +0 -0
  34. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +27 -27
  35. package/ios/RNLinksdk.mm +14 -4
  36. package/package.json +1 -1
  37. package/src/PlaidLink.tsx +1 -4
  38. package/src/Types.ts +54 -2
  39. package/src/__tests__/FinanceKitErrors.tests.js +60 -0
@@ -575,6 +575,23 @@ public struct PlaidFinanceKit {
575
575
  public static func sync(token: Swift.String, requestAuthorizationIfNeeded: Swift.Bool, syncBehavior: LinkKit.PlaidFinanceKit.SyncBehavior = .live, completion: @escaping (Swift.Result<Swift.Void, LinkKit.FinanceKitError>) -> Swift.Void)
576
576
  @available(iOS 17.4, *)
577
577
  public static func sync(token: Swift.String, requestAuthorizationIfNeeded: Swift.Bool, syncBehavior: LinkKit.PlaidFinanceKit.SyncBehavior = .live) async throws
578
+ @available(iOS 17.4, *)
579
+ public enum Status {
580
+ case unavailable
581
+ case notDetermined
582
+ case denied
583
+ case authorized
584
+ case unknown
585
+ public static func == (a: LinkKit.PlaidFinanceKit.Status, b: LinkKit.PlaidFinanceKit.Status) -> Swift.Bool
586
+ public func hash(into hasher: inout Swift.Hasher)
587
+ public var hashValue: Swift.Int {
588
+ get
589
+ }
590
+ }
591
+ @available(iOS 17.4, *)
592
+ public static func status(completion: @escaping (LinkKit.PlaidFinanceKit.Status) -> Swift.Void)
593
+ @available(iOS 17.4, *)
594
+ public static func status() async -> LinkKit.PlaidFinanceKit.Status
578
595
  }
579
596
  public enum VerificationStatus : Swift.CustomStringConvertible, Swift.Codable {
580
597
  case pendingAutomaticVerification
@@ -615,6 +632,8 @@ public enum AssetReportErrorCode : Swift.Error, Swift.CustomStringConvertible {
615
632
  @_inheritsConvenienceInitializers @objc public class PLKPlaidFinanceKit : ObjectiveC.NSObject {
616
633
  @available(iOS 17.4, *)
617
634
  @objc public static func sync(token: Swift.String, requestAuthorizationIfNeeded: Swift.Bool, syncBehavior: LinkKit.PLKSyncBehavior, onSuccess: @escaping () -> Swift.Void, onError: @escaping (Foundation.NSError) -> Swift.Void)
635
+ @available(iOS 17.4, *)
636
+ @objc public static func status(completion: @escaping (LinkKit.PLKFinanceKitStatus) -> Swift.Void)
618
637
  @objc override dynamic public init()
619
638
  @objc deinit
620
639
  }
@@ -648,6 +667,12 @@ public enum FinanceKitError : Foundation.LocalizedError {
648
667
  case permissionError(message: Swift.String)
649
668
  case linkApiError(message: Swift.String)
650
669
  case permissionAccessError(message: Swift.String)
670
+ case permissionNotRequested(message: Swift.String)
671
+ case dataUnavailable(message: Swift.String)
672
+ case noAccounts(message: Swift.String)
673
+ case syncFailed(errorType: Swift.String, errorCode: Swift.String, message: Swift.String)
674
+ case channelClosed(message: Swift.String)
675
+ case syncTimedOut(message: Swift.String)
651
676
  case unknown(error: any Swift.Error)
652
677
  public var errorDescription: Swift.String? {
653
678
  get
@@ -722,3 +747,7 @@ extension LinkKit.Product : Swift.Hashable {}
722
747
  extension LinkKit.PlaidFinanceKit.SyncBehavior : Swift.Equatable {}
723
748
  @available(iOS 17.4, *)
724
749
  extension LinkKit.PlaidFinanceKit.SyncBehavior : Swift.Hashable {}
750
+ @available(iOS 17.4, *)
751
+ extension LinkKit.PlaidFinanceKit.Status : Swift.Equatable {}
752
+ @available(iOS 17.4, *)
753
+ extension LinkKit.PlaidFinanceKit.Status : Swift.Hashable {}
@@ -575,6 +575,23 @@ public struct PlaidFinanceKit {
575
575
  public static func sync(token: Swift.String, requestAuthorizationIfNeeded: Swift.Bool, syncBehavior: LinkKit.PlaidFinanceKit.SyncBehavior = .live, completion: @escaping (Swift.Result<Swift.Void, LinkKit.FinanceKitError>) -> Swift.Void)
576
576
  @available(iOS 17.4, *)
577
577
  public static func sync(token: Swift.String, requestAuthorizationIfNeeded: Swift.Bool, syncBehavior: LinkKit.PlaidFinanceKit.SyncBehavior = .live) async throws
578
+ @available(iOS 17.4, *)
579
+ public enum Status {
580
+ case unavailable
581
+ case notDetermined
582
+ case denied
583
+ case authorized
584
+ case unknown
585
+ public static func == (a: LinkKit.PlaidFinanceKit.Status, b: LinkKit.PlaidFinanceKit.Status) -> Swift.Bool
586
+ public func hash(into hasher: inout Swift.Hasher)
587
+ public var hashValue: Swift.Int {
588
+ get
589
+ }
590
+ }
591
+ @available(iOS 17.4, *)
592
+ public static func status(completion: @escaping (LinkKit.PlaidFinanceKit.Status) -> Swift.Void)
593
+ @available(iOS 17.4, *)
594
+ public static func status() async -> LinkKit.PlaidFinanceKit.Status
578
595
  }
579
596
  public enum VerificationStatus : Swift.CustomStringConvertible, Swift.Codable {
580
597
  case pendingAutomaticVerification
@@ -615,6 +632,8 @@ public enum AssetReportErrorCode : Swift.Error, Swift.CustomStringConvertible {
615
632
  @_inheritsConvenienceInitializers @objc public class PLKPlaidFinanceKit : ObjectiveC.NSObject {
616
633
  @available(iOS 17.4, *)
617
634
  @objc public static func sync(token: Swift.String, requestAuthorizationIfNeeded: Swift.Bool, syncBehavior: LinkKit.PLKSyncBehavior, onSuccess: @escaping () -> Swift.Void, onError: @escaping (Foundation.NSError) -> Swift.Void)
635
+ @available(iOS 17.4, *)
636
+ @objc public static func status(completion: @escaping (LinkKit.PLKFinanceKitStatus) -> Swift.Void)
618
637
  @objc override dynamic public init()
619
638
  @objc deinit
620
639
  }
@@ -648,6 +667,12 @@ public enum FinanceKitError : Foundation.LocalizedError {
648
667
  case permissionError(message: Swift.String)
649
668
  case linkApiError(message: Swift.String)
650
669
  case permissionAccessError(message: Swift.String)
670
+ case permissionNotRequested(message: Swift.String)
671
+ case dataUnavailable(message: Swift.String)
672
+ case noAccounts(message: Swift.String)
673
+ case syncFailed(errorType: Swift.String, errorCode: Swift.String, message: Swift.String)
674
+ case channelClosed(message: Swift.String)
675
+ case syncTimedOut(message: Swift.String)
651
676
  case unknown(error: any Swift.Error)
652
677
  public var errorDescription: Swift.String? {
653
678
  get
@@ -722,3 +747,7 @@ extension LinkKit.Product : Swift.Hashable {}
722
747
  extension LinkKit.PlaidFinanceKit.SyncBehavior : Swift.Equatable {}
723
748
  @available(iOS 17.4, *)
724
749
  extension LinkKit.PlaidFinanceKit.SyncBehavior : Swift.Hashable {}
750
+ @available(iOS 17.4, *)
751
+ extension LinkKit.PlaidFinanceKit.Status : Swift.Equatable {}
752
+ @available(iOS 17.4, *)
753
+ extension LinkKit.PlaidFinanceKit.Status : Swift.Hashable {}
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Headers/LinkKit-Swift.h</key>
8
8
  <data>
9
- iuy2O9yS6zoFgcgHiE3BDZ/e6cM=
9
+ 5JvxC+iQA557aG6dukcgLVFY31Y=
10
10
  </data>
11
11
  <key>Headers/LinkKit.h</key>
12
12
  <data>
@@ -18,31 +18,31 @@
18
18
  </data>
19
19
  <key>Headers/PLKPlaid.h</key>
20
20
  <data>
21
- xLucKWLQ3ehFX1ZgMhhDlPE4eVk=
21
+ Kqbah5nDWA66Zu8GMdaAUlR2aaM=
22
22
  </data>
23
23
  <key>Info.plist</key>
24
24
  <data>
25
- GnC92P/EX3L0NjGhS5n0T92BOwU=
25
+ yOaFTZN2YgWuo9i7ZjiovLKfQQU=
26
26
  </data>
27
27
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json</key>
28
28
  <data>
29
- vUSz92A/3uxG8RlrAnoafLta9uc=
29
+ hG8qPVnDNR0JhbwMIH1FmS5oHiU=
30
30
  </data>
31
31
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface</key>
32
32
  <data>
33
- frZ8TKdHvhIspn09j9OyBUc6+8o=
33
+ 5GnZ8hN2HOP2kD/VqLf4qR/Kvds=
34
34
  </data>
35
35
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc</key>
36
36
  <data>
37
- qF6ViLf2C8JLajvrsfiHz0xF1VM=
37
+ Cyv3UNraubX2CvJYg07QxfrKK38=
38
38
  </data>
39
39
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface</key>
40
40
  <data>
41
- frZ8TKdHvhIspn09j9OyBUc6+8o=
41
+ 5GnZ8hN2HOP2kD/VqLf4qR/Kvds=
42
42
  </data>
43
43
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule</key>
44
44
  <data>
45
- kGtgcizK9ULVK92TUfyXldEKrOY=
45
+ RcHzk6+CPiY3Hw6NUHl4MBBwFUI=
46
46
  </data>
47
47
  <key>Modules/module.modulemap</key>
48
48
  <data>
@@ -58,7 +58,7 @@
58
58
  </data>
59
59
  <key>Threads_Threads.bundle/Info.plist</key>
60
60
  <data>
61
- eYJT7t7zQJofb5PWs3wM0BRhqVk=
61
+ IVG4BtnCA9CMiajW1JkzHCGaI90=
62
62
  </data>
63
63
  </dict>
64
64
  <key>files2</key>
@@ -67,7 +67,7 @@
67
67
  <dict>
68
68
  <key>hash2</key>
69
69
  <data>
70
- ZS0iF+cZ4myIFFzrBDzrHyPkb8glv0Cu027eRYgbJEI=
70
+ TYpMEaKdxJ5XJKRke+hqRPP5OU3UwygCrwskjU159bM=
71
71
  </data>
72
72
  </dict>
73
73
  <key>Headers/LinkKit.h</key>
@@ -88,42 +88,42 @@
88
88
  <dict>
89
89
  <key>hash2</key>
90
90
  <data>
91
- eFJ4ar5oIQyfDMWSxCT1uO77sA3sHcqLQkRv/vSH13w=
91
+ 9DvUWsLVtfSMX1yUaBEteHF8DgobeP24TtjIBwOAoI4=
92
92
  </data>
93
93
  </dict>
94
94
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json</key>
95
95
  <dict>
96
96
  <key>hash2</key>
97
97
  <data>
98
- pKgGgK7ACxQtJJf/N4WWglgfTVH2L/W/lZwGlKgR4QA=
98
+ XSDexsEnI1XeRFDoiW6TY977j2Xam//WvbE7cWodsHk=
99
99
  </data>
100
100
  </dict>
101
101
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface</key>
102
102
  <dict>
103
103
  <key>hash2</key>
104
104
  <data>
105
- 8YgccyfAV7+279d7GFn7enydBUIVlGjlB1K+tIsyz0w=
105
+ 9I7A3vX1F0t1ard6KPZGYboQhXJDLjBYeP/UCQOKdsU=
106
106
  </data>
107
107
  </dict>
108
108
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc</key>
109
109
  <dict>
110
110
  <key>hash2</key>
111
111
  <data>
112
- dX3SeMaRY6QMsF7tqWdrz87z+uqfEaldiMeCmKv+eKs=
112
+ HTvEDGX+RU714HLsf227bww063OKJQzQmimun9W9q9M=
113
113
  </data>
114
114
  </dict>
115
115
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface</key>
116
116
  <dict>
117
117
  <key>hash2</key>
118
118
  <data>
119
- 8YgccyfAV7+279d7GFn7enydBUIVlGjlB1K+tIsyz0w=
119
+ 9I7A3vX1F0t1ard6KPZGYboQhXJDLjBYeP/UCQOKdsU=
120
120
  </data>
121
121
  </dict>
122
122
  <key>Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule</key>
123
123
  <dict>
124
124
  <key>hash2</key>
125
125
  <data>
126
- L+n14ep3vfKkevIax5vV4UQun7VKuuv4iUJoAzVel68=
126
+ wV8dbesuHN3L9csa+eKpj5Hq8dy1oxHiGxYGfEItADs=
127
127
  </data>
128
128
  </dict>
129
129
  <key>Modules/module.modulemap</key>
@@ -151,7 +151,7 @@
151
151
  <dict>
152
152
  <key>hash2</key>
153
153
  <data>
154
- FhXL0VWEOZjWELukdFG/NUMYDiG5C3T/A/zIb3dKRrk=
154
+ eub7tPdzUu36vVqo+9l8xIUYNzTQlyIsch8IlINBCtE=
155
155
  </data>
156
156
  </dict>
157
157
  </dict>
@@ -343,6 +343,19 @@ SWIFT_CLASS("_TtC7LinkKit18PLKPlaidFinanceKit")
343
343
  /// \param onError Closure executed when the sync fails, providing an NSError.
344
344
  ///
345
345
  + (void)syncWithToken:(NSString * _Nonnull)token requestAuthorizationIfNeeded:(BOOL)requestAuthorizationIfNeeded syncBehavior:(PLKSyncBehavior)syncBehavior onSuccess:(void (^ _Nonnull)(void))onSuccess onError:(void (^ _Nonnull)(NSError * _Nonnull))onError SWIFT_AVAILABILITY(ios,introduced=17.4);
346
+ /// Reports whether a FinanceKit sync can run on this phone, without prompting the user.
347
+ /// Use it to decide whether to show an Apple Card option at all (PLKFinanceKitStatusUnavailable),
348
+ /// whether to pass requestAuthorizationIfNeeded:YES to <code>sync</code> (PLKFinanceKitStatusNotDetermined), or
349
+ /// to send the user to Settings instead of syncing (PLKFinanceKitStatusDenied).
350
+ /// warning:
351
+ /// Needs the same FinanceKit entitlement as <code>sync</code>; without it FinanceKit terminates the
352
+ /// process. With the entitlement it is safe to call on any device running iOS 17.4 or later,
353
+ /// including an iPad running your app in compatibility mode.
354
+ /// note:
355
+ /// Available on iOS 17.4 and later.
356
+ /// \param completion Called with the current status, not necessarily on the main queue.
357
+ ///
358
+ + (void)statusWithCompletion:(void (^ _Nonnull)(PLKFinanceKitStatus))completion SWIFT_AVAILABILITY(ios,introduced=17.4);
346
359
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
347
360
  @end
348
361
 
@@ -703,6 +716,19 @@ SWIFT_CLASS("_TtC7LinkKit18PLKPlaidFinanceKit")
703
716
  /// \param onError Closure executed when the sync fails, providing an NSError.
704
717
  ///
705
718
  + (void)syncWithToken:(NSString * _Nonnull)token requestAuthorizationIfNeeded:(BOOL)requestAuthorizationIfNeeded syncBehavior:(PLKSyncBehavior)syncBehavior onSuccess:(void (^ _Nonnull)(void))onSuccess onError:(void (^ _Nonnull)(NSError * _Nonnull))onError SWIFT_AVAILABILITY(ios,introduced=17.4);
719
+ /// Reports whether a FinanceKit sync can run on this phone, without prompting the user.
720
+ /// Use it to decide whether to show an Apple Card option at all (PLKFinanceKitStatusUnavailable),
721
+ /// whether to pass requestAuthorizationIfNeeded:YES to <code>sync</code> (PLKFinanceKitStatusNotDetermined), or
722
+ /// to send the user to Settings instead of syncing (PLKFinanceKitStatusDenied).
723
+ /// warning:
724
+ /// Needs the same FinanceKit entitlement as <code>sync</code>; without it FinanceKit terminates the
725
+ /// process. With the entitlement it is safe to call on any device running iOS 17.4 or later,
726
+ /// including an iPad running your app in compatibility mode.
727
+ /// note:
728
+ /// Available on iOS 17.4 and later.
729
+ /// \param completion Called with the current status, not necessarily on the main queue.
730
+ ///
731
+ + (void)statusWithCompletion:(void (^ _Nonnull)(PLKFinanceKitStatus))completion SWIFT_AVAILABILITY(ios,introduced=17.4);
706
732
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
707
733
  @end
708
734
 
@@ -368,6 +368,10 @@ static NSString *const kPLKExitErrorRawJSONKey = @"PLKExitErrorRawJSONKey";
368
368
  static NSString *const kPLKExitErrorUnknownTypeKey = @"kPLKExitErrorUnknownTypeKey";
369
369
  static NSString *const kPLKExitErrorCodeKey = @"kPLKExitErrorCodeKey";
370
370
 
371
+ /// userInfo keys on the NSError for PLKPlaidFinanceKitErrorSyncFailed: the API error type and code the server ended the sync with.
372
+ static NSString *const kPLKFinanceKitErrorTypeKey = @"PLKFinanceKitErrorTypeKey";
373
+ static NSString *const kPLKFinanceKitErrorCodeKey = @"PLKFinanceKitErrorCodeKey";
374
+
371
375
  static NSString *const kPLKExitErrorInvalidRequestDomain = @"PLKExitErrorInvalidRequestDomain";
372
376
  static NSString *const kPLKExitErrorInvalidInputDomain = @"PLKExitErrorInvalidInputDomain";
373
377
  static NSString *const kPLKExitErrorInstitutionErrorDomain = @"PLKExitErrorInstitutionErrorDomain";
@@ -640,6 +644,51 @@ typedef void(^PLKDismissalHandler)(UIViewController *);
640
644
 
641
645
  @end
642
646
 
647
+ /// The `code` of the NSError a FinanceKit sync fails with, in the kPLKDefaultErrorDomain domain. The values
648
+ /// are stable; new cases are only added at the end.
649
+ typedef NS_ENUM(NSInteger, PLKPlaidFinanceKitError) {
650
+ PLKPlaidFinanceKitErrorInvalidToken = 0,
651
+ PLKPlaidFinanceKitErrorPermissionError = 1,
652
+ PLKPlaidFinanceKitErrorLinkApiError = 2,
653
+ PLKPlaidFinanceKitErrorPermissionAccessError = 3,
654
+ PLKPlaidFinanceKitErrorUnknown = 4,
655
+ /// The sync ended because Apple returned no accounts shared with this app.
656
+ PLKPlaidFinanceKitErrorNoAccounts = 5,
657
+ /// The server ended the sync with another API error, given under kPLKFinanceKitErrorTypeKey and
658
+ /// kPLKFinanceKitErrorCodeKey in the error's userInfo.
659
+ PLKPlaidFinanceKitErrorSyncFailed = 6,
660
+ /// FinanceKit access has not been requested yet and the sync was told not to request it.
661
+ PLKPlaidFinanceKitErrorPermissionNotRequested = 7,
662
+ /// This device, region or OS version cannot provide FinanceKit data. The sync did not start.
663
+ PLKPlaidFinanceKitErrorDataUnavailable = 8,
664
+ /// The server closed the sync channel before the sync completed. Start a new sync to retry.
665
+ PLKPlaidFinanceKitErrorChannelClosed = 9,
666
+ /// iOS was about to suspend the app, or an hour passed, before the sync finished. Start a new sync
667
+ /// while the app is active to retry.
668
+ PLKPlaidFinanceKitErrorSyncTimedOut = 10
669
+ };
670
+
671
+ /// What `+[PLKPlaidFinanceKit statusWithCompletion:]` reports: whether a FinanceKit sync can run on this
672
+ /// phone, and what the user has decided about sharing Wallet data with your app. Reading it never prompts,
673
+ /// but it needs the same FinanceKit entitlement as a sync; without it FinanceKit terminates the process.
674
+ typedef NS_ENUM(NSInteger, PLKFinanceKitStatus) {
675
+ /// FinanceKit cannot provide financial data on this device, region or OS version. A sync would fail with
676
+ /// PLKPlaidFinanceKitErrorDataUnavailable, so do not offer Apple Card here.
677
+ PLKFinanceKitStatusUnavailable,
678
+ /// The user has never been asked. A sync with requestAuthorizationIfNeeded:YES shows Apple's prompt;
679
+ /// with NO it fails with PLKPlaidFinanceKitErrorPermissionNotRequested.
680
+ PLKFinanceKitStatusNotDetermined,
681
+ /// The user declined Apple's prompt, or turned sharing off later. iOS will not prompt again; only the user
682
+ /// can change it, under Settings > Apps > (your app) > Wallet. A sync fails with
683
+ /// PLKPlaidFinanceKitErrorPermissionAccessError.
684
+ PLKFinanceKitStatusDenied,
685
+ /// Your app may read the user's Wallet data. An Apple Card in the Wallet, or any account shared with your
686
+ /// app, is not guaranteed, so a sync can still end with PLKPlaidFinanceKitErrorNoAccounts.
687
+ PLKFinanceKitStatusAuthorized,
688
+ /// FinanceKit did not report a status. Treat it like NotDetermined and let the sync decide.
689
+ PLKFinanceKitStatusUnknown
690
+ };
691
+
643
692
  typedef NS_ENUM(NSInteger, PLKSyncBehavior) {
644
693
  PLKSyncBehaviorLive,
645
694
  PLKSyncBehaviorSimulated