iOS – Bundle version incorrect when being sent to analytics backend

108 views Asked by At

I'm going to try and explain this in as simple a way as possible, but feel free to comment if I miss anything or forget to mention anything important.

I'm currently developing an iOS app and I'm collecting analytics on the things that the users are doing while using the app. One of the things I keep sending with every "event" is the app's bundle version to a backend. The way I'm obtaining this version number is using the line

NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];

According to my understanding, this obtains the bundle version from Info.plist. When I try NSLoging the variable appVersion, I get the correct version (e.g. 1.2.3).

During testing, I had several users beta testing the app through HockeyApp, and I found that people who are pushing events to the backend through HockeyApp send an incorrect version number. I assumed this was related to Hockey, as if I try to test the app on the simulator or on devices I've pushed the app to through Xcode, I get the correct version number (1.2.3) in the backend.

I've pushed the app onto the app store and it's currently being used by several users, but I keep getting the wrong version number. Sometimes I get 2.1, a lot of times 4.0.

I'm now baffled, and I'm not sure where the problem is at all. Has anyone faced a similar problem in the past?

0

There are 0 answers