Skip to content

Commit

Permalink
Merge pull request #72 from functionland/ios-error-init-checkConnection
Browse files Browse the repository at this point in the history
fix(ios): correct ios version
  • Loading branch information
ehsan6sha authored Sep 10, 2023
2 parents 7ab62a2 + 9245409 commit 89ac450
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 111 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require Pod::Executable.execute_command('node', ['-p',
{paths: [process.argv[1]]},
)', __dir__]).strip

platform :ios, '13.0'
platform :ios, '14.0'
prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ PODS:
- React-jsinspector (0.72.3)
- React-logger (0.72.3):
- glog
- react-native-fula (1.14.2):
- react-native-fula (1.14.6):
- CryptoSwift (~> 1.7.1)
- Fula (~> 1.0.0)
- RCT-Folly (= 2021.07.22.00)
Expand Down Expand Up @@ -712,7 +712,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 59d1eb03af7d30b7d66589c410f13151271e8006
React-jsinspector: b511447170f561157547bc0bef3f169663860be7
React-logger: c5b527272d5f22eaa09bb3c3a690fee8f237ae95
react-native-fula: f7df65e1d0931640568e9e19eb048ce40fd348f9
react-native-fula: 17a71317faa0b12fdb5d77c4d4560972be871ec7
React-NativeModulesApple: c57f3efe0df288a6532b726ad2d0322a9bf38472
React-perflogger: 6bd153e776e6beed54c56b0847e1220a3ff92ba5
React-RCTActionSheet: c0b62af44e610e69d9a2049a682f5dba4e9dff17
Expand All @@ -737,6 +737,6 @@ SPEC CHECKSUMS:
Yoga: 8796b55dba14d7004f980b54bcc9833ee45b28ce
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 18e6e42feb52b2840969de671a351f681edeffed
PODFILE CHECKSUM: 894d220cf9833d2e19f55138952974df1c3d2b30

COCOAPODS: 1.12.0
COCOAPODS: 1.12.1
15 changes: 14 additions & 1 deletion ios/Cryptography.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import Foundation
import CommonCrypto
import CryptoSwift
import os.log



public class Cryptography: NSObject {
public static func encryptMsg(_ message: Array<UInt8>, _ secretKey: Array<UInt8>)
throws -> String {
OSLog.viewCycle.info("ReactNative encryptMsg started for \(message)")
let aes = try! AES(key: secretKey, blockMode: ECB(), padding: .pkcs5)
OSLog.viewCycle.info("ReactNative encryptMsg aes")
let encrypted = try! aes.encrypt(message)
return Data(encrypted).base64EncodedString()
OSLog.viewCycle.info("ReactNative encryptMsg encrypted")
do{
let data = Data(encrypted).base64EncodedString()
OSLog.viewCycle.info("ReactNative encryptMsg: \(data)")
return data
} catch let error {
OSLog.viewCycle.info("ReactNative encryptMsg error: \(error.localizedDescription)")
throw error
}
}

public static func decryptMsg(_ cipherText: String, _ secretKey: Array<UInt8>)
Expand Down
2 changes: 1 addition & 1 deletion ios/Fula.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@interface RCT_EXTERN_MODULE(FulaModule, NSObject)

RCT_EXTERN_METHOD(checkConnection: (NSNumber *) timeout
RCT_EXTERN_METHOD(checkConnection: (nonnull NSNumber *) timeout
withResolver:(RCTPromiseResolveBlock)resolve
withRejecter:(RCTPromiseRejectBlock)reject)

Expand Down
Loading

0 comments on commit 89ac450

Please sign in to comment.