Skip to content

Commit 645b319

Browse files
Release 2.0.2-beta2 changes (#275)
1 parent 9a5922f commit 645b319

File tree

62 files changed

+1147
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1147
-158
lines changed

CHANGELOG.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# Optimizely Objective-C SDK Changelog
2-
## 1.5.2
3-
June 15, 2018
4-
5-
### New Features
6-
* Updated SDK targets to Xcode 9.4 recommended settings, pod update'd third party Cocoapods used by the 2 demo apps,
7-
and eliminated Xcode 9.4 Build and Analyze warnings for SDK targets.
8-
9-
## 2.0.2-beta1
10-
May 17, 2018
2+
## 2.0.2-beta2
3+
Jun 25, 2018
114

12-
**This "-beta1" pre-release corrects two significant bugs present in the
5+
**This "-beta2" pre-release corrects two significant bugs present in the
136
previous 2.0.x releases which have been withdrawn. Please note that
147
2.0+ SDKs are incompatible with existing 1.x Mobile Optimizely
158
projects. Before you use 2.0+ and Feature Management, please contact
@@ -85,6 +78,8 @@ with Notification Listeners APIs
8578
- (void)clearNotificationListeners:(OPTLYNotificationType)type;
8679
- (void)clearAllNotificationListeners;
8780
```
81+
* Add environments support to SDK with SDK key initialization. A new sdkKey property has been added to OPTLYManagerBuilder
82+
that is an alternative to the older projectId property.
8883
* Added `@"$opt_bucketing_id"` in the attribute map for overriding bucketing using the user id. This string is
8984
available as OptimizelyBucketId in OPTLYEventBuilder.h .
9085

@@ -100,6 +95,13 @@ unable to be deleted from data store due to syntax error.
10095
* Removed track APIs with revenue as a parameter.
10196
* Deprecated live variable APIs.
10297

98+
## 1.5.2
99+
June 15, 2018
100+
101+
### New Features
102+
* Updated SDK targets to Xcode 9.4 recommended settings, pod update'd third party Cocoapods used by the 2 demo apps,
103+
and eliminated Xcode 9.4 Build and Analyze warnings for SDK targets.
104+
103105
## 1.5.1
104106
April 17, 2018
105107

OptimizelySDKCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OptimizelySDKCore"
3-
s.version = "2.0.2-beta1"
3+
s.version = "2.0.2-beta2"
44
s.summary = "Optimizely server-side testing core framework."
55
s.homepage = "http://developers.optimizely.com/server/reference/index.html?language=objectivec"
66
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }

OptimizelySDKCore/OptimizelySDKCore.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@
21972197
OPTIMIZELY_SDK_VERSION_MAJOR = 2;
21982198
OPTIMIZELY_SDK_VERSION_MINOR = 0;
21992199
OPTIMIZELY_SDK_VERSION_PATCH = 2;
2200-
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta1";
2200+
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta2";
22012201
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME)";
22022202
SDKROOT = iphoneos;
22032203
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -2476,7 +2476,7 @@
24762476
OPTIMIZELY_SDK_VERSION_MAJOR = 2;
24772477
OPTIMIZELY_SDK_VERSION_MINOR = 0;
24782478
OPTIMIZELY_SDK_VERSION_PATCH = 2;
2479-
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta1";
2479+
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta2";
24802480
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME)";
24812481
SDKROOT = iphoneos;
24822482
TARGETED_DEVICE_FAMILY = "1,2";

OptimizelySDKCore/OptimizelySDKCoreTests/OPTLYDecisionServiceTest.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ @interface OPTLYDecisionServiceTest : XCTestCase
9494
@property (nonatomic, strong) OPTLYDecisionService *decisionService;
9595
@property (nonatomic, strong) OPTLYBucketer *bucketer;
9696
@property (nonatomic, strong) NSDictionary *attributes;
97-
@property (nonatomic, strong) OPTLYUserProfile *userProfileWithFirefoxAudience;
97+
@property (nonatomic, strong) NSDictionary *userProfileWithFirefoxAudience;
9898
@end
9999

100100
@interface OPTLYDecisionService()
@@ -244,7 +244,7 @@ - (void)testGetVariationWithInvalidAudienceOverriddenBySetForcedVariation
244244
- (void)testGetVariationNoAudience
245245
{
246246
id decisionServiceMock = OCMPartialMock(self.decisionService);
247-
id userProfileServiceMock = OCMPartialMock(self.config.userProfileService);
247+
id userProfileServiceMock = OCMPartialMock((NSObject *)self.config.userProfileService);
248248

249249
OPTLYExperiment *experiment = [self.config getExperimentForKey:kExperimentWithAudienceKey];
250250

@@ -433,7 +433,7 @@ - (void)testSetForcedVariationCalledOnInvalidUserId
433433
- (void)testSaveVariation
434434
{
435435
id decisionServiceMock = OCMPartialMock(self.decisionService);
436-
id userProfileServiceMock = OCMPartialMock(self.config.userProfileService);
436+
id userProfileServiceMock = OCMPartialMock((NSObject *)self.config.userProfileService);
437437

438438
NSDictionary *variationDict = @{ OPTLYDatafileKeysVariationId : kExperimentWithAudienceVariationId,
439439
OPTLYDatafileKeysVariationKey : kExperimentWithAudienceVariationKey };
@@ -452,9 +452,9 @@ - (void)testSaveVariation
452452
- (void)testSaveMultipleVariations
453453
{
454454
id decisionServiceMock = OCMPartialMock(self.decisionService);
455-
id userProfileServiceMock = OCMPartialMock(self.config.userProfileService);
455+
id userProfileServiceMock = OCMPartialMock((NSObject *)self.config.userProfileService);
456456

457-
OPTLYUserProfile *userProfileMultipleExperimentValues = @{ OPTLYDatafileKeysUserProfileServiceUserId : kUserId,
457+
NSDictionary *userProfileMultipleExperimentValues = @{ OPTLYDatafileKeysUserProfileServiceUserId : kUserId,
458458
OPTLYDatafileKeysUserProfileServiceExperimentBucketMap : @{
459459
kExperimentWithAudienceId : @{ OPTLYDatafileKeysUserProfileServiceVariationId : kExperimentWithAudienceVariationId },
460460
kExperimentNoAudienceId : @{ OPTLYDatafileKeysUserProfileServiceVariationId : kExperimentNoAudienceVariationId } } };

OptimizelySDKCore/OptimizelySDKCoreTests/OPTLYEventBuilderTest.m

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -194,52 +194,60 @@ - (void)testBuildConversionTicketWithoutExperiment
194194
- (void)testBuildConversionTicketWithNoConfig
195195
{
196196
NSDictionary *attributes = @{ kAttributeKeyBrowserType : kAttributeValueFirefox };
197+
#pragma GCC diagnostic push
198+
#pragma GCC diagnostic ignored "-Wnonnull"
197199
NSDictionary *conversionTicket = [self.eventBuilder buildConversionTicket:nil
198200
bucketer:self.bucketer
199201
userId:kUserId
200202
eventName:kEventWithAudienceName
201203
eventTags:nil
202204
attributes:attributes];
203-
205+
#pragma GCC diagnostic pop // "-Wnonnull"
204206
XCTAssertNil(conversionTicket, @"Conversion ticket should be nil.");
205207
}
206208

207209
- (void)testBuildConversionTicketWithNoBucketer
208210
{
209211
NSDictionary *attributes = @{ kAttributeKeyBrowserType : kAttributeValueFirefox };
212+
#pragma GCC diagnostic push
213+
#pragma GCC diagnostic ignored "-Wnonnull"
210214
NSDictionary *conversionTicket = [self.eventBuilder buildConversionTicket:self.config
211215
bucketer:nil
212216
userId:kUserId
213217
eventName:kEventWithAudienceName
214218
eventTags:nil
215219
attributes:attributes];
216-
220+
#pragma GCC diagnostic pop // "-Wnonnull"
217221
XCTAssertNil(conversionTicket, @"Conversion ticket should be nil.");
218222
}
219223

220224
- (void)testBuildConversionTicketWithNoUserID
221225
{
222226
NSDictionary *attributes = @{ kAttributeKeyBrowserType : kAttributeValueFirefox };
227+
#pragma GCC diagnostic push
228+
#pragma GCC diagnostic ignored "-Wnonnull"
223229
NSDictionary *conversionTicket = [self.eventBuilder buildConversionTicket:self.config
224230
bucketer:self.bucketer
225231
userId:nil
226232
eventName:kEventWithAudienceName
227233
eventTags:nil
228234
attributes:attributes];
229-
235+
#pragma GCC diagnostic pop // "-Wnonnull"
230236
XCTAssertNil(conversionTicket, @"Conversion ticket should be nil.");
231237
}
232238

233239
- (void)testBuildConversionTicketWithNoEvent
234240
{
235241
NSDictionary *attributes = @{ kAttributeKeyBrowserType : kAttributeValueFirefox };
242+
#pragma GCC diagnostic push
243+
#pragma GCC diagnostic ignored "-Wnonnull"
236244
NSDictionary *conversionTicket = [self.eventBuilder buildConversionTicket:self.config
237245
bucketer:self.bucketer
238246
userId:kUserId
239247
eventName:nil
240248
eventTags:nil
241249
attributes:attributes];
242-
250+
#pragma GCC diagnostic pop // "-Wnonnull"
243251
XCTAssertNil(conversionTicket, @"Conversion ticket should be nil.");
244252
}
245253

@@ -797,33 +805,33 @@ - (void)testBuildImpressionEventTicketWithNoConfig
797805
userId:kUserId
798806
attributes:attributes
799807
bucketer:self.bucketer];
800-
801-
808+
#pragma GCC diagnostic push
809+
#pragma GCC diagnostic ignored "-Wnonnull"
802810
NSDictionary *impressionEventTicketParams = [self.eventBuilder buildImpressionEventTicket:nil
803811
userId:kUserId
804812
experimentKey:kExperimentWithAudienceKey
805813
variationId:bucketedVariation.variationId
806814
attributes:attributes];
807815

816+
#pragma GCC diagnostic pop // "-Wnonnull"
808817
XCTAssert([impressionEventTicketParams count] == 0, @"parameters should not be created with no config.");
809818
}
810819

811820
- (void)testBuildImpressionEventTicketWithNoExperiment
812821
{
813822
NSDictionary *attributes = @{kAttributeKeyBrowserType : kAttributeValueFirefox};
814-
815823
OPTLYVariation *bucketedVariation = [self.config getVariationForExperiment:kExperimentWithAudienceKey
816824
userId:kUserId
817825
attributes:attributes
818826
bucketer:self.bucketer];
819-
820-
827+
#pragma GCC diagnostic push
828+
#pragma GCC diagnostic ignored "-Wnonnull"
821829
NSDictionary *impressionEventTicketParams = [self.eventBuilder buildImpressionEventTicket:self.config
822830
userId:kUserId
823831
experimentKey:nil
824832
variationId:bucketedVariation.variationId
825833
attributes:attributes];
826-
834+
#pragma GCC diagnostic pop // "-Wnonnull"
827835
XCTAssert([impressionEventTicketParams count] == 0, @"parameters should not be created with no Experiment.");
828836
}
829837

@@ -835,27 +843,28 @@ - (void)testBuildImpressionEventTicketWithNoUserId
835843
userId:kUserId
836844
attributes:attributes
837845
bucketer:self.bucketer];
838-
839-
846+
#pragma GCC diagnostic push
847+
#pragma GCC diagnostic ignored "-Wnonnull"
840848
NSDictionary *impressionEventTicketParams = [self.eventBuilder buildImpressionEventTicket:self.config
841849
userId:nil
842850
experimentKey:kExperimentWithAudienceKey
843851
variationId:bucketedVariation.variationId
844852
attributes:attributes];
845-
853+
#pragma GCC diagnostic pop // "-Wnonnull"
846854
XCTAssert([impressionEventTicketParams count] == 0, @"parameters should not be created with no UserId.");
847855
}
848856

849857
- (void)testBuildImpressionEventTicketWithNoVariation
850858
{
851859
NSDictionary *attributes = @{kAttributeKeyBrowserType : kAttributeValueFirefox};
852-
860+
#pragma GCC diagnostic push
861+
#pragma GCC diagnostic ignored "-Wnonnull"
853862
NSDictionary *impressionEventTicketParams = [self.eventBuilder buildImpressionEventTicket:self.config
854863
userId:kUserId
855864
experimentKey:kExperimentWithAudienceKey
856865
variationId:nil
857866
attributes:attributes];
858-
867+
#pragma GCC diagnostic pop // "-Wnonnull"
859868
XCTAssert([impressionEventTicketParams count] == 0, @"parameters should not be created with no Variation.");
860869
}
861870

OptimizelySDKCore/OptimizelySDKCoreTests/OPTLYProjectConfigTest.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,12 @@ - (void)testClientEngineAndClientVersionAreConfigurable {
119119

120120
- (void)testInitWithBuilderBlockNoDatafile
121121
{
122+
#pragma GCC diagnostic push
123+
#pragma GCC diagnostic ignored "-Wnonnull"
122124
OPTLYProjectConfig *projectConfig = [OPTLYProjectConfig init:^(OPTLYProjectConfigBuilder * _Nullable builder){
123125
builder.datafile = nil;
124126
}];
125-
127+
#pragma GCC diagnostic pop // "-Wnonnull"
126128
XCTAssertNil(projectConfig, @"project config should be nil.");
127129
}
128130

OptimizelySDKCore/OptimizelySDKCoreTests/OptimizelyV3Test.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ @interface OptimizelyV3Test : XCTestCase
120120
@end
121121

122122
@implementation OptimizelyV3Test
123+
// LIVE VARIABLES ARE (DEPRECATED)
124+
#pragma GCC diagnostic push
125+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
126+
#pragma GCC diagnostic ignored "-Wdeprecated-implementations"
123127

124128
- (void)setUp {
125129
[super setUp];
@@ -447,4 +451,6 @@ - (void)stubFailureResponseForEventRequest {
447451
}];
448452
}
449453

454+
#pragma GCC diagnostic pop // "-Wdeprecated-declarations" "-Wdeprecated-implementations"
455+
// END OF LIVE VARIABLES ARE (DEPRECATED)
450456
@end

OptimizelySDKDatafileManager.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OptimizelySDKDatafileManager"
3-
s.version = "2.0.2-beta1"
3+
s.version = "2.0.2-beta2"
44
s.summary = "Optimizely server-side testing datafile manager framework."
55
s.homepage = "http://developers.optimizely.com/server/reference/index.html?language=objectivec"
66
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
1616
s.framework = "Foundation"
1717
s.requires_arc = true
1818
s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => "OPTIMIZELY_SDK_VERSION=@\\\"#{s.version}\\\"" }
19-
s.dependency 'OptimizelySDKShared', '2.0.2-beta1'
19+
s.dependency 'OptimizelySDKShared', '2.0.2-beta2'
2020
end

OptimizelySDKDatafileManager/OptimizelySDKDatafileManager.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@
804804
OPTIMIZELY_SDK_VERSION_MAJOR = 2;
805805
OPTIMIZELY_SDK_VERSION_MINOR = 0;
806806
OPTIMIZELY_SDK_VERSION_PATCH = 2;
807-
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta1";
807+
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta2";
808808
SDKROOT = iphoneos;
809809
TARGETED_DEVICE_FAMILY = "1,2";
810810
VALIDATE_PRODUCT = YES;
@@ -874,7 +874,7 @@
874874
OPTIMIZELY_SDK_VERSION_MAJOR = 2;
875875
OPTIMIZELY_SDK_VERSION_MINOR = 0;
876876
OPTIMIZELY_SDK_VERSION_PATCH = 2;
877-
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta1";
877+
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta2";
878878
SDKROOT = iphoneos;
879879
TARGETED_DEVICE_FAMILY = "1,2";
880880
VERSIONING_SYSTEM = "apple-generic";

OptimizelySDKDatafileManager/OptimizelySDKDatafileManagerTests/OPTLYDatafileManagerTest.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ @interface OPTLYDatafileManagerDefault(test)
3333
@property (nonatomic, strong) NSTimer *datafileDownloadTimer;
3434
- (void)saveDatafile:(NSData *)datafile;
3535
- (nullable NSString *)getLastModifiedDate:(nonnull NSString *)projectId;
36-
- (void)downloadDatafile:(NSString *)projectId completionHandler:(OPTLYHTTPRequestManagerResponse)completion;
36+
- (void)downloadDatafile:(OPTLYDatafileConfig *)datafileConfig completionHandler:(OPTLYHTTPRequestManagerResponse)completion;
3737
@end
3838

3939
@interface OPTLYDatafileManagerTest : XCTestCase
@@ -279,7 +279,7 @@ - (void)test304Response
279279
return [request.URL.host isEqualToString:hostName];
280280
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
281281
if ([request.allHTTPHeaderFields objectForKey:@"If-Modified-Since"] != nil) {
282-
return [OHHTTPStubsResponse responseWithData:nil
282+
return [OHHTTPStubsResponse responseWithData:[NSData data]
283283
statusCode:304
284284
headers:kCDNResponseHeaders];
285285
}
@@ -300,7 +300,7 @@ - (void)test304Response
300300
return [OHHTTPStubs stubRequestsPassingTest:^BOOL (NSURLRequest *request) {
301301
return [request.URL.host isEqualToString:hostName];
302302
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) {
303-
return [OHHTTPStubsResponse responseWithData:nil
303+
return [OHHTTPStubsResponse responseWithData:[NSData data]
304304
statusCode:400
305305
headers:kCDNResponseHeaders];
306306
}];

OptimizelySDKEventDispatcher.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OptimizelySDKEventDispatcher"
3-
s.version = "2.0.2-beta1"
3+
s.version = "2.0.2-beta2"
44
s.summary = "Optimizely server-side testing event dispatcher framework."
55
s.homepage = "http://developers.optimizely.com/server/reference/index.html?language=objectivec"
66
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
1616
s.framework = "Foundation"
1717
s.requires_arc = true
1818
s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => "OPTIMIZELY_SDK_VERSION=@\\\"#{s.version}\\\"" }
19-
s.dependency 'OptimizelySDKShared', '2.0.2-beta1'
19+
s.dependency 'OptimizelySDKShared', '2.0.2-beta2'
2020
end

OptimizelySDKEventDispatcher/OptimizelySDKEventDispatcher.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@
680680
OPTIMIZELY_SDK_VERSION_MAJOR = 2;
681681
OPTIMIZELY_SDK_VERSION_MINOR = 0;
682682
OPTIMIZELY_SDK_VERSION_PATCH = 2;
683-
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta1";
683+
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta2";
684684
SDKROOT = iphoneos;
685685
TARGETED_DEVICE_FAMILY = "1,2";
686686
VALIDATE_PRODUCT = YES;
@@ -752,7 +752,7 @@
752752
OPTIMIZELY_SDK_VERSION_MAJOR = 2;
753753
OPTIMIZELY_SDK_VERSION_MINOR = 0;
754754
OPTIMIZELY_SDK_VERSION_PATCH = 2;
755-
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta1";
755+
OPTIMIZELY_SDK_VERSION_SUFFIX = "-beta2";
756756
SDKROOT = iphoneos;
757757
TARGETED_DEVICE_FAMILY = "1,2";
758758
VERSIONING_SYSTEM = "apple-generic";

OptimizelySDKShared.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OptimizelySDKShared"
3-
s.version = "2.0.2-beta1"
3+
s.version = "2.0.2-beta2"
44
s.summary = "Optimizely server-side testing shared framework."
55
s.homepage = "http://developers.optimizely.com/server/reference/index.html?language=objectivec"
66
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
1818
s.ios.library = "sqlite3"
1919
s.requires_arc = true
2020
s.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => "OPTIMIZELY_SDK_VERSION=@\\\"#{s.version}\\\"" }
21-
s.dependency 'OptimizelySDKCore', '2.0.2-beta1'
21+
s.dependency 'OptimizelySDKCore', '2.0.2-beta2'
2222
end

0 commit comments

Comments
 (0)