Skip to content

Commit

Permalink
fixup! fixup! fixup! OSMessagingController Retry Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Gomez Palacio committed Oct 15, 2024
1 parent 60c4c79 commit 10e877b
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ - (void)getInAppMessagesFromServer:(NSString *)subscriptionId {


- (void)attemptFetchWithRetries:(NSString *)subscriptionId
rywToken:(NSString *)rywToken
rywToken:(NSString *)rywToken
attempts:(NSNumber *)attempts
retryLimit:(NSNumber *)retryLimit {
NSNumber *sessionDuration = @([OSSessionManager.sharedSessionManager getTimeFocusedElapsed]);
Expand Down Expand Up @@ -350,17 +350,17 @@ - (void)attemptFetchWithRetries:(NSString *)subscriptionId
}

- (void)retryAfterDelay:(NSInteger)retryAfter
subscriptionId:(NSString *)subscriptionId
rywToken:(NSString *)rywToken
subscriptionId:(NSString *)subscriptionId
rywToken:(NSString *)rywToken
attempts:(NSNumber *)attempts
retryLimit:(NSNumber *)retryLimit {

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(retryAfter * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

[self attemptFetchWithRetries:subscriptionId
rywToken:rywToken
attempts:attempts
retryLimit:retryLimit];
rywToken:rywToken
attempts:attempts
retryLimit:retryLimit];
});
}

Expand Down Expand Up @@ -397,7 +397,6 @@ - (void)fetchInAppMessagesWithoutToken:(NSString *)subscriptionId {
}];
}


- (void)updateInAppMessagesFromServer:(NSArray<OSInAppMessageInternal *> *)newMessages {
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:@"updateInAppMessagesFromServer"];
self.messages = newMessages;
Expand Down

0 comments on commit 10e877b

Please sign in to comment.