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.Recommended threads
- I am currently seeking opportunities as ...
Hey! 👋 I'm a Shopify guy. Been building stores for 8+ years. Still haven't lost my mind. Barely. I make stores that don't suck fast, smooth, and actually built...
- What is the best way to create personali...
So i'm experimenting with the messaging api and I want to create personalized emails not to advanced I just want to say "Dear <Users name>," ... you know stuff ...
- SMTP email templates break html
Hey, Im trying to create a custom template for the team invite email. The issue is the html invite I created (which works in normal emails and fake emails I sen...