@@ -864,7 +864,7 @@ + (void)startWithUserId:(NSString *)userId
864864 // Issue start API call.
865865 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
866866 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
867- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_START params : params];
867+ id <LPRequesting> request = [reqFactory startWithParams : params];
868868 [request onResponse: ^(id <LPNetworkOperationProtocol> operation, NSDictionary *response) {
869869 LP_TRY
870870 state.hasStarted = YES ;
@@ -945,8 +945,7 @@ + (void)startWithUserId:(NSString *)userId
945945 if (arc4random () % 1000 == 0 ) {
946946 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
947947 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
948- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_LOG
949- params: @{
948+ id <LPRequesting> request = [reqFactory logWithParams: @{
950949 LP_PARAM_TYPE: LP_VALUE_SDK_START_LATENCY,
951950 @" startLatency" : [@(latency) description ]
952951 }];
@@ -1044,7 +1043,7 @@ + (void)startWithUserId:(NSString *)userId
10441043 objectForKey: @" UIApplicationExitsOnSuspend" ] boolValue ];
10451044 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
10461045 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
1047- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_STOP params :nil ];
1046+ id <LPRequesting> request = [reqFactory stopWithParams :nil ];
10481047 [[LPRequestSender sharedInstance ] sendIfConnected: request sync: exitOnSuspend];
10491048 LP_END_TRY
10501049 }];
@@ -1056,7 +1055,7 @@ + (void)startWithUserId:(NSString *)userId
10561055 if ([[UIApplication sharedApplication ] applicationState ] == UIApplicationStateActive) {
10571056 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
10581057 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
1059- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_HEARTBEAT params :nil ];
1058+ id <LPRequesting> request = [reqFactory heartbeatWithParams :nil ];
10601059 [[LPRequestSender sharedInstance ] sendIfDelayed: request];
10611060
10621061 }
@@ -1153,7 +1152,7 @@ + (void)pause
11531152 // Send pause event.
11541153 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
11551154 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
1156- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_PAUSE_SESSION params :nil ];
1155+ id <LPRequesting> request = [reqFactory pauseSessionWithParams :nil ];
11571156 [request onResponse: ^(id <LPNetworkOperationProtocol> operation, id json) {
11581157 finishTaskHandler ();
11591158 }];
@@ -1167,7 +1166,7 @@ + (void)resume
11671166{
11681167 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
11691168 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
1170- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_RESUME_SESSION params :nil ];
1169+ id <LPRequesting> request = [reqFactory resumeSessionWithParams :nil ];
11711170 [[LPRequestSender sharedInstance ] sendIfDelayed: request];
11721171}
11731172
@@ -1909,7 +1908,7 @@ + (void)trackInternal:(NSString *)event withArgs:(NSDictionary *)args
19091908{
19101909 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
19111910 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
1912- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_TRACK params : args];
1911+ id <LPRequesting> request = [reqFactory trackWithParams : args];
19131912 [[LPRequestSender sharedInstance ] sendRequest: request];
19141913
19151914 // Perform event actions.
@@ -2042,7 +2041,7 @@ + (void)setUserIdInternal:(NSString *)userId withAttributes:(NSDictionary *)attr
20422041
20432042 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
20442043 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2045- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_SET_USER_ATTRIBUTES params : @{
2044+ id <LPRequesting> request = [reqFactory setUserAttributesWithParams : @{
20462045 LP_PARAM_USER_ATTRIBUTES: attributes ? [LPJSON stringFromJSON: attributes] : @" " ,
20472046 LP_PARAM_NEW_USER_ID: userId ? userId : @" "
20482047 }];
@@ -2118,7 +2117,7 @@ + (void)setTrafficSourceInfoInternal:(NSDictionary *)info
21182117{
21192118 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
21202119 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2121- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_SET_TRAFFIC_SOURCE_INFO params : @{
2120+ id <LPRequesting> request = [reqFactory setTrafficSourceInfoWithParams : @{
21222121 LP_PARAM_TRAFFIC_SOURCE: info
21232122 }];
21242123 [[LPRequestSender sharedInstance ] sendRequest: request];
@@ -2173,7 +2172,7 @@ + (void)advanceToInternal:(NSString *)state withArgs:(NSDictionary *)args
21732172{
21742173 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
21752174 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2176- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_ADVANCE params : args];
2175+ id <LPRequesting> request = [reqFactory advanceWithParams : args];
21772176 [[LPRequestSender sharedInstance ] sendRequest: request];
21782177 LPContextualValues *contextualValues = [[LPContextualValues alloc ] init ];
21792178 contextualValues.parameters = params;
@@ -2202,7 +2201,7 @@ + (void)pauseStateInternal
22022201{
22032202 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
22042203 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2205- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_PAUSE_STATE params : @{}];
2204+ id <LPRequesting> request = [reqFactory pauseStateWithParams : @{}];
22062205 [[LPRequestSender sharedInstance ] sendRequest: request];
22072206}
22082207
@@ -2224,7 +2223,7 @@ + (void)resumeStateInternal
22242223{
22252224 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
22262225 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2227- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_RESUME_STATE params : @{}];
2226+ id <LPRequesting> request = [reqFactory resumeStateWithParams : @{}];
22282227 [[LPRequestSender sharedInstance ] sendRequest: request];
22292228}
22302229
@@ -2253,9 +2252,7 @@ + (void)forceContentUpdate:(LeanplumVariablesChangedBlock)block
22532252
22542253 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
22552254 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2256- id <LPRequesting> request = [reqFactory
2257- createPostForApiMethod: LP_METHOD_GET_VARS
2258- params: params];
2255+ id <LPRequesting> request = [reqFactory getVarsWithParams: params];
22592256 [request onResponse: ^(id <LPNetworkOperationProtocol> operation, NSDictionary *response) {
22602257 LP_TRY
22612258 NSDictionary *values = response[LP_KEY_VARS];
@@ -2543,7 +2540,7 @@ + (void)maybeSendLog:(NSString *)message {
25432540 @try {
25442541 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
25452542 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2546- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_LOG params : @{
2543+ id <LPRequesting> request = [reqFactory logWithParams : @{
25472544 LP_PARAM_TYPE: LP_VALUE_SDK_LOG,
25482545 LP_PARAM_MESSAGE: message
25492546 }];
@@ -2636,7 +2633,7 @@ + (void)setUserLocationAttributeWithLatitude:(double)latitude
26362633
26372634 LPRequestFactory *reqFactory = [[LPRequestFactory alloc ]
26382635 initWithFeatureFlagManager: [LPFeatureFlagManager sharedManager ]];
2639- id <LPRequesting> request = [reqFactory createPostForApiMethod: LP_METHOD_SET_USER_ATTRIBUTES params : params];
2636+ id <LPRequesting> request = [reqFactory setUserAttributesWithParams : params];
26402637 [request onResponse: ^(id <LPNetworkOperationProtocol> operation, id json) {
26412638 if (response) {
26422639 response (YES );
0 commit comments