Skip to content

Commit 4feb8cf

Browse files
authored
Merge pull request #542 from BranchMetrics/SDK-854-iOS-share-sheet-crash-on-cancel
SDK-854 only call back on successful completion. ignore cancel
2 parents 6388bdd + a20b0f5 commit 4feb8cf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ios/RNBranch.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,12 @@ - (BranchUniversalObject *)findUniversalObjectWithIdent:(NSString *)ident reject
498498
@"completed" : @(completed),
499499
@"error" : [NSNull null]
500500
};
501-
502-
resolve(result);
501+
502+
// SDK-854 do not callback more than once.
503+
// The native iOS code calls back with status even if the user just cancelled.
504+
if (completed) {
505+
resolve(result);
506+
}
503507
}];
504508
});
505509
}

0 commit comments

Comments
 (0)