Hi. I'm creating my android app and trying to receive Firebase Message from my Appwrite Cloud Function. When I send message from Console (not using the code), i can receive payload. But when i send it using Python Server SDK, i receive empty payload. Is this error? This is part of my code (I don't receiving any errors) ``` newMessageData = {} newMessageData['chatCollectionId'] = new_collection_id newMessageData['userName1'] = user_1_name newMessageData['userName2'] = user_2_name newMessageData['userId1'] = chatId1 newMessageData['userId2'] = chatId2 #newMessageData['userPhoto1'] = user_1_photo #newMessageData['userPhoto2'] = user_2_photo
result = messaging.create_push(
message_id = ID.unique(),
title = 'New Meetsee Match!',
body = 'Your new match is here!',
topics = [],
users = [document_1_userId, document_2_userId], # optional
targets = [], # optional
data = newMessageData
)```
So the title and body are okay? But the data isn't passing through?
Yes
Can you try logging new message data before calling create and also log the result?
Ok
{'chatCollectionId': '663f1088000486bfaf0e', 'userName1': 'Monica', 'userName2': 'Ryan', 'userId1': '66094e5a0c05c6251136', 'userId2': '662d14a5003243c80cb0'} I tried again with print(str(newMessageData)) and finally received payload. I'll try adding some new values in newMessageData and respond later, if there's any errors again
It's finally working! Thank you! I think error was around newMessageData object (maybe his existance).
Recommended threads
- The current user is not authorized to pe...
I want to create a document associated with user after log in with OAuth. The user were logged in, but Appwrite said user is unauthorized. User is logged in wi...
- My account is blocked so please check an...
My account is blocked so please unblock my account because all the apps are closed due to which it is causing a lot of problems
- Applying free credits on Github Student ...
So this post is kind of related to my old post where i was charged 15usd by mistake. This happens when you are trying to apply free credits you got from somewh...