glyphard / expo-server-sdk-dotnet

Server-side library for working with Expo using .Net
MIT License
38 stars 23 forks source link

Way to find HTTP error codes? #14

Open ghost opened 2 years ago

ghost commented 2 years ago

Hi,

We want to basically catch HTTP error codes - 429 and 5XX errors in case the Expo Push Notification service is down so that we can implement retry on failure as suggested by Expo here - https://docs.expo.dev/push-notifications/sending-notifications/#retry-on-failure using Exponential Backoff.

Currently this code -

if (response.IsSuccessStatusCode) { var rawResponseBody = await response.Content.ReadAsStringAsync(); responseBody = JsonConvert.DeserializeObject<U>(rawResponseBody); }

is catching all the push notifications that are hitting the Expo's push notification service without any HTTP status code which makes it even more difficult.

Could we perhaps find a way to address this?