Skip to content

Commit b4c7a2d

Browse files
committed
feat: complete ios support
1 parent 6c12c70 commit b4c7a2d

File tree

9 files changed

+312
-495
lines changed

9 files changed

+312
-495
lines changed

android/src/main/java/app/akiles/reactnative/AkilesModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class AkilesModule(reactContext: ReactApplicationContext) :
308308
}
309309

310310
@ReactMethod
311-
override fun scan(timeout: Double): String {
311+
override fun scan(): String {
312312
val opId = UUID.randomUUID().toString()
313313
val cancel = akiles.scan(object : ScanCallback {
314314
override fun onDiscover(hw: Hardware) {
@@ -346,7 +346,7 @@ class AkilesModule(reactContext: ReactApplicationContext) :
346346
}
347347

348348
@ReactMethod
349-
override fun sync(sessionID: String, hardwareID: String, timeout: Double): String {
349+
override fun sync(sessionID: String, hardwareID: String): String {
350350
val opId = UUID.randomUUID().toString()
351351
val cancel = akiles.sync(sessionID, hardwareID, object : app.akiles.sdk.SyncCallback {
352352
override fun onStatus(status: app.akiles.sdk.SyncStatus) {

example/ios/AkilesExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
/* Begin PBXShellScriptBuildPhase section */
170170
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
171171
isa = PBXShellScriptBuildPhase;
172-
buildActionMask = 2147483647;
172+
buildActionMask = 12;
173173
files = (
174174
);
175175
inputPaths = (
@@ -185,7 +185,7 @@
185185
};
186186
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
187187
isa = PBXShellScriptBuildPhase;
188-
buildActionMask = 2147483647;
188+
buildActionMask = 12;
189189
files = (
190190
);
191191
inputFileListPaths = (

example/ios/AkilesExample/Info.plist

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,18 @@
3333
<true/>
3434
</dict>
3535
<key>NSLocationWhenInUseUsageDescription</key>
36-
<string></string>
36+
<string>This app needs location access to discover and connect to nearby Akiles devices via Bluetooth.</string>
37+
<key>NSBluetoothAlwaysUsageDescription</key>
38+
<string>This app uses Bluetooth to communicate with Akiles access control devices.</string>
39+
<key>NSBluetoothPeripheralUsageDescription</key>
40+
<string>This app uses Bluetooth to communicate with Akiles access control devices.</string>
41+
<key>com.apple.developer.nfc.readersession.formats</key>
42+
<array>
43+
<string>NDEF</string>
44+
<string>TAG</string>
45+
</array>
46+
<key>NFCReaderUsageDescription</key>
47+
<string>This app uses NFC to read and update access cards.</string>
3748
<key>UILaunchStoryboardName</key>
3849
<string>LaunchScreen</string>
3950
<key>UIRequiredDeviceCapabilities</key>

example/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function App() {
6161

6262
useEffect(() => {
6363
setBluetoothSupported(ak.isBluetoothSupported());
64-
setCardEmulationSupported(ak.isCardEmulationSupported());
64+
ak.isCardEmulationSupported().then(setCardEmulationSupported);
6565
}, []);
6666

6767
useEffect(() => {
@@ -173,7 +173,7 @@ export default function App() {
173173
setScanHardwares([]);
174174
setSelectedHardware(undefined);
175175
setResult('Scanning...');
176-
const cancel = ak.scan(10000, {
176+
const cancel = ak.scan({
177177
onDiscover: (hw) => {
178178
setScanHardwares((prev) => {
179179
if (prev.find((h) => h.id === hw.id)) return prev;
@@ -207,7 +207,7 @@ export default function App() {
207207
return;
208208
}
209209
setResult('Sync started...');
210-
const cancel = ak.sync(selectedSession, selectedHardware, 10000, {
210+
const cancel = ak.sync(selectedSession, selectedHardware, {
211211
onStatus: (status) => setResult('Sync status: ' + status),
212212
onStatusProgress: (percent) =>
213213
setResult('Sync progress: ' + Math.round(percent) + '%'),

ios/AkilesAdapter.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#import <React/RCTBridgeModule.h>
22
#import <React/RCTEventEmitter.h>
33

4-
#ifdef RCT_NEW_ARCH_ENABLED
5-
#import <AkilesSpec/AkilesSpec.h>
6-
7-
@interface AkilesAdapter : RCTEventEmitter <NativeAkilesSpec>
8-
#else
94
@interface AkilesAdapter : RCTEventEmitter <RCTBridgeModule>
10-
#endif
115

126
@end

0 commit comments

Comments
 (0)