Skip to content

Commit 2fe2ff9

Browse files
authored
Fixing xcode project (#398)
* Fixing xcode project * Fixing issue with datastore tests * Fixing error logs, improving tests
1 parent c264df1 commit 2fe2ff9

File tree

9 files changed

+40
-104
lines changed

9 files changed

+40
-104
lines changed

Example/Tests/Classes/LPEventCallbackManagerTest.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ - (void)test_event_callback
5858

5959
- (void)test_event_callback_manager
6060
{
61+
[[LPEventCallbackManager eventCallbackMap] removeAllObjects];
6162
NSMutableDictionary *eventCallbackMap = [LPEventCallbackManager eventCallbackMap];
6263
XCTAssertNotNil(eventCallbackMap);
6364
XCTAssertTrue(eventCallbackMap.count == 0);

Example/Tests/Classes/LPEventDataManagerTest.m

Lines changed: 20 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ - (void)setUp {
6464
- (void)tearDown {
6565
[super tearDown];
6666
[LeanplumHelper clean_up];
67+
[HTTPStubs removeAllStubs];
6768
}
6869

6970
- (NSDictionary *)sampleData
@@ -124,50 +125,6 @@ - (void)test_track_save
124125
XCTAssertTrue(events.count == 2);
125126
}
126127

127-
- (void)test_request_synchronous
128-
{
129-
// Simulate slow network.
130-
[HTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
131-
return [request.URL.host isEqualToString:API_HOST];;
132-
} withStubResponse:^HTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
133-
NSString *response_file = OHPathForFile(@"action_response.json", self.class);
134-
return [[HTTPStubsResponse responseWithFileAtPath:response_file statusCode:200
135-
headers:@{@"Content-Type":@"application/json"}]
136-
requestTime:1.0 responseTime:1.0];
137-
}];
138-
139-
// Determine whether the requests are sent in order using the timestamp.
140-
NSDate *date = [NSDate date];
141-
dispatch_semaphore_t semaphoreTest1 = dispatch_semaphore_create(0);
142-
dispatch_semaphore_t semaphoreTest2 = dispatch_semaphore_create(0);
143-
LPRequest *request = [LPRequestFactory createPostForApiMethod:@"test1" params:nil];
144-
[[LPRequestSender sharedInstance] sendNow:request];
145-
[LPNetworkEngine validate_operation:^(LPNetworkOperation *operation) {
146-
// Make sure the call is for test2.
147-
NSDictionary *data = [LPJSON JSONFromString:operation.requestParam[@"data"]];
148-
if ([data[@"data"][0][@"action"] isEqual:@"test1"]) {
149-
dispatch_semaphore_signal(semaphoreTest1);
150-
return NO;
151-
}
152-
153-
NSTimeInterval operationTime = [[NSDate date] timeIntervalSinceDate:date];
154-
XCTAssertTrue(operationTime > 0.7);
155-
dispatch_semaphore_signal(semaphoreTest2);
156-
return YES;
157-
}];
158-
long timedOut = dispatch_semaphore_wait(semaphoreTest1, [LeanplumHelper default_dispatch_time]);
159-
XCTAssertTrue(timedOut == 0);
160-
LPRequest *request2 = [LPRequestFactory createPostForApiMethod:@"test2" params:nil];
161-
[[LPRequestSender sharedInstance] sendNow:request2];
162-
timedOut = dispatch_semaphore_wait(semaphoreTest2, [LeanplumHelper default_dispatch_time]);
163-
XCTAssertTrue(timedOut == 0);
164-
165-
// Clean up.
166-
[[LPOperationQueue serialQueue] cancelAllOperations];
167-
[[LPOperationQueue serialQueue] waitUntilAllOperationsAreFinished];
168-
[HTTPStubs removeAllStubs];
169-
}
170-
171128
- (void)test_response_code
172129
{
173130
[LeanplumHelper clean_up];
@@ -204,59 +161,36 @@ - (void)test_uuid
204161
{
205162
[LPEventDataManager deleteEventsWithLimit:10000];
206163

207-
// Simulate Error.
208-
id<HTTPStubsDescriptor> stubs = [HTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *request) {
209-
return [request.URL.host isEqualToString:API_HOST];;
164+
// Create a stub for track event response.
165+
[HTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
166+
return [request.URL.host isEqualToString:API_HOST];
210167
} withStubResponse:^HTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
211-
NSError *error = [NSError errorWithDomain:NSURLErrorDomain
212-
code:NSURLErrorBadServerResponse userInfo:nil];
213-
return [HTTPStubsResponse responseWithError:error];
168+
NSString *response_file = OHPathForFile(@"track_event_response.json", self.class);
169+
return [HTTPStubsResponse responseWithFileAtPath:response_file statusCode:200
170+
headers:@{@"Content-Type":@"application/json"}];
214171
}];
215172

216173
// UUID should be the same.
217174
[Leanplum track:@"sample"];
218175
[Leanplum track:@"sample2"];
219-
LPRequest *request = [LPRequestFactory createPostForApiMethod:@"sample3" params:nil];
220-
[[LPRequestSender sharedInstance] sendNow:request];
221-
222176
[[LPOperationQueue serialQueue] waitUntilAllOperationsAreFinished];
223177

178+
// Should have same uuids.
224179
NSArray *events = [LPEventDataManager eventsWithLimit:10000];
225-
XCTAssertTrue(events.count == 3);
180+
XCTAssertTrue(events.count == 2);
226181
XCTAssertTrue([events[0][@"uuid"] isEqual:events[1][@"uuid"]]);
227-
XCTAssertTrue([events[0][@"uuid"] isEqual:events[2][@"uuid"]]);
182+
NSString *oldUUID = events[0][@"uuid"];
183+
[Leanplum forceContentUpdate];
228184

229185
// After sending, the last one should have a different uuid.
230186
[Leanplum track:@"sample4"];
231-
232187
[[LPOperationQueue serialQueue] waitUntilAllOperationsAreFinished];
233-
234188
events = [LPEventDataManager eventsWithLimit:10000];
235-
XCTAssertTrue(events.count == 4);
236-
XCTAssertTrue([events[0][@"uuid"] isEqual:events[1][@"uuid"]]);
237-
XCTAssertTrue([events[0][@"uuid"] isEqual:events[2][@"uuid"]]);
238-
// Third one should be different.
239-
XCTAssertFalse([events[0][@"uuid"] isEqual:events[3][@"uuid"]]);
240-
241-
// Delete events on success.
242-
[HTTPStubs removeStub:stubs];
243-
[HTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
244-
return [request.URL.host isEqualToString:API_HOST];;
245-
} withStubResponse:^HTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
246-
NSData *responseData = [@"Success" dataUsingEncoding:NSUTF8StringEncoding];
247-
return [HTTPStubsResponse responseWithData:responseData statusCode:200
248-
headers:@{@"Content-Type":@"application/json"}];
249-
}];
189+
XCTAssertTrue(events.count == 1);
190+
XCTAssertFalse([events[0][@"uuid"] isEqual:oldUUID]);
250191

251-
dispatch_semaphore_t semaphoreSample4 = dispatch_semaphore_create(0);
252-
[LPNetworkEngine validate_operation:^BOOL(LPNetworkOperation *operation) {
253-
dispatch_semaphore_signal(semaphoreSample4);
254-
return YES;
255-
}];
256-
LPRequest *request2 = [LPRequestFactory createPostForApiMethod:@"sample4" params:nil];
257-
[[LPRequestSender sharedInstance] sendNow:request2];
258-
long timedOut = dispatch_semaphore_wait(semaphoreSample4, [LeanplumHelper default_dispatch_time]);
259-
XCTAssertTrue(timedOut == 0);
192+
// No events should be stored.
193+
[Leanplum forceContentUpdate];
260194
[[LPOperationQueue serialQueue] waitUntilAllOperationsAreFinished];
261195
events = [LPEventDataManager eventsWithLimit:10000];
262196
XCTAssertTrue(events.count == 0);
@@ -270,7 +204,7 @@ - (void)test_uuid
270204
XCTAssertTrue(events.count == MAX_EVENTS_PER_API_CALL+1);
271205
XCTAssertFalse([events[0][@"uuid"] isEqual:events[MAX_EVENTS_PER_API_CALL][@"uuid"]]);
272206

273-
// Make sure there will be 2 requests.
207+
// Make sure there will be 2 requests that are split because of MAX_EVENTS_PER_API_CALL.
274208
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
275209
NSInteger __block requestCount = 0;
276210
[LPNetworkEngine validate_operation:^(LPNetworkOperation *operation) {
@@ -281,9 +215,10 @@ - (void)test_uuid
281215
dispatch_semaphore_signal(semaphore);
282216
return YES;
283217
}];
284-
LPRequest *request3 = [LPRequestFactory createPostForApiMethod:@"test2" params:nil];
285-
[[LPRequestSender sharedInstance] sendNow:request3];
286-
timedOut = dispatch_semaphore_wait(semaphore, [LeanplumHelper default_dispatch_time]);
218+
[Leanplum forceContentUpdate];
219+
[[LPOperationQueue serialQueue] waitUntilAllOperationsAreFinished];
220+
221+
long timedOut = dispatch_semaphore_wait(semaphore, [LeanplumHelper default_dispatch_time]);
287222
XCTAssertTrue(timedOut == 0);
288223
XCTAssertTrue(requestCount == 2);
289224
}

Leanplum-SDK.xcodeproj/project.pbxproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
04F29D7FC689946A581A0B80 /* NSString+MD5Addition.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E92E36CB1A6E16A835BC5C3 /* NSString+MD5Addition.h */; settings = {ATTRIBUTES = (Public, ); }; };
1212
06E4A551353735223D28CAA5 /* Leanplum_AsyncSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C909901DE6A051D258A68 /* Leanplum_AsyncSocket.h */; settings = {ATTRIBUTES = (Public, ); }; };
1313
074FD7741CE2769795BDB253 /* LPVar.h in Headers */ = {isa = PBXBuildFile; fileRef = 77F4DBF8B357F6462B2954BC /* LPVar.h */; settings = {ATTRIBUTES = (Public, ); }; };
14+
07E813C924F5131400F8A7F3 /* LPPushMessageTemplate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E813C724F5131400F8A7F3 /* LPPushMessageTemplate.h */; };
15+
07E813CA24F5131400F8A7F3 /* LPPushMessageTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E813C824F5131400F8A7F3 /* LPPushMessageTemplate.m */; };
16+
07E813CB24F5131400F8A7F3 /* LPPushMessageTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E813C824F5131400F8A7F3 /* LPPushMessageTemplate.m */; };
1417
07EDB9AA720FBB439DCE5342 /* LPFileTransferManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C2CBACF77D114F87E168C2D2 /* LPFileTransferManager.m */; };
1518
08051C2E3C76FB5DFD7334CC /* LPAppIconManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B6A5CBB11B15F1D1210155 /* LPAppIconManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
1619
091C1557DA8AEF03F81C339E /* LPFileTransferManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F5B5A0861F8087E66465B801 /* LPFileTransferManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -20,7 +23,6 @@
2023
1056E4D914F41026D49870F5 /* LPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C65EB9556E41FC23647AFFC /* LPRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
2124
1234E2B6A68005D7BEA1F982 /* LPSwizzle.h in Headers */ = {isa = PBXBuildFile; fileRef = EE69CC9001AFA83B751C9727 /* LPSwizzle.h */; settings = {ATTRIBUTES = (Public, ); }; };
2225
13DBFA38ADA8F85CD261F848 /* LPNetworkFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D468287B8693E998A4DA61F /* LPNetworkFactory.m */; };
23-
15A773A0D30072EBC0672BC5 /* LeanplumRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 067B2075E69EDFF6BDFEB5B6 /* LeanplumRequest.m */; };
2426
1667C71FD6EA478305045881 /* LPDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = 360F443AF734D56A0606DDFE /* LPDatabase.m */; };
2527
16E5B0F75A12F34C3E94D055 /* LPAES.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C5C57584FAC4AA35ED6A4B2 /* LPAES.m */; };
2628
174F9F64E701C53EB7C988D9 /* LPWebInterstitialMessageTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = 12F9E403120E0A799B5A9940 /* LPWebInterstitialMessageTemplate.m */; };
@@ -44,13 +46,11 @@
4446
32FE0BB3DB7DDD98EF8D34B8 /* LPPopupViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F783E262F11CB7A67A9A5F /* LPPopupViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
4547
34E54F6B0F56F902C2AC8145 /* LPAlertMessageTemplate.h in Headers */ = {isa = PBXBuildFile; fileRef = 928E61B15B3E72F47FDC43C3 /* LPAlertMessageTemplate.h */; settings = {ATTRIBUTES = (Public, ); }; };
4648
3704BEBBC6C93D2DF74C3613 /* LPContextualValues.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E69D721ED9504A207FEB77D /* LPContextualValues.m */; };
47-
38C3D419B445C3558B575861 /* LPRequesting.h in Headers */ = {isa = PBXBuildFile; fileRef = AF4281F86171CCA32AED5768 /* LPRequesting.h */; settings = {ATTRIBUTES = (Public, ); }; };
4849
38FE424BA40ECF063A4B0D77 /* LPActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = AC889B5231CDF21DCB080C36 /* LPActionManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
4950
3D220BF1DB5E5B9449F98A29 /* LPAppIconManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E846E120F6FAF683C59E485D /* LPAppIconManager.m */; };
5051
3E416D0B2C86C841A8B9E2DE /* LPRequestFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 19AE62BF2557D53314A72975 /* LPRequestFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
5152
3ED83826236AD245F151C833 /* LPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 2553D7685D3F6A7735C06CE4 /* LPRequest.m */; };
5253
405BA9EC69827B5116400D2A /* LPExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0332D35311C597081F66A0 /* LPExceptionHandler.m */; };
53-
4263CE77DAD823E9008A4403 /* LeanplumRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = F642FD49A4AC21FE0835080D /* LeanplumRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
5454
44B39486D98C1883C9307A95 /* LPFeatureFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8944D84D9BC2FC98348DE75F /* LPFeatureFlags.h */; settings = {ATTRIBUTES = (Public, ); }; };
5555
45A652FF3AED31DEF90A8B25 /* LPMessageArchiveData.h in Headers */ = {isa = PBXBuildFile; fileRef = D18A543F308DDFB45743F818 /* LPMessageArchiveData.h */; settings = {ATTRIBUTES = (Public, ); }; };
5656
45FE57FD2E5A2ED6A4D05DC1 /* LPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96DB74EC49812E3469B9DA3D /* LPViewController.m */; };
@@ -190,6 +190,8 @@
190190
063B711025F45B9A5F51BE54 /* LPIconChangeMessageTemplate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LPIconChangeMessageTemplate.h; sourceTree = "<group>"; };
191191
067B2075E69EDFF6BDFEB5B6 /* LeanplumRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LeanplumRequest.m; sourceTree = "<group>"; };
192192
06C5B560A3447B6953C2AA78 /* LPOpenUrlMessageTemplate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LPOpenUrlMessageTemplate.m; sourceTree = "<group>"; };
193+
07E813C724F5131400F8A7F3 /* LPPushMessageTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LPPushMessageTemplate.h; sourceTree = "<group>"; };
194+
07E813C824F5131400F8A7F3 /* LPPushMessageTemplate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LPPushMessageTemplate.m; sourceTree = "<group>"; };
193195
09B412A6D6B9AADC8FAC36AB /* LPRevenueManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LPRevenueManager.m; sourceTree = "<group>"; };
194196
0C3AD74B6AC45FA222E191D3 /* LPMessageArchiveData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LPMessageArchiveData.m; sourceTree = "<group>"; };
195197
0C5C57584FAC4AA35ED6A4B2 /* LPAES.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LPAES.m; sourceTree = "<group>"; };
@@ -722,6 +724,8 @@
722724
B2E7D096355975197CEF7E6A /* LPIconChangeMessageTemplate.m */,
723725
60E0B01009AA1040D1A7B584 /* LPInterstitialMessageTemplate.h */,
724726
BE2C8D5887B09DEB3A6CC082 /* LPInterstitialMessageTemplate.m */,
727+
07E813C724F5131400F8A7F3 /* LPPushMessageTemplate.h */,
728+
07E813C824F5131400F8A7F3 /* LPPushMessageTemplate.m */,
725729
1C2BB602F6F13ED99D9E2C0D /* LPMessageTemplateConstants.h */,
726730
CEEB0C2F74C7B8C7C2F1EAA4 /* LPMessageTemplateProtocol.h */,
727731
A6C50EDC85CCDB01FB351A5E /* LPOpenUrlMessageTemplate.h */,
@@ -851,7 +855,6 @@
851855
1056E4D914F41026D49870F5 /* LPRequest.h in Headers */,
852856
3E416D0B2C86C841A8B9E2DE /* LPRequestFactory.h in Headers */,
853857
CB24750D7C2F9AFCC751D269 /* LPRequestSender.h in Headers */,
854-
38C3D419B445C3558B575861 /* LPRequesting.h in Headers */,
855858
8B473962853F7E1D5F3DDC78 /* LPResponse.h in Headers */,
856859
29E2700BAFB249E6CDBA28E4 /* LPRevenueManager.h in Headers */,
857860
619B024D57210214484C6784 /* LPRichInterstitialMessageTemplate.h in Headers */,
@@ -867,11 +870,11 @@
867870
5E2273EFA0ED797396DEDDC1 /* LeanplumCompatibility.h in Headers */,
868871
9EEE92B524D95765003F0720 /* LPLogManager.h in Headers */,
869872
A715BC149B459806473982B4 /* LeanplumInternal.h in Headers */,
870-
4263CE77DAD823E9008A4403 /* LeanplumRequest.h in Headers */,
871873
A4618571D02EBF40BD408655 /* LeanplumSDK_iOS.h in Headers */,
872874
A7A4D30834103F3AEB3B2412 /* LeanplumSDK_tvOS.h in Headers */,
873875
9A3B4A00BBE298BB47915FCA /* LeanplumSocket.h in Headers */,
874876
06E4A551353735223D28CAA5 /* Leanplum_AsyncSocket.h in Headers */,
877+
07E813C924F5131400F8A7F3 /* LPPushMessageTemplate.h in Headers */,
875878
9E53F71E247D34C80097955F /* LPNotificationsConstants.h in Headers */,
876879
9E53F712247D34C80097955F /* LPLocalNotificationsHandler.h in Headers */,
877880
9E53F715247D34C80097955F /* LPLocalNotificationsManager.h in Headers */,
@@ -1023,6 +1026,7 @@
10231026
30D151BDA42D2F3A9E38A628 /* LPPopupViewController.m in Sources */,
10241027
C30DFD29126D9E746C17CE40 /* LPPushAskToAskMessageTemplate.m in Sources */,
10251028
2C03C32C49CE3024E41E6505 /* LPRegisterDevice.m in Sources */,
1029+
07E813CB24F5131400F8A7F3 /* LPPushMessageTemplate.m in Sources */,
10261030
875717F047C2EC1893A0CBFE /* LPRegisterForPushMessageTemplate.m in Sources */,
10271031
3ED83826236AD245F151C833 /* LPRequest.m in Sources */,
10281032
D2725B4A7121B718F97FD0BA /* LPRequestFactory.m in Sources */,
@@ -1040,7 +1044,6 @@
10401044
CAB620162C4A4A0D411A7484 /* LPWebInterstitialViewController.m in Sources */,
10411045
18B1EA72234280A2F0F40078 /* Leanplum.m in Sources */,
10421046
265E7DF08643C40A2CEF2270 /* LeanplumCompatibility.m in Sources */,
1043-
15A773A0D30072EBC0672BC5 /* LeanplumRequest.m in Sources */,
10441047
E306D0851E030F0C3EF5C6A5 /* LeanplumSocket.m in Sources */,
10451048
D7E54C3437128ACDDA5A85C2 /* Leanplum_AsyncSocket.m in Sources */,
10461049
E69648B6C9468B6F3151C3A9 /* Leanplum_Reachability.m in Sources */,
@@ -1063,6 +1066,7 @@
10631066
D0863813CF316D1C7EF6AC7B /* LPAppDelegate.m in Sources */,
10641067
9E53F716247D34C80097955F /* LPPushNotificationsManager.m in Sources */,
10651068
9E53F719247D34C80097955F /* LPPushNotificationsHandler.m in Sources */,
1069+
07E813CA24F5131400F8A7F3 /* LPPushMessageTemplate.m in Sources */,
10661070
9E53F71C247D34C80097955F /* LPNotificationsManager.m in Sources */,
10671071
45FE57FD2E5A2ED6A4D05DC1 /* LPViewController.m in Sources */,
10681072
7DC192309294011EA8D1F98B /* main.m in Sources */,

Leanplum-SDK/Classes/Internal/LeanplumInternal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ NS_SWIFT_NAME(track(event:value:info:args:params:));
104104
+ (void)onStartIssued:(LeanplumStartIssuedBlock)block;
105105
+ (void)synchronizeDefaults;
106106

107-
void LPLog(LPLogType type, NSString* format, ...);
108-
109107
@end
110108

111109
#pragma mark - LPInbox class

Leanplum-SDK/Classes/Managers/LPFileManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ + (NSArray *)convertStringArrayToRegexArray:(NSArray *)stringArray
617617
if (!error) {
618618
[regexArray addObject:regex];
619619
} else {
620-
LPLog(LPError, error);
620+
LPLog(LPError, [error localizedDescription]);
621621
error = nil;
622622
}
623623
}
@@ -824,7 +824,7 @@ + (void)enableResourceSyncingWithInclusions:(NSArray *)inclusions
824824
[[NSUserDefaults standardUserDefaults] synchronize];
825825
}
826826
if (error) {
827-
LPLog(LPError, error);
827+
LPLog(LPError, [error localizedDescription]);
828828
}
829829
hasInited = YES;
830830
initializing = NO;

Leanplum-SDK/Classes/Managers/LPLogManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ + (void)logInternalError:(NSException *)e
108108

109109
@end
110110

111-
void LPLog(LPLogType type , NSString *format, ...) {
111+
void LPLog(LPLogType type, NSString *format, ...) {
112112
va_list vargs;
113113
va_start(vargs, format);
114114
NSString *formattedMessage = [[NSString alloc] initWithFormat:format arguments:vargs];

Leanplum-SDK/Classes/Managers/Networking/LPFileTransferManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ - (void)maybeSendNextUpload
200200
}
201201
}
202202
[self printUploadProgress];
203-
LPLog(LPError, err);
203+
LPLog(LPError, [err localizedDescription]);
204204
[self maybeSendNextUpload];
205205
LP_END_TRY
206206
}];
@@ -277,7 +277,7 @@ - (void)downloadFile:(NSString *)path onResponse:(LPNetworkResponseBlock)respons
277277
LP_END_TRY
278278
} errorHandler:^(id<LPNetworkOperationProtocol> operation, NSError *err) {
279279
LP_TRY
280-
LPLog(LPError, err);
280+
LPLog(LPError, [err localizedDescription]);
281281
self.pendingDownloads--;
282282
if (errorBlock != nil) {
283283
errorBlock(err);

0 commit comments

Comments
 (0)