From f5ba0ab65342df34e38055321796769890143612 Mon Sep 17 00:00:00 2001 From: Alex Risch Date: Tue, 9 Apr 2024 18:43:53 -0600 Subject: [PATCH 1/2] feat: Consent Caching Updated native libraries to support caching consent --- android/build.gradle | 2 +- .../modules/xmtpreactnativesdk/XMTPModule.kt | 10 ++- example/ios/Podfile.lock | 4 +- .../xmtpreactnativesdkexample.xcscheme | 77 +++++++++++++++++++ ios/XMTPReactNative.podspec | 2 +- 5 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 example/ios/xmtpreactnativesdkexample.xcodeproj/xcshareddata/xcschemes/xmtpreactnativesdkexample.xcscheme diff --git a/android/build.gradle b/android/build.gradle index 52a58578c..d284c7306 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.9.0" + implementation "org.xmtp:android:0.10.0" 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/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt index c5289cea8..cf53ec4a4 100644 --- a/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt +++ b/android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt @@ -703,10 +703,12 @@ class XMTPModule : Module() { } } - AsyncFunction("refreshConsentList") { clientAddress: String -> - val client = clients[clientAddress] ?: throw XMTPException("No client") - val consentList = client.contacts.refreshConsentList() - consentList.entries.map { ConsentWrapper.encode(it.value) } + AsyncFunction("refreshConsentList") Coroutine { clientAddress: String -> + withContext(Dispatchers.IO) { + val client = clients[clientAddress] ?: throw XMTPException("No client") + val consentList = client.contacts.refreshConsentList() + consentList.entries.map { ConsentWrapper.encode(it.value) } + } } AsyncFunction("conversationConsentState") Coroutine { clientAddress: String, conversationTopic: String -> diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ca346c83d..c31b2c78f 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -445,7 +445,7 @@ PODS: - GenericJSON (~> 2.0) - Logging (~> 1.0.0) - secp256k1.swift (~> 0.1) - - XMTP (0.9.6): + - XMTP (0.10.0): - Connect-Swift (= 0.12.0) - GzipSwift - LibXMTP (= 0.4.3-beta4) @@ -454,7 +454,7 @@ PODS: - ExpoModulesCore - MessagePacker - secp256k1.swift - - XMTP (= 0.9.6) + - XMTP (= 0.10.0) - Yoga (1.14.0) DEPENDENCIES: diff --git a/example/ios/xmtpreactnativesdkexample.xcodeproj/xcshareddata/xcschemes/xmtpreactnativesdkexample.xcscheme b/example/ios/xmtpreactnativesdkexample.xcodeproj/xcshareddata/xcschemes/xmtpreactnativesdkexample.xcscheme new file mode 100644 index 000000000..110ffdc9e --- /dev/null +++ b/example/ios/xmtpreactnativesdkexample.xcodeproj/xcshareddata/xcschemes/xmtpreactnativesdkexample.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/XMTPReactNative.podspec b/ios/XMTPReactNative.podspec index 41295693a..de17bebd0 100644 --- a/ios/XMTPReactNative.podspec +++ b/ios/XMTPReactNative.podspec @@ -26,5 +26,5 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,swift}" s.dependency 'secp256k1.swift' s.dependency "MessagePacker" - s.dependency "XMTP", "= 0.9.6" + s.dependency "XMTP", "= 0.10.0" end From 0ff26a5dae4fa563d00700a17c9fa23def1e884f Mon Sep 17 00:00:00 2001 From: Alex Risch Date: Tue, 9 Apr 2024 18:59:01 -0600 Subject: [PATCH 2/2] Example Pod lock update Updated pod lock checksums --- example/ios/Podfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c31b2c78f..5e601ce1c 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -751,10 +751,10 @@ SPEC CHECKSUMS: secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634 SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1 web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 - XMTP: 603eecf511ce63f6390b2468fc78500373c1e786 - XMTPReactNative: 54fa7119379885089f695af928594d5720666ef6 + XMTP: bb638d7ae084814be68d0a549f722d3a4ac2c4e5 + XMTPReactNative: 227a0acd1d58e9c1d8dfaa8d7c5cdc91612f70b8 Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9 PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2 -COCOAPODS: 1.14.2 +COCOAPODS: 1.15.2