Rank 2: Process
When a function is execute from client side with parameters can we listen to those parameters as well in realtime when subscribing?
Votes
0
Replies
23
Participants
Unknown
Messages
24
Rank 2: Process
When a function is execute from client side with parameters can we listen to those parameters as well in realtime when subscribing?
You mean to know which parameters were sent to thet function?
Rank 2: Process
yes
Mmm, That sounds like something good to have, But, as of now function executions events return Execution object
https://appwrite.io/docs/models/execution
It seems like it doesn't contains the sent data.
Rank 2: Process
I read the execute object, I wanted to notify drivers when a client books for a ride
Rank 2: Process
Do you know any approach or I have to save in db for this?
Can you elaborate a bit more?
Rank 2: Process
I was like when a customer books for a ride, I have a function that gets nearby drivers like 5 in a list and we can subscribe to docID for location, then I want to notify the nearest driver, if he accepts or rejects I wanted functions and not saving into db as its too coupled up
Rank 2: Process
Any suggestions?
I'm thinking on something
Rank 2: Process
was like if i had way on getting to know what parameter were sent then in realtime I listen that would solve my issue of not saving in db as it's resource intensive and some hacky way of notifying.
So as of now you can notify a driver?
Rank 2: Process
I can't
Rank 2: Process
Like I want the parameter
Rank 2: Process
I mean listening when function is executed in realtime no issue
So to summarize
This is the right flow?
Rank 2: Process
Yes
Okay,
You can choose one of two approaches.
Use another service to push notification.
One way is to do it with database - very small - as this will give you the best realtime option.
You won't need to create to many rows as of Appwrite special Realtime permission module.
All subscriptions are secured by the permissions system offered by Appwrite, meaning a user will only receive updates to resources they have permission to access.
Using Role.any() on read permissions will allow any client to receive updates.
You can let all the drivers to subscribe to a channel for __bidRides __collection databases.[ID].collections.bidRides.documents,
But in default no-one will have permission to the collection, which means no-one will get notification for a new / updated document.
So when a new ride came to the system you can:
read permission.read permissionThen, when one driver took the ride, then you can just delete the document.
Hope it makes sense.
Rank 2: Process
Thank you
Rank 2: Process
Regarding APN is appwrite supporting at that the moment?
Rank 2: Process
No
Appwrite doesn't have - right now, as Wess and Steven said last week maybe on that topic - right now PN of it self. But I think you should be able to send APN using the Swift SDK.
Rank 2: Process
Thanks alot