Enum fcm::response::ErrorReason
source · [−]pub enum ErrorReason {
Show 14 variants
MissingRegistration,
InvalidRegistration,
NotRegistered,
InvalidPackageName,
MismatchSenderId,
InvalidParameters,
MessageTooBig,
InvalidDataKey,
InvalidTtl,
Unavailable,
InternalServerError,
DeviceMessageRateExceeded,
TopicsMessageRateExceeded,
InvalidApnsCredential,
}
Expand description
A description of what went wrong with the push notification. Referred from Firebase documentation
Variants
MissingRegistration
Check that the request contains a registration token (in the to
or
registration_ids
field).
InvalidRegistration
Check the format of the registration token you pass to the server. Make sure it matches the registration token the client app receives from registering with Firebase Notifications. Do not truncate or add additional characters.
NotRegistered
An existing registration token may cease to be valid in a number of scenarios, including:
- If the client app unregisters with FCM.
- If the client app is automatically unregistered, which can happen if the user uninstalls the application. For example, on iOS, if the APNS Feedback Service reported the APNS token as invalid.
- If the registration token expires (for example, Google might decide to refresh registration tokens, or the APNS token has expired for iOS devices).
- If the client app is updated but the new version is not configured to receive messages.
For all these cases, remove this registration token from the app server and stop using it to send messages.
InvalidPackageName
Make sure the message was addressed to a registration token whose package name matches the value passed in the request.
MismatchSenderId
A registration token is tied to a certain group of senders. When a client app registers for FCM, it must specify which senders are allowed to send messages. You should use one of those sender IDs when sending messages to the client app. If you switch to a different sender, the existing registration tokens won’t work.
InvalidParameters
Check that the provided parameters have the right name and type.
MessageTooBig
Check that the total size of the payload data included in a message does not exceed FCM limits: 4096 bytes for most messages, or 2048 bytes in the case of messages to topics. This includes both the keys and the values.
InvalidDataKey
Check that the custom payload data does not contain a key (such as
from
, or gcm
, or any value prefixed by google) that is used
internally by FCM. Note that some words (such as collapse_key
) are
also used by FCM but are allowed in the payload, in which case the
payload value will be overridden by the FCM value.
InvalidTtl
Check that the value used in time_to_live
is an integer representing a
duration in seconds between 0 and 2,419,200 (4 weeks).
Unavailable
In internal use only. Check FcmError::ServerError.
InternalServerError
In internal use only. Check FcmError::ServerError.
DeviceMessageRateExceeded
The rate of messages to a particular device is too high. If an iOS app sends messages at a rate exceeding APNs limits, it may receive this error message
Reduce the number of messages sent to this device and use exponential backoff to retry sending.
TopicsMessageRateExceeded
The rate of messages to subscribers to a particular topic is too high. Reduce the number of messages sent for this topic and use exponential backoff to retry sending.
InvalidApnsCredential
A message targeted to an iOS device could not be sent because the required APNs authentication key was not uploaded or has expired. Check the validity of your development and production credentials.
Trait Implementations
sourceimpl Clone for ErrorReason
impl Clone for ErrorReason
sourcefn clone(&self) -> ErrorReason
fn clone(&self) -> ErrorReason
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ErrorReason
impl Debug for ErrorReason
sourceimpl<'de> Deserialize<'de> for ErrorReason
impl<'de> Deserialize<'de> for ErrorReason
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<ErrorReason> for ErrorReason
impl PartialEq<ErrorReason> for ErrorReason
impl Copy for ErrorReason
impl StructuralPartialEq for ErrorReason
Auto Trait Implementations
impl RefUnwindSafe for ErrorReason
impl Send for ErrorReason
impl Sync for ErrorReason
impl Unpin for ErrorReason
impl UnwindSafe for ErrorReason
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more