Skip to content

Commit

Permalink
fix: typo in deregistration error check condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ttypic committed Apr 4, 2024
1 parent 5c0977a commit aee22d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/ARTPushActivationStateMachine.m
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ - (void)deviceUnregistration:(ARTErrorInfo *)error {
[delegate ablyPushCustomDeregister:error deviceId:local.id callback:^(ARTErrorInfo *error) {
if (error) {
// RSH3d2c1: ignore unauthorized or invalid credentials errors
if (error.code == 401 || error.code == 40005) {
if (error.statusCode == 401 || error.code == 40005) {
[self sendEvent:[ARTPushActivationEventDeregistered new]];
} else {
[self sendEvent:[ARTPushActivationEventDeregistrationFailed newWithError:error]];
Expand All @@ -359,7 +359,7 @@ - (void)deviceUnregistration:(ARTErrorInfo *)error {
[_rest executeRequest:request withAuthOption:ARTAuthenticationOn completion:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
if (error) {
// RSH3d2c1: ignore unauthorized or invalid credentials errors
if (error.code == 401 || error.code == 40005) {
if (response.statusCode == 401 || error.code == 40005) {
ARTLogError(self->_logger, @"%@: unauthorized error during deregistration (%@)", NSStringFromClass(self.class), error.localizedDescription);
[self sendEvent:[ARTPushActivationEventDeregistered new]];
} else {
Expand Down

0 comments on commit aee22d7

Please sign in to comment.