From c5ff2056a2ff21b83bda9a0d04f8b5513381d145 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Fri, 19 Jul 2024 17:58:41 -0600 Subject: [PATCH 1/5] fix: sqlcipher in the bindings --- android/build.gradle | 2 +- example/ios/Podfile.lock | 22 ++++++------------- .../project.pbxproj | 2 -- ios/XMTPReactNative.podspec | 3 +-- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index ff3fe7eb6..fcc62ea94 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -98,7 +98,7 @@ repositories { dependencies { implementation project(':expo-modules-core') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}" - implementation "org.xmtp:android:0.14.7" + implementation "org.xmtp:android:0.14.8" implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.facebook.react:react-native:0.71.3' implementation "com.daveanthonythomas.moshipack:moshipack:1.0.1" diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ebf6ff0ec..eef599503 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -56,7 +56,7 @@ PODS: - hermes-engine/Pre-built (= 0.71.14) - hermes-engine/Pre-built (0.71.14) - libevent (2.1.12) - - LibXMTP (0.5.4-beta4) + - LibXMTP (0.5.6-beta0) - Logging (1.0.0) - MessagePacker (0.4.7) - MMKV (1.3.7): @@ -443,28 +443,22 @@ PODS: - RNSVG (13.14.0): - React-Core - secp256k1.swift (0.1.4) - - SQLCipher (4.6.0): - - SQLCipher/standard (= 4.6.0) - - SQLCipher/common (4.6.0) - - SQLCipher/standard (4.6.0): - - SQLCipher/common - SwiftProtobuf (1.25.2) - web3.swift (1.6.0): - BigInt (~> 5.0.0) - GenericJSON (~> 2.0) - Logging (~> 1.0.0) - secp256k1.swift (~> 0.1) - - XMTP (0.13.6): + - XMTP (0.13.7): - Connect-Swift (= 0.12.0) - GzipSwift - - LibXMTP (= 0.5.4-beta4) + - LibXMTP (= 0.5.6-beta0) - web3.swift - XMTPReactNative (0.1.0): - ExpoModulesCore - MessagePacker - secp256k1.swift - - SQLCipher - - XMTP (= 0.13.6) + - XMTP (= 0.13.7) - Yoga (1.14.0) DEPENDENCIES: @@ -553,7 +547,6 @@ SPEC REPOS: - MMKVCore - OpenSSL-Universal - secp256k1.swift - - SQLCipher - SwiftProtobuf - web3.swift - XMTP @@ -718,7 +711,7 @@ SPEC CHECKSUMS: GzipSwift: 893f3e48e597a1a4f62fafcb6514220fcf8287fa hermes-engine: d7cc127932c89c53374452d6f93473f1970d8e88 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 - LibXMTP: 97cafc8cdde820552c9960739397fef256b635fa + LibXMTP: e7682dedb10e18343c011280d494a8e4a43d9eb7 Logging: 9ef4ecb546ad3169398d5a723bc9bea1c46bef26 MessagePacker: ab2fe250e86ea7aedd1a9ee47a37083edd41fd02 MMKV: 36a22a9ec84c9bb960613a089ddf6f48be9312b0 @@ -768,11 +761,10 @@ SPEC CHECKSUMS: RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634 - SQLCipher: 30a8e81afa6128e600b17ffa77d0f92fa05ed208 SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1 web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 - XMTP: aeeff5ecac80f7ec9a2ba4f732d439ab600545ed - XMTPReactNative: ee19ad5bbcd115abeb6a00041c92942c4243d0e1 + XMTP: 16bd630ff61081d3a325619a26ea176ed256d419 + XMTPReactNative: 4716836807cb33c72bde0846ac46b3fe923a3625 Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9 PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2 diff --git a/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj b/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj index f683a3ce3..311bc6e1e 100644 --- a/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj +++ b/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj @@ -337,13 +337,11 @@ "${PODS_ROOT}/Target Support Files/Pods-xmtpreactnativesdkexample/Pods-xmtpreactnativesdkexample-resources.sh", "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", - "${PODS_CONFIGURATION_BUILD_DIR}/SQLCipher/SQLCipher.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SQLCipher.bundle", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/ios/XMTPReactNative.podspec b/ios/XMTPReactNative.podspec index a0500d628..ea8dbe65d 100644 --- a/ios/XMTPReactNative.podspec +++ b/ios/XMTPReactNative.podspec @@ -25,7 +25,6 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,swift}" s.dependency 'secp256k1.swift' - s.dependency 'SQLCipher' s.dependency "MessagePacker" - s.dependency "XMTP", "= 0.13.6" + s.dependency "XMTP", "= 0.13.7" end From 0cbbba0dfcb850570ab467d8f0a3581e2bf242f3 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 22 Jul 2024 09:35:21 -0600 Subject: [PATCH 2/5] link the xmtpv3 first --- example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj b/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj index 311bc6e1e..64e4bac89 100644 --- a/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj +++ b/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj @@ -419,6 +419,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( + "-l\"xmtpv3\"", "$(inherited)", "-ObjC", "-lc++", @@ -447,6 +448,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( + "-l\"xmtpv3\"", "$(inherited)", "-ObjC", "-lc++", From b4f02be3e857262e816477e73d24a83033903dcd Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 22 Jul 2024 09:48:06 -0600 Subject: [PATCH 3/5] update at the project level --- .../ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj b/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj index 64e4bac89..3388e7aa2 100644 --- a/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj +++ b/example/ios/xmtpreactnativesdkexample.xcodeproj/project.pbxproj @@ -419,7 +419,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( - "-l\"xmtpv3\"", "$(inherited)", "-ObjC", "-lc++", @@ -448,7 +447,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( - "-l\"xmtpv3\"", "$(inherited)", "-ObjC", "-lc++", @@ -517,6 +515,7 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( + "-l\"xmtpv3\"", "$(inherited)", "-Wl", "-ld_classic", @@ -576,6 +575,7 @@ LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ( + "-l\"xmtpv3\"", "$(inherited)", "-Wl", "-ld_classic", From afbb93a1e76e265801efd0d10d5549698e8d9804 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 22 Jul 2024 09:57:29 -0600 Subject: [PATCH 4/5] fix up the test now that streaming works in all cases --- example/src/tests/groupTests.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example/src/tests/groupTests.ts b/example/src/tests/groupTests.ts index 8dd1513b9..756595a3e 100644 --- a/example/src/tests/groupTests.ts +++ b/example/src/tests/groupTests.ts @@ -885,15 +885,15 @@ test('can stream groups', async () => { caroClient.address, ]) await delayToPropogate() - if (groups.length !== 2) { - throw Error('Expected group length 2 but it is: ' + groups.length) + if (groups.length !== 3) { + throw Error('Expected group length 3 but it is: ' + groups.length) } // Sync groups after creation if you created a group const listedGroups = await alixClient.conversations.listGroups() await delayToPropogate() groups.push(listedGroups[listedGroups.length - 1]) - if ((groups.length as number) !== 3) { - throw Error('Expected group length 3 but it is: ' + groups.length) + if ((groups.length as number) !== 4) { + throw Error('Expected group length 4 but it is: ' + groups.length) } cancelStreamGroups() @@ -905,8 +905,8 @@ test('can stream groups', async () => { alixClient.address, ]) await delayToPropogate() - if ((groups.length as number) !== 3) { - throw Error('Unexpected num groups (should be 3): ' + groups.length) + if ((groups.length as number) !== 4) { + throw Error('Unexpected num groups (should be 4): ' + groups.length) } return true From aa412e1a89bd87aa749c2186d24f972aa3cb1bf0 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 22 Jul 2024 10:23:24 -0600 Subject: [PATCH 5/5] update the readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 53977260a..42020f41c 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,10 @@ In the `ios` directory, update your `Podfile` file as follows: - Set this value: `platform :ios, '16.0'`. This is required by XMTP. +If you get the error `The SQLCipher Sqlite extension is not present, but an encryption key is given` + +- At the project configuration level in XCode make sure that xmtpV3 is loaded before all other packages by setting `Other Linker Flags` first item to `-l"xmtpv3"` + ```bash npx pod-install ```