You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting with this gem in an application where I batch multiple push notifications that are sent to different users.
For logging reasons I want to store each push notification and associate them to each user, in order to get visibility on how many push notifications someone receive, their status.
data will contain an array of push tickets in the same order in which the messages were sent
So the idea is to create a PushNotification record matching the user with the position in the returned data.
The problem is that at the moment this doesn't seem possible since there is a tickets.each that only returns ok tickets (filtering out errors) and tickets.each_error that only returns error tickets (filtering out oks).
Given that the position of each ticket is important in order to match the user those two methods cannot be used together for this purpose.
Would you consider adding a new method that'd allow to loop through all ok/error tickets together in the original order that got returned by Expo?
That'd allow to loop through all of them; and in order to prevent that one batch/chunk error out would mess up the position, the whole chunking could be taken care of before sending the messages, which I think would be fine.
The text was updated successfully, but these errors were encountered:
That'd allow to loop through all of them
Unless there is a "top-level" error, which makes it less than ideal.
Would a reference back to the receipt and the receipt back to the notification work? Seems like that is what you ultimately want? I also don't mind adding explicit iterators that iterate through everything. Feel free to PR that (and each_receipt + the doc changes).
I'm experimenting with this gem in an application where I batch multiple push notifications that are sent to different users.
For logging reasons I want to store each push notification and associate them to each user, in order to get visibility on how many push notifications someone receive, their status.
From the Expo documentation:
So the idea is to create a
PushNotification
record matching the user with the position in the returned data.The problem is that at the moment this doesn't seem possible since there is a
tickets.each
that only returnsok
tickets (filtering out errors) andtickets.each_error
that only returnserror
tickets (filtering out oks).Given that the position of each ticket is important in order to match the user those two methods cannot be used together for this purpose.
Would you consider adding a new method that'd allow to loop through all ok/error tickets together in the original order that got returned by Expo?
Something like:
That'd allow to loop through all of them; and in order to prevent that one batch/chunk error out would mess up the position, the whole chunking could be taken care of before sending the messages, which I think would be fine.
The text was updated successfully, but these errors were encountered: