Skip to content
Back

The target could not be found.

  • 0
  • Messaging
  • Apple
Eric
18 Mar, 2025, 01:08

I'm attempting to subscribe to a topic from the client as an anon user. the app does not require a login. Not sure where im coming up short here the targetId is my providerId i got straight from the appwrite console.

TypeScript
        do {
            print("Creating anonymous session...")
            let session = try await account.createAnonymousSession()
            print("session creation: \(session.userId)")
            let subId = UUID().uuidString
            let subscriber = try await messaging.createSubscriber(
                topicId: "67d8c32a032423423434",
                subscriberId: subId,
                targetId: "provideId")
            print("Successfully subscribed")
        } catch {
            print("Error in SubscribeAnon: \(error)")
        }
    }
TL;DR
Issue: Developer is attempting to subscribe to a topic as an anonymous user but encountering the error "The target could not be found." Solution: The issue is with the `targetId` parameter in the `createSubscriber` call, which should be corrected to the actual `providerId` obtained from the Appwrite console.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more