Files
Jake Barnby 7687c99480 Add docs
2025-05-18 02:25:38 +12:00

25 lines
668 B
Markdown

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Messaging;
Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
Messaging messaging = new Messaging(client);
messaging.createSubscriber(
"<TOPIC_ID>", // topicId
"<SUBSCRIBER_ID>", // subscriberId
"<TARGET_ID>", // targetId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
Log.d("Appwrite", result.toString());
})
);