Add SDK version number to source and send it to the server, together with the SDK name

This commit is contained in:
Andreas Linde 2012-03-08 21:21:44 +01:00
parent b9efccfbc6
commit 50e028c9ae
2 changed files with 17 additions and 7 deletions

View File

@ -40,6 +40,9 @@
#define BETA_UPDATE_TIMESTAMP @"timestamp" #define BETA_UPDATE_TIMESTAMP @"timestamp"
#define BETA_UPDATE_APPSIZE @"appsize" #define BETA_UPDATE_APPSIZE @"appsize"
#define SDK_NAME @"HockeySDK"
#define SDK_VERSION @"2.2.4"
@interface BWHockeyManager () @interface BWHockeyManager ()
- (NSString *)getDevicePlatform_; - (NSString *)getDevicePlatform_;
- (id)parseJSONResultString:(NSString *)jsonString; - (id)parseJSONResultString:(NSString *)jsonString;
@ -734,9 +737,11 @@ static NSString *kHockeyErrorDomain = @"HockeyErrorDomain";
- (void)checkForAuthorization { - (void)checkForAuthorization {
NSMutableString *parameter = [NSMutableString stringWithFormat:@"api/2/apps/%@", [self encodedAppIdentifier_]]; NSMutableString *parameter = [NSMutableString stringWithFormat:@"api/2/apps/%@", [self encodedAppIdentifier_]];
[parameter appendFormat:@"?format=json&authorize=yes&app_version=%@&udid=%@", [parameter appendFormat:@"?format=json&authorize=yes&app_version=%@&udid=%@&sdk=%@&sdk_version=%@",
[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] bw_URLEncodedString], [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] bw_URLEncodedString],
([self isAppStoreEnvironment] ? @"appstore" : [[self deviceIdentifier] bw_URLEncodedString]) ([self isAppStoreEnvironment] ? @"appstore" : [[self deviceIdentifier] bw_URLEncodedString]),
SDK_NAME,
SDK_VERSION
]; ];
// build request & send // build request & send

View File

@ -35,6 +35,9 @@
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <inttypes.h> //needed for PRIx64 macro #include <inttypes.h> //needed for PRIx64 macro
#define SDK_NAME @"HockeySDK"
#define SDK_VERSION @"2.2.4"
NSBundle *quincyBundle(void) { NSBundle *quincyBundle(void) {
static NSBundle* bundle = nil; static NSBundle* bundle = nil;
if (!bundle) { if (!bundle) {
@ -606,11 +609,13 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
if (self.appIdentifier) { if (self.appIdentifier) {
request = [NSMutableURLRequest requestWithURL: request = [NSMutableURLRequest requestWithURL:
[NSURL URLWithString:[NSString stringWithFormat:@"%@api/2/apps/%@/crashes", [NSURL URLWithString:[NSString stringWithFormat:@"%@api/2/apps/%@/crashes?sdk=%@&sdk_version=%@",
self.submissionURL, self.submissionURL,
[self.appIdentifier stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] [self.appIdentifier stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
] SDK_NAME,
]]; SDK_VERSION
]
]];
} else { } else {
request = [NSMutableURLRequest requestWithURL:url]; request = [NSMutableURLRequest requestWithURL:url];
} }