Handling Errors
Robust error handling is critical for push notifications. jxpush returns unified error structures regardless of the underlying provider.
Single Send Result
The send() method returns a SendResult object.
typescript
Common Errors
- Invalid Token: The device token is malformed or expired. You should remove this token from your database.
- Quota Exceeded: You have sent too many messages quickly. Configure use the
rateLimitoption to prevent this. - Authentication Error: FCM service account or Expo access token is invalid.
Retry Logic
By default, jxpush will automatically retry transient errors (like network timeouts or 503 responses) with exponential backoff.
typescript