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
- HUGE OUTRAGE IN APPWRITE, I CANNOT ACCES...
I have 2k users trying to access, sending me messages. What am I supposed to do? Please solve this asap.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast
- My projects were deleted
Hello everyone, My projects were for some reason deleted. I got an email informing me about project inactivity, when I clicked to activate it again, it was sil...