Skip to content

Commit 2da77db

Browse files
authored
Fix update / install tracking when app installed but not run for a while. (#763)
1 parent 964d0f9 commit 2da77db

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Branch-SDK/Branch-SDK/BNCSystemObserver.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,17 @@ + (BNCUpdateState) updateStateWithBuildDate:(NSDate*)buildDate
214214
storedAppVersion:(NSString*)storedAppVersion
215215
currentAppVersion:(NSString*)currentAppVersion {
216216

217+
if ([UIDevice currentDevice].systemVersion.floatValue > 10.3 &&
218+
storedAppVersion.length <= 0) {
219+
// iOS version greater than 10.2 and 10.3 since there were update problems there.
220+
//
221+
// Doesn't count re-installs or some enterprise distribution schemes.
222+
// This solves the case where a user installs the app, doesn't run it,
223+
// updates the app, then runs the app. These were being counted as updates
224+
// rather than installs.
225+
return BNCUpdateStateInstall;
226+
}
227+
217228
if (storedAppVersion) {
218229
if (currentAppVersion && [storedAppVersion isEqualToString:currentAppVersion])
219230
return BNCUpdateStateNonUpdate;

0 commit comments

Comments
 (0)