Skip to content

Commit 39a77a7

Browse files
authored
Merge pull request #1210 from BranchMetrics/SDK-1671-mark-v1event-methods-deprecated
Sdk 1671 - mark v1event methods deprecated
2 parents 5288700 + 21e7940 commit 39a77a7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Branch-SDK/Branch.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
970970
971971
@param action The action string.
972972
*/
973-
- (void)userCompletedAction:(nullable NSString *)action;
973+
- (void)userCompletedAction:(nullable NSString *)action __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
974974

975975
/**
976976
Send a user action to the server with additional state items. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc.
@@ -982,7 +982,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
982982
@param action The action string.
983983
@param state The additional state items associated with the action.
984984
*/
985-
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state;
985+
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
986986

987987
/**
988988
Send a user action to the server with additional state items. Some examples actions could be things like `viewed_personal_welcome`, `purchased_an_item`, etc.
@@ -997,7 +997,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
997997
998998
@deprecated Please use userCompletedAction:action:state instead
999999
*/
1000-
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state withDelegate:(nullable id)branchViewCallback __attribute__((deprecated(("This API is deprecated. Please use userCompletedAction:action:state instead."))));
1000+
- (void)userCompletedAction:(nullable NSString *)action withState:(nullable NSDictionary *)state withDelegate:(nullable id)branchViewCallback __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
10011001

10021002
/**
10031003
Sends a user commerce event to the server.
@@ -1019,7 +1019,7 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
10191019
*/
10201020
- (void) sendCommerceEvent:(BNCCommerceEvent*)commerceEvent
10211021
metadata:(NSDictionary<NSString*,id>*)metadata
1022-
withCompletion:(void (^) (NSDictionary* _Nullable response, NSError* _Nullable error))completion __attribute__((deprecated(("Please use BranchEvent to track commerce events."))));
1022+
withCompletion:(void (^) (NSDictionary* _Nullable response, NSError* _Nullable error))completion __attribute__((deprecated(("Please use BranchEvent to track commerce events. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information."))));
10231023

10241024

10251025
#pragma mark - Query methods

Branch-SDK/Branch.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,9 @@ - (void)userCompletedAction:(NSString *)action {
11341134
}
11351135

11361136
- (void)userCompletedAction:(NSString *)action withState:(NSDictionary *)state {
1137+
1138+
NSLog(@"'userCompletedAction' method has been deprecated. Please use BranchEvent for your event tracking use cases. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information.");
1139+
11371140
if (!action) {
11381141
return;
11391142
}
@@ -1164,6 +1167,7 @@ - (void)sendServerRequestWithoutSession:(BNCServerRequest*)request {
11641167
}
11651168

11661169
- (void)sendCommerceEvent:(BNCCommerceEvent *)commerceEvent metadata:(NSDictionary*)metadata withCompletion:(void (^)(NSDictionary *, NSError *))completion {
1170+
NSLog(@"'sendCommerceEvent' method has been deprecated. Please use BranchEvent for your event tracking use cases. You can refer to https://help.branch.io/developers-hub/docs/tracking-commerce-content-lifecycle-and-custom-events for additional information.");
11671171
[self initSafetyCheck];
11681172
dispatch_async(self.isolationQueue, ^(){
11691173
BranchCommerceEventRequest *request = [[BranchCommerceEventRequest alloc] initWithCommerceEvent:commerceEvent metadata:metadata completion:completion];

0 commit comments

Comments
 (0)