Open fx1234 opened 1 year ago
any ideas?
I'm unsure I understand the underlying problem here. If you are able to access your own variables when calling flush
, why can't you use them inside the for
loop?
I know this is old, but the issue is not closed so apparently still an issue
I think it was about connecting our internal user IDs directly with the push notifications without having to get this information from the database within the loop for each notification.
With a large number of outgoing notifications, this would mean a lot of extra database queries inside the loop
I don't have direct access to the code right now and because it was a while ago, I'm not 100% sure whether the problem was more extensive. But basically it was about making our own information available for each notification inside the loop
Okay, I think I get what you mean because I'm encountering the same issue. I end up using the endpoint to find the user 😁
If you send a large number (thousands) of notifications at the same time, it is a big overhead if you have to get the data from the database for each user. It would therefore be better if you had a way to have the required data available directly in $report
We are using the following simple code to flush the Queue:
foreach( $webPush->flush() as $report ){ .... }
The problem is, we need our own variables (the UserID) inside the loop. Is there a way to pass custom variables into the loop? Maybe so that it is available in $report