Skip to content

Commit

Permalink
Release version 1.29.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyorbin committed Jun 4, 2021
1 parent 078d839 commit 63d43a3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions AppboyProject/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ PODS:
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- React-jsinspector (0.61.5)
- react-native-appboy-sdk (1.29.0):
- react-native-appboy-sdk (1.29.1):
- Appboy-iOS-SDK (~> 4.2.0)
- React
- React-RCTActionSheet (0.61.5):
Expand Down Expand Up @@ -350,7 +350,7 @@ SPEC CHECKSUMS:
React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
react-native-appboy-sdk: a186a2a546b089660cad4c6111a1b4f522fa548d
react-native-appboy-sdk: 56dca097c248e752a878a9f0f88aaa946510dd66
React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
Expand Down
2 changes: 1 addition & 1 deletion AppboyProject/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5001,7 +5001,7 @@ react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0:
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==

"react-native-appboy-sdk@file:..":
version "1.29.0"
version "1.29.1"

react-native@^0.61.5:
version "0.61.5"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.29.1

##### Fixed
- Fixed issue introduced in 1.29.0 where calling `ReactAppboy.changeUser` would cause an error on Android.

## 1.29.0

##### ⚠ Breaking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ public void requestImmediateDataFlush() {
Braze.getInstance(getReactApplicationContext()).requestImmediateDataFlush();
}

@ReactMethod
public void changeUser(String userName) {
Braze.getInstance(getReactApplicationContext()).changeUser(userName);
}

@ReactMethod
public void changeUser(String userName, String sdkAuthToken) {
Braze.getInstance(getReactApplicationContext()).changeUser(userName, sdkAuthToken);
Expand Down
26 changes: 13 additions & 13 deletions iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ - (void)reportResultWithCallback:(RCTResponseSenderBlock)callback andError:(NSSt
[self reportResultWithCallback:callback andError:nil andResult:[[Appboy sharedInstance] getDeviceId]];
}

RCT_EXPORT_METHOD(changeUser:(NSString *)userId)
RCT_EXPORT_METHOD(changeUser:(NSString *)userId sdkAuthSignature:(nullable NSString *)signature)
{
RCTLogInfo(@"[Appboy sharedInstance] changeUser with value %@", userId);
[[Appboy sharedInstance] changeUser:userId];
RCTLogInfo(@"[Appboy sharedInstance] changeUser with values %@ %@", userId, signature);
[[Appboy sharedInstance] changeUser:userId sdkAuthSignature:signature];
}

RCT_EXPORT_METHOD(addAlias:(NSString *)aliasName withLabel:(NSString *)aliasLabel)
Expand Down Expand Up @@ -314,24 +314,24 @@ - (void)handleContentCardsUpdated:(NSNotification *)notification {

- (NSArray *)getMappedContentCards {
NSArray<ABKContentCard *> *cards = [[Appboy sharedInstance].contentCardsController getContentCards];

NSMutableArray *mappedCards = [NSMutableArray arrayWithCapacity:[cards count]];
[cards enumerateObjectsUsingBlock:^(id card, NSUInteger idx, BOOL *stop) {
[mappedCards addObject:RCTFormatContentCard(card)];
}];

return mappedCards;
}

- (nullable ABKContentCard *)getContentCardById:(NSString *)idString {
NSArray<ABKContentCard *> *cards = [[Appboy sharedInstance].contentCardsController getContentCards];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"idString == %@", idString];
NSArray *filteredArray = [cards filteredArrayUsingPredicate:predicate];

if ([filteredArray count]) {
return filteredArray[0];
}

return nil;
}

Expand Down Expand Up @@ -387,7 +387,7 @@ - (void) getInAppMessageFromString:(NSString *)inAppMessageJSONString withInAppM

static NSDictionary *RCTFormatContentCard(ABKContentCard *card) {
NSMutableDictionary *formattedContentCardData = [NSMutableDictionary dictionary];

formattedContentCardData[@"id"] = card.idString;
formattedContentCardData[@"created"] = @(card.created);
formattedContentCardData[@"expiresAt"] = @(card.expiresAt);
Expand All @@ -398,9 +398,9 @@ - (void) getInAppMessageFromString:(NSString *)inAppMessageJSONString withInAppM
formattedContentCardData[@"dismissible"] = @(card.dismissible);
formattedContentCardData[@"url"] = RCTNullIfNil(card.urlString);
formattedContentCardData[@"openURLInWebView"] = @(card.openUrlInWebView);

formattedContentCardData[@"extras"] = card.extras ? RCTJSONClean(card.extras) : @{};

if ([card isKindOfClass:[ABKCaptionedImageContentCard class]]) {
ABKCaptionedImageContentCard *captionedCard = (ABKCaptionedImageContentCard *)card;
formattedContentCardData[@"image"] = captionedCard.image;
Expand All @@ -410,14 +410,14 @@ - (void) getInAppMessageFromString:(NSString *)inAppMessageJSONString withInAppM
formattedContentCardData[@"domain"] = RCTNullIfNil(captionedCard.domain);
formattedContentCardData[@"type"] = @"Captioned";
}

if ([card isKindOfClass:[ABKBannerContentCard class]]) {
ABKBannerContentCard *bannerCard = (ABKBannerContentCard *)card;
formattedContentCardData[@"image"] = bannerCard.image;
formattedContentCardData[@"imageAspectRatio"] = @(bannerCard.imageAspectRatio);
formattedContentCardData[@"type"] = @"Banner";
}

if ([card isKindOfClass:[ABKClassicContentCard class]]) {
ABKClassicContentCard *classicCard = (ABKClassicContentCard *)card;
formattedContentCardData[@"image"] = RCTNullIfNil(classicCard.image);
Expand All @@ -426,7 +426,7 @@ - (void) getInAppMessageFromString:(NSString *)inAppMessageJSONString withInAppM
formattedContentCardData[@"domain"] = RCTNullIfNil(classicCard.domain);
formattedContentCardData[@"type"] = @"Classic";
}

return formattedContentCardData;
}

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var ReactAppboy = {
*/
changeUser: function(userId) {
AppboyReactBridge.setSDKFlavor();
AppboyReactBridge.changeUser(userId);
AppboyReactBridge.changeUser(userId, null);
},

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-appboy-sdk",
"version": "1.29.0",
"version": "1.29.1",
"description": "Braze SDK for React Native.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 63d43a3

Please sign in to comment.