expo-community / expo-server-sdk-python

Exponent Server SDK
MIT License
146 stars 42 forks source link

Check receipts should receive ticket IDs not PushTicket objects #56

Open howieweiner opened 1 year ago

howieweiner commented 1 year ago

check_receipts and check_receipts_multiple expect to receive (a list of) PushTicket objects. Internally, the code then picks the ticket IDs from these objects to send to the getReceipts endpoint, as this is the only property of the class that is needed.

The docs recommend waiting 15 minutes before checking receipts, so it is unlikely that the PushTicket objects returned from the initial publish/publish_multiple task will reside in memory. In our case, we persist the ticket IDs to a database, and then process them with a scheduled task.

At the moment, we are having to create a list of PushTicket objects from our stored ticket IDs to then pass to the check_receipts method. Also, we cannot easily use the PushTicket class due the other required arguments, so we have implemented our own class purely to pass to this method.

Perhaps the method could receive either a lsit of PushTickets or a list of IDs?