Commit 61f1bed0 authored by Mauro E. Bender's avatar Mauro E. Bender

Close #49 - Don't retry when operation has failed

When a sending message operation or a enable/disable push notifications
for channel operation has failed don't let PubNub client automatically
retry since it can produce inconsistencies.
parent 7d16ffeb
......@@ -87,6 +87,8 @@
storeInHistory:YES
withCompletion:^(PNPublishStatus *status)
{
[status cancelAutomaticRetry];
AMLChatMessageStatus resultStatus = [[self class] chatMessageStatusFromPublishStatus:status];
if(resultStatus == AMLChatMessageStatusSent)
......
......@@ -45,6 +45,8 @@
withDevicePushToken:_deviceToken
andCompletion:^(PNAcknowledgmentStatus *status)
{
[status cancelAutomaticRetry];
if(!status.isError)
[conversations setValue:[NSNumber numberWithBool:!status.isError]
forKey:@"isRegisteredForPushNotifications"];
......@@ -71,6 +73,8 @@
withDevicePushToken:_deviceToken
andCompletion:^(PNAcknowledgmentStatus *status)
{
[status cancelAutomaticRetry];
if(!status.isError)
[conversations setValue:[NSNumber numberWithBool:NO]
forKey:@"isRegisteredForPushNotifications"];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment