Skip to content

Commit

Permalink
feat: Consent Caching
Browse files Browse the repository at this point in the history
Updated native libraries to support caching consent
  • Loading branch information
Alex Risch authored and Alex Risch committed Apr 10, 2024
1 parent e9f5d43 commit f5ba0ab
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 8 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -454,7 +454,7 @@ PODS:
- ExpoModulesCore
- MessagePacker
- secp256k1.swift
- XMTP (= 0.9.6)
- XMTP (= 0.10.0)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "xmtpreactnativesdkexample.app"
BlueprintName = "xmtpreactnativesdkexample"
ReferencedContainer = "container:xmtpreactnativesdkexample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "xmtpreactnativesdkexample.app"
BlueprintName = "xmtpreactnativesdkexample"
ReferencedContainer = "container:xmtpreactnativesdkexample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "xmtpreactnativesdkexample.app"
BlueprintName = "xmtpreactnativesdkexample"
ReferencedContainer = "container:xmtpreactnativesdkexample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion ios/XMTPReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f5ba0ab

Please sign in to comment.