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
- I recently switched to TablesDb. When li...
olddb.list_documents( queries =[ Query.order_desc("timestamp"), Query.equal("isPosted",[False]) ] ) Above works fine and reruns documents But below don't return...
- Database error validating 'min' and 'max...
I keep seeing an error when I try to add a column to a database table within the AppWrite cloud UI. I also see this error when trying to create or update a reco...
- Synchronous Function Execution Timed Out...
Hi Appwrite team 👋 I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance. I executed this function u...