Skip to content

Commit bdb187e

Browse files
New event endpoint (#202)
* New event endpoint * Payload change * Event Builder Test Cases modified and added for new payload * Test cases modified for uuid * Added assertion failure messages * removed session Id and restrict event tags to its allowed data types * removed unused OPTLYEventParameterKeys * refactored OPTLYEventParameterKeys.m+.h and removed all unreferenced keys * removed unused string literals and OPTLYEventTicket
1 parent d7ac79c commit bdb187e

File tree

14 files changed

+769
-903
lines changed

14 files changed

+769
-903
lines changed

OptimizelySDKCore/OptimizelySDKCore.xcodeproj/project.pbxproj

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@
231231
EA2FAAE91DC6F57200B1D81B /* OPTLYEventParameterKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA721DC6F57100B1D81B /* OPTLYEventParameterKeys.h */; settings = {ATTRIBUTES = (Public, ); }; };
232232
EA2FAAEE1DC6F57200B1D81B /* OPTLYEventRelatedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA741DC6F57100B1D81B /* OPTLYEventRelatedEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
233233
EA2FAAEF1DC6F57200B1D81B /* OPTLYEventRelatedEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA741DC6F57100B1D81B /* OPTLYEventRelatedEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
234-
EA2FAAF41DC6F57200B1D81B /* OPTLYEventTicket.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA761DC6F57100B1D81B /* OPTLYEventTicket.h */; settings = {ATTRIBUTES = (Public, ); }; };
235-
EA2FAAF51DC6F57200B1D81B /* OPTLYEventTicket.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA761DC6F57100B1D81B /* OPTLYEventTicket.h */; settings = {ATTRIBUTES = (Public, ); }; };
236234
EA2FAAFA1DC6F57200B1D81B /* OPTLYEventView.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA781DC6F57100B1D81B /* OPTLYEventView.h */; settings = {ATTRIBUTES = (Public, ); }; };
237235
EA2FAAFB1DC6F57200B1D81B /* OPTLYEventView.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA781DC6F57100B1D81B /* OPTLYEventView.h */; settings = {ATTRIBUTES = (Public, ); }; };
238236
EA2FAB001DC6F57200B1D81B /* OPTLYExperiment.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2FAA7A1DC6F57100B1D81B /* OPTLYExperiment.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -320,7 +318,6 @@
320318
EA2FABF21DC6FFA100B1D81B /* OPTLYEventMetric.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA711DC6F57100B1D81B /* OPTLYEventMetric.m */; };
321319
EA2FABF31DC6FFA100B1D81B /* OPTLYEventParameterKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA731DC6F57100B1D81B /* OPTLYEventParameterKeys.m */; };
322320
EA2FABF41DC6FFA100B1D81B /* OPTLYEventRelatedEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA751DC6F57100B1D81B /* OPTLYEventRelatedEvent.m */; };
323-
EA2FABF51DC6FFA100B1D81B /* OPTLYEventTicket.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA771DC6F57100B1D81B /* OPTLYEventTicket.m */; };
324321
EA2FABF61DC6FFA100B1D81B /* OPTLYEventView.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA791DC6F57100B1D81B /* OPTLYEventView.m */; };
325322
EA2FABF71DC6FFA100B1D81B /* OPTLYExperiment.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA7B1DC6F57100B1D81B /* OPTLYExperiment.m */; };
326323
EA2FABF81DC6FFA100B1D81B /* OPTLYGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA7D1DC6F57100B1D81B /* OPTLYGroup.m */; };
@@ -353,7 +350,6 @@
353350
EA2FAC171DC6FFC600B1D81B /* OPTLYEventMetric.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA711DC6F57100B1D81B /* OPTLYEventMetric.m */; };
354351
EA2FAC181DC6FFC600B1D81B /* OPTLYEventParameterKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA731DC6F57100B1D81B /* OPTLYEventParameterKeys.m */; };
355352
EA2FAC191DC6FFC600B1D81B /* OPTLYEventRelatedEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA751DC6F57100B1D81B /* OPTLYEventRelatedEvent.m */; };
356-
EA2FAC1A1DC6FFC600B1D81B /* OPTLYEventTicket.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA771DC6F57100B1D81B /* OPTLYEventTicket.m */; };
357353
EA2FAC1B1DC6FFC600B1D81B /* OPTLYEventView.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA791DC6F57100B1D81B /* OPTLYEventView.m */; };
358354
EA2FAC1C1DC6FFC600B1D81B /* OPTLYExperiment.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA7B1DC6F57100B1D81B /* OPTLYExperiment.m */; };
359355
EA2FAC1D1DC6FFC600B1D81B /* OPTLYGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = EA2FAA7D1DC6F57100B1D81B /* OPTLYGroup.m */; };
@@ -603,8 +599,6 @@
603599
EA2FAA731DC6F57100B1D81B /* OPTLYEventParameterKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OPTLYEventParameterKeys.m; sourceTree = "<group>"; };
604600
EA2FAA741DC6F57100B1D81B /* OPTLYEventRelatedEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OPTLYEventRelatedEvent.h; sourceTree = "<group>"; };
605601
EA2FAA751DC6F57100B1D81B /* OPTLYEventRelatedEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OPTLYEventRelatedEvent.m; sourceTree = "<group>"; };
606-
EA2FAA761DC6F57100B1D81B /* OPTLYEventTicket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OPTLYEventTicket.h; sourceTree = "<group>"; };
607-
EA2FAA771DC6F57100B1D81B /* OPTLYEventTicket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OPTLYEventTicket.m; sourceTree = "<group>"; };
608602
EA2FAA781DC6F57100B1D81B /* OPTLYEventView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OPTLYEventView.h; sourceTree = "<group>"; };
609603
EA2FAA791DC6F57100B1D81B /* OPTLYEventView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OPTLYEventView.m; sourceTree = "<group>"; };
610604
EA2FAA7A1DC6F57100B1D81B /* OPTLYExperiment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OPTLYExperiment.h; sourceTree = "<group>"; };
@@ -972,8 +966,6 @@
972966
EA2FAA731DC6F57100B1D81B /* OPTLYEventParameterKeys.m */,
973967
EA2FAA741DC6F57100B1D81B /* OPTLYEventRelatedEvent.h */,
974968
EA2FAA751DC6F57100B1D81B /* OPTLYEventRelatedEvent.m */,
975-
EA2FAA761DC6F57100B1D81B /* OPTLYEventTicket.h */,
976-
EA2FAA771DC6F57100B1D81B /* OPTLYEventTicket.m */,
977969
EA2FAA781DC6F57100B1D81B /* OPTLYEventView.h */,
978970
EA2FAA791DC6F57100B1D81B /* OPTLYEventView.m */,
979971
EA2FAA7A1DC6F57100B1D81B /* OPTLYExperiment.h */,
@@ -1207,7 +1199,6 @@
12071199
EA2FAB201DC6F58800B1D81B /* OPTLYBuilder.h in Headers */,
12081200
EA2FAB381DC6F59D00B1D81B /* OPTLYErrorHandlerMessages.h in Headers */,
12091201
EA2FAB481DC6F5B100B1D81B /* OPTLYEventBuilder.h in Headers */,
1210-
EA2FAAF41DC6F57200B1D81B /* OPTLYEventTicket.h in Headers */,
12111202
EA2FAB001DC6F57200B1D81B /* OPTLYExperiment.h in Headers */,
12121203
EA2FAB321DC6F59D00B1D81B /* OPTLYErrorHandler.h in Headers */,
12131204
EA8FD0DB1DE9798E00D950AD /* OPTLYHTTPRequestManager.h in Headers */,
@@ -1292,7 +1283,6 @@
12921283
EA2FAAA11DC6F57100B1D81B /* OPTLYDatafileKeys.h in Headers */,
12931284
EA2FAAEF1DC6F57200B1D81B /* OPTLYEventRelatedEvent.h in Headers */,
12941285
EAC5F3441E7B7DDF00C087B8 /* OPTLYEventDispatcherBasic.h in Headers */,
1295-
EA2FAAF51DC6F57200B1D81B /* OPTLYEventTicket.h in Headers */,
12961286
EA16D9371ECBA9B200C4C998 /* OPTLYUserProfile.h in Headers */,
12971287
EA16D93D1ECBD90E00C4C998 /* OPTLYExperimentBucketMapEntity.h in Headers */,
12981288
EAC5F3541E7B7EEF00C087B8 /* OPTLYUserProfileServiceBasic.h in Headers */,
@@ -1821,7 +1811,6 @@
18211811
EA2FAC171DC6FFC600B1D81B /* OPTLYEventMetric.m in Sources */,
18221812
EA2FAC181DC6FFC600B1D81B /* OPTLYEventParameterKeys.m in Sources */,
18231813
EA2FAC191DC6FFC600B1D81B /* OPTLYEventRelatedEvent.m in Sources */,
1824-
EA2FAC1A1DC6FFC600B1D81B /* OPTLYEventTicket.m in Sources */,
18251814
EA2FAC1B1DC6FFC600B1D81B /* OPTLYEventView.m in Sources */,
18261815
EA16D93E1ECBD90E00C4C998 /* OPTLYExperimentBucketMapEntity.m in Sources */,
18271816
EA2FAC1C1DC6FFC600B1D81B /* OPTLYExperiment.m in Sources */,
@@ -1897,7 +1886,6 @@
18971886
EA2FABF31DC6FFA100B1D81B /* OPTLYEventParameterKeys.m in Sources */,
18981887
EA2FABF41DC6FFA100B1D81B /* OPTLYEventRelatedEvent.m in Sources */,
18991888
3E858C881F4227F100D53856 /* OPTLYJSONModel.m in Sources */,
1900-
EA2FABF51DC6FFA100B1D81B /* OPTLYEventTicket.m in Sources */,
19011889
EA2FABF61DC6FFA100B1D81B /* OPTLYEventView.m in Sources */,
19021890
EA2FABF71DC6FFA100B1D81B /* OPTLYExperiment.m in Sources */,
19031891
EA16D93F1ECBD90E00C4C998 /* OPTLYExperimentBucketMapEntity.m in Sources */,

OptimizelySDKCore/OptimizelySDKCore.xcodeproj/xcshareddata/xcschemes/OptimizelySDKCoreiOS.xcscheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
33
LastUpgradeVersion = "0910"
4-
version = "1.3">
4+
version = "1.8">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
@@ -27,7 +27,8 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES">
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
codeCoverageEnabled = "YES">
3132
<Testables>
3233
<TestableReference
3334
skipped = "NO">
@@ -66,7 +67,6 @@
6667
buildConfiguration = "Debug"
6768
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6869
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
69-
language = ""
7070
launchStyle = "0"
7171
useCustomWorkingDirectory = "NO"
7272
ignoresPersistentStateOnLaunch = "NO"

OptimizelySDKCore/OptimizelySDKCore/OPTLYEventAudience.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
***************************************************************************/
1616

1717
#import "OPTLYEventAudience.h"
18-
#import "OPTLYEventParameterKeys.h"
18+
#import "OPTLYDatafileKeys.h"
1919

2020
@implementation OPTLYEventAudience
2121

2222
+ (OPTLYJSONKeyMapper*)keyMapper
2323
{
24-
return [[OPTLYJSONKeyMapper alloc] initWithDictionary:@{ OPTLYEventParameterKeysAudienceId : @"audienceId" }];
24+
return [[OPTLYJSONKeyMapper alloc] initWithDictionary:@{ OPTLYDatafileKeysAudienceId : @"audienceId" }];
2525
}
2626

2727
@end

OptimizelySDKCore/OptimizelySDKCore/OPTLYEventBuilder.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
#import <Foundation/Foundation.h>
2222

23-
@class OPTLYProjectConfig, OPTLYDecisionEventTicket, OPTLYEventTicket;
23+
@class OPTLYProjectConfig, OPTLYDecisionEventTicket;
2424
@protocol OPTLYBucketer;
2525

2626
// --- Event URLs ----
2727
NS_ASSUME_NONNULL_BEGIN
2828
extern NSString * const OptimizelyBucketIdEventParam;
29-
extern NSString * const OPTLYEventBuilderDecisionTicketEventURL;
30-
extern NSString * const OPTLYEventBuilderEventTicketURL;
29+
extern NSString * const OptimizelyActivateEventKey;
30+
extern NSString * const OPTLYEventBuilderEventsTicketURL;
3131
NS_ASSUME_NONNULL_END
3232

3333
@protocol OPTLYEventBuilder <NSObject>
@@ -43,12 +43,12 @@ NS_ASSUME_NONNULL_END
4343
* @return A map of parameters for an impression event. This value can be nil.
4444
*
4545
*/
46-
- (nullable NSDictionary *)buildDecisionEventTicket:(nonnull OPTLYProjectConfig *)config
47-
userId:(nonnull NSString *)userId
48-
experimentKey:(nonnull NSString *)experimentKey
49-
variationId:(nonnull NSString *)variationId
50-
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
51-
46+
- (nullable NSDictionary *)buildImpressionEventTicket:(nonnull OPTLYProjectConfig *)config
47+
userId:(nonnull NSString *)userId
48+
experimentKey:(nonnull NSString *)experimentKey
49+
variationId:(nonnull NSString *)variationId
50+
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
51+
5252
/**
5353
* Create the parameters for a conversion event.
5454
*
@@ -60,12 +60,12 @@ NS_ASSUME_NONNULL_END
6060
* @return A map of parameters for a conversion event. This value can be nil.
6161
*
6262
*/
63-
- (nullable NSDictionary *)buildEventTicket:(nonnull OPTLYProjectConfig *)config
64-
bucketer:(nonnull id<OPTLYBucketer>)bucketer
65-
userId:(nonnull NSString *)userId
66-
eventName:(nonnull NSString *)eventName
67-
eventTags:(nullable NSDictionary *)eventTags
68-
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
63+
- (nullable NSDictionary *)buildConversionTicket:(nonnull OPTLYProjectConfig *)config
64+
bucketer:(nonnull id<OPTLYBucketer>)bucketer
65+
userId:(nonnull NSString *)userId
66+
eventName:(nonnull NSString *)eventName
67+
eventTags:(nullable NSDictionary *)eventTags
68+
attributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
6969
@end
7070

7171
@interface OPTLYEventBuilderDefault : NSObject<OPTLYEventBuilder>

0 commit comments

Comments
 (0)