@smileid/usesmileid_vision_document 12.3.1-SNAPSHOT.77 → 12.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  Full release notes: [Smile ID docs](https://docs.usesmileid.com/developer-resources/sdks/mobile/release-notes/react-native-expo).
2
2
 
3
+ ## 12.4.0
4
+
5
+ See the repository CHANGELOG for the 12.4.0 release notes.
6
+
7
+
3
8
  ## 12.3.0
4
9
 
5
10
  See the repository CHANGELOG for the 12.3.0 release notes.
@@ -110,22 +110,36 @@ public class UseSmileIDVisionDocumentModule: Module {
110
110
  }
111
111
  }
112
112
 
113
+ /// A new session folder under the capture root, `Application Support/UseSmileID`: not Caches, so
114
+ /// the OS cannot evict in-flight frames between capture and submission. The root is excluded from
115
+ /// iCloud and Finder backup before any session folder is made below it. When it can't be made or
116
+ /// excluded, the session goes under the temporary directory, which no backup takes, so a frame
117
+ /// never lands where a backup would copy it (MASVS-STORAGE-2). iOS may clear that folder while
118
+ /// the app isn't running, so a capture kept there for a later upload can be gone by then.
113
119
  private static func freshSessionDirectory() -> URL {
114
- // Application Support — not Caches — so the OS cannot evict
115
- // in-flight capture frames between capture and submission under
116
- // memory pressure. The root is flagged out of iCloud / iTunes
117
- // backup so biometric frames never leave the device.
118
- let support = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first
119
- ?? FileManager.default.temporaryDirectory
120
- var root = support.appendingPathComponent("UseSmileID", isDirectory: true)
121
- try? FileManager.default.createDirectory(at: root, withIntermediateDirectories: true)
122
- var resourceValues = URLResourceValues()
123
- resourceValues.isExcludedFromBackup = true
124
- try? root.setResourceValues(resourceValues)
120
+ let fileManager = FileManager.default
121
+ let support = fileManager.urls(for: .applicationSupportDirectory, in: .userDomainMask).first
122
+ let root = excludedCaptureRoot(under: support)
123
+ ?? fileManager.temporaryDirectory.appendingPathComponent("UseSmileID", isDirectory: true)
125
124
  let dir = root.appendingPathComponent(String(Int(Date().timeIntervalSince1970 * 1000)), isDirectory: true)
126
- try? FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)
125
+ try? fileManager.createDirectory(at: dir, withIntermediateDirectories: true)
127
126
  return dir
128
127
  }
128
+
129
+ /// `UseSmileID` under `support`, made and excluded from backup, or nil when either step fails.
130
+ private static func excludedCaptureRoot(under support: URL?) -> URL? {
131
+ guard let support else { return nil }
132
+ var root = support.appendingPathComponent("UseSmileID", isDirectory: true)
133
+ do {
134
+ try FileManager.default.createDirectory(at: root, withIntermediateDirectories: true)
135
+ var resourceValues = URLResourceValues()
136
+ resourceValues.isExcludedFromBackup = true
137
+ try root.setResourceValues(resourceValues)
138
+ return root
139
+ } catch {
140
+ return nil
141
+ }
142
+ }
129
143
  }
130
144
 
131
145
  private extension Dictionary where Key == String, Value == Any? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smileid/usesmileid_vision_document",
3
- "version": "12.3.1-SNAPSHOT.77",
3
+ "version": "12.4.0",
4
4
  "description": "Apple Vision document detection implementation for the UseSmileID React Native (Expo) SDK.",
5
5
  "homepage": "https://usesmileid.com",
6
6
  "repository": {
@@ -46,8 +46,8 @@
46
46
  "CHANGELOG.md"
47
47
  ],
48
48
  "dependencies": {
49
- "@smileid/usesmileid_bridge": "12.3.1-SNAPSHOT.77",
50
- "@smileid/usesmileid_platform_interface": "12.3.1-SNAPSHOT.77"
49
+ "@smileid/usesmileid_bridge": "12.4.0",
50
+ "@smileid/usesmileid_platform_interface": "12.4.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "expo": ">=56.0.0",
@@ -57,7 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@types/node": "^26.6.4",
59
59
  "expo": "~57.0.26",
60
- "expo-modules-core": "^57.0.23",
60
+ "expo-modules-core": "^57.0.24",
61
61
  "react-native": "^0.86.3",
62
62
  "typescript": "^6.0.3"
63
63
  },