Skip to content

Commit

Permalink
get android compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jan 8, 2025
1 parent a6511cf commit 2652077
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package expo.modules.xmtpreactnativesdk.wrappers

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.InboxState
import org.xmtp.android.library.libxmtp.InboxState

class InboxStateWrapper {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package expo.modules.xmtpreactnativesdk.wrappers

import com.google.gson.GsonBuilder
import com.google.gson.JsonParser
import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.PermissionOption
import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.PermissionPolicySet
import org.xmtp.android.library.libxmtp.PermissionOption
import org.xmtp.android.library.libxmtp.PermissionPolicySet

class PermissionPolicySetWrapper {

Expand Down
23 changes: 13 additions & 10 deletions example/src/tests/conversationTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { content } from '@xmtp/proto'
import { Wallet } from 'ethers'
import ReactNativeBlobUtil from 'react-native-blob-util'
import RNFS from 'react-native-fs'
import { PreferenceUpdates } from 'xmtp-react-native-sdk/lib/PrivatePreferences'

import { Test, assert, createClients, delayToPropogate } from './test-utils'
import {
Expand All @@ -12,7 +13,6 @@ import {
ConversationVersion,
JSContentCodec,
} from '../../../src/index'
import { PreferenceUpdates } from 'xmtp-react-native-sdk/lib/PrivatePreferences'

export const conversationTests: Test[] = []
let counter = 1
Expand Down Expand Up @@ -476,8 +476,8 @@ test('can list conversations with params', async () => {
`List length should be 1 but was ${boGroupsLimit.length}`
)
assert(
boGroupsLimit[0].id === boGroup1.id,
`Group should be ${boGroup1.id} but was ${boGroupsLimit[0].id}`
boGroupsLimit[0].id === boGroup2.id,
`Group should be ${boGroup2.id} but was ${boGroupsLimit[0].id}`
)

return true
Expand Down Expand Up @@ -509,10 +509,10 @@ test('can list groups', async () => {
)

if (
boConversations[0].topic !== boGroup.topic ||
boConversations[0].version !== ConversationVersion.GROUP ||
boConversations[2].version !== ConversationVersion.DM ||
boConversations[2].createdAt !== boDm.createdAt
boConversations[2].topic !== boGroup.topic ||
boConversations[2].version !== ConversationVersion.GROUP ||
boConversations[0].version !== ConversationVersion.DM ||
boConversations[0].createdAt !== boDm.createdAt
) {
throw Error('Listed containers should match streamed containers')
}
Expand Down Expand Up @@ -981,8 +981,9 @@ test('can preference updates', async () => {
})

const types = []
await alix.preferences.streamPreferenceUpdates(async (entry: PreferenceUpdates) => {
types.push(entry)
await alix.preferences.streamPreferenceUpdates(
async (entry: PreferenceUpdates) => {
types.push(entry)
})

Check warning on line 987 in example/src/tests/conversationTests.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `}` with `··}⏎··`

const alix2 = await Client.create(alixWallet, {
Expand All @@ -992,8 +993,10 @@ test('can preference updates', async () => {
dbDirectory: dbDirPath2,
})

await alix.conversations.syncAllConversations()
await alix2.conversations.syncAllConversations()
await delayToPropogate(2000)
await alix.conversations.syncAllConversations()
await delayToPropogate(2000)

assert(
types.length === 1,
Expand Down
8 changes: 3 additions & 5 deletions ios/XMTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ public class XMTPModule: Module {
AsyncFunction("listGroups") {
(
installationId: String, groupParams: String?,
sortOrder: String?,
limit: Int?, consentState: String?
) -> [String] in
guard
Expand Down Expand Up @@ -518,7 +517,6 @@ public class XMTPModule: Module {
AsyncFunction("listDms") {
(
installationId: String, groupParams: String?,
sortOrder: String?,
limit: Int?, consentState: String?
) -> [String] in
guard
Expand Down Expand Up @@ -550,7 +548,7 @@ public class XMTPModule: Module {
AsyncFunction("listConversations") {
(
installationId: String, conversationParams: String?,
sortOrder: String?, limit: Int?, consentState: String?
limit: Int?, consentState: String?
) -> [String] in
guard
let client = await clientsManager.getClient(key: installationId)
Expand Down Expand Up @@ -586,7 +584,7 @@ public class XMTPModule: Module {
else {
throw Error.noClient
}
let hmacKeys = await client.conversations.getHmacKeys()
let hmacKeys = try await client.conversations.getHmacKeys()

return try [UInt8](hmacKeys.serializedData())
}
Expand Down Expand Up @@ -1778,7 +1776,7 @@ public class XMTPModule: Module {
else {
throw Error.noClient
}
let hmacKeysResult = await client.conversations.getHmacKeys()
let hmacKeysResult = try await client.conversations.getHmacKeys()
let subscriptions = topics.map {
topic -> NotificationSubscription in
let hmacKeys = hmacKeysResult.hmacKeys
Expand Down

0 comments on commit 2652077

Please sign in to comment.