Skip to content

Commit

Permalink
Don't read library version from bundle.
Browse files Browse the repository at this point in the history
It's not available when the library is used from another bundle.

Fixes #530.
  • Loading branch information
tcard committed Nov 13, 2016
1 parent d13e645 commit 4a58f65
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Source/ARTDefault.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ @implementation ARTDefault
NSString *const ARTDefault_restHost = @"rest.ably.io";
NSString *const ARTDefault_realtimeHost = @"realtime.ably.io";
NSString *const ARTDefault_version = @"0.8";
NSString *const ARTDefault_ablyBundleId = @"io.ably.Ably";
NSString *const ARTDefault_bundleVersionKey = @"CFBundleShortVersionString";
NSString *const ARTDefault_libraryVersion = @"0.8.7";
NSString *const ARTDefault_platform = @"ios-";

static int _realtimeRequestTimeout = 10.0;
Expand Down Expand Up @@ -69,10 +68,7 @@ + (void)setConnectionStateTtl:(NSTimeInterval)value {
}

+ (NSString *)libraryVersion {
NSBundle *ablyBundle = [NSBundle bundleWithIdentifier:ARTDefault_ablyBundleId];
NSDictionary *infoDictionary = [ablyBundle infoDictionary];
NSString *versionString = infoDictionary[ARTDefault_bundleVersionKey];
return [NSString stringWithFormat:@"%@%@", ARTDefault_platform, versionString];
return [NSString stringWithFormat:@"%@%@", ARTDefault_platform, ARTDefault_libraryVersion];
}

@end

0 comments on commit 4a58f65

Please sign in to comment.