Skip to content

Commit acb1fac

Browse files
committed
SDK-777 save partial implementation
1 parent 0cda171 commit acb1fac

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,16 @@ - (void) processRequest:(BNCServerRequest*)req
18701870
error.code == BNCBadRequestError ||
18711871
error.code == BNCDuplicateResourceError) {
18721872

1873-
BNCPerformBlockOnMainThreadSync(^{ [req processResponse:response error:error]; });
1873+
BNCPerformBlockOnMainThreadSync(^{
1874+
[req processResponse:response error:error];
1875+
if ([req isKindOfClass:[BranchEventRequest class]]) {
1876+
NSString *status = @"Complete";
1877+
if (error) {
1878+
[NSString stringWithFormat:@"Error: %@", error.description];
1879+
}
1880+
[[BNCCallbackMap shared] callCompletionForRequest:req withStatusMessage:status];
1881+
}
1882+
});
18741883

18751884
[self.requestQueue dequeue];
18761885
self.networkCount = 0;
@@ -1911,7 +1920,13 @@ - (void) processRequest:(BNCServerRequest*)req
19111920

19121921
// Finally, call all the requests callbacks with the error
19131922
for (BNCServerRequest *request in requestsToFail) {
1914-
BNCPerformBlockOnMainThreadSync(^ { [request processResponse:nil error:error]; });
1923+
BNCPerformBlockOnMainThreadSync(^ {
1924+
[request processResponse:nil error:error];
1925+
1926+
if ([request isKindOfClass:[BranchEventRequest class]]) {
1927+
[[BNCCallbackMap shared] callCompletionForRequest:req withStatusMessage:[NSString stringWithFormat:@"Error: %@", error.description]];
1928+
}
1929+
});
19151930
}
19161931
}
19171932
}

Branch-SDK/Branch-SDK/BranchEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ typedef NS_ENUM(NSInteger, BranchEventAdType) {
8989
@property (nonatomic, copy) NSDictionary<NSString*, NSString*> *_Nonnull customData;
9090

9191
// test callback for branch event
92-
- (void)logEventWithCompletion:(void (^_Nullable)(NSString *statusMessage))completion;
92+
- (void)logEventWithCompletion:(void (^_Nullable)(NSString * _Nullable statusMessage))completion;
9393

9494
- (void) logEvent; //!< Logs the event on the Branch server.
9595
- (NSDictionary*_Nonnull) dictionary; //!< Returns a dictionary representation of the event.

Branch-SDK/Branch-SDK/BranchEvent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ - (void)logEventWithCompletion:(void (^_Nullable)(NSString *statusMessage))compl
226226
BNCLogError(@"Invalid event type '%@' or empty string.", NSStringFromClass(_eventName.class));
227227

228228
if (completion) {
229-
completion(@"Error");
229+
completion(@"Error: Invalid event type");
230230
}
231231

232232
return;

0 commit comments

Comments
 (0)