diff --git a/Sources/BranchSDK/BNCServerRequestQueue.m b/Sources/BranchSDK/BNCServerRequestQueue.m index 23a5775d2..2fefbc419 100755 --- a/Sources/BranchSDK/BNCServerRequestQueue.m +++ b/Sources/BranchSDK/BNCServerRequestQueue.m @@ -42,6 +42,7 @@ - (instancetype)init { self.queue = [NSMutableArray new]; self.asyncQueue = dispatch_queue_create("io.branch.persist_queue", DISPATCH_QUEUE_SERIAL); + self.processArchivedOpens = YES; return self; } diff --git a/Sources/BranchSDK/Branch.m b/Sources/BranchSDK/Branch.m index 194e03f60..7619d0186 100644 --- a/Sources/BranchSDK/Branch.m +++ b/Sources/BranchSDK/Branch.m @@ -1885,6 +1885,15 @@ - (void)processNextQueueItem { return; } } + + if ( !(((BNCServerRequestQueue*)[BNCServerRequestQueue getInstance]).processArchivedOpens) + && [req isKindOfClass:[BranchOpenRequest class]] + && ((BranchOpenRequest *)req).isFromArchivedQueue){ + [self.requestQueue remove:req]; + self.networkCount = 0; + [self processNextQueueItem]; + return; + } dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(queue, ^ { diff --git a/Sources/BranchSDK/BranchOpenRequest.m b/Sources/BranchSDK/BranchOpenRequest.m index 37aae9a2d..d817d9a07 100644 --- a/Sources/BranchSDK/BranchOpenRequest.m +++ b/Sources/BranchSDK/BranchOpenRequest.m @@ -152,6 +152,10 @@ - (void)processResponse:(BNCServerResponse *)response error:(NSError *)error { } } } + + if (referringURL.length > 0) { + ((BNCServerRequestQueue *)[BNCServerRequestQueue getInstance]).processArchivedOpens = NO; + } // Clear link identifiers so they don't get reused on the next open preferenceHelper.linkClickIdentifier = nil; diff --git a/Sources/BranchSDK/Public/BNCServerRequestQueue.h b/Sources/BranchSDK/Public/BNCServerRequestQueue.h index 535034112..311c65a76 100755 --- a/Sources/BranchSDK/Public/BNCServerRequestQueue.h +++ b/Sources/BranchSDK/Public/BNCServerRequestQueue.h @@ -11,6 +11,8 @@ @interface BNCServerRequestQueue : NSObject +@property (assign, nonatomic) BOOL processArchivedOpens; + - (void)enqueue:(BNCServerRequest *)request; - (BNCServerRequest *)dequeue; - (BNCServerRequest *)peek;