From 63d43a36a0832947066e86835667966043686d64 Mon Sep 17 00:00:00 2001 From: wesleyorbin Date: Fri, 4 Jun 2021 11:40:06 -0400 Subject: [PATCH] Release version 1.29.1 --- AppboyProject/ios/Podfile.lock | 4 +-- AppboyProject/yarn.lock | 2 +- CHANGELOG.md | 5 ++++ .../appboy/reactbridge/AppboyReactBridge.java | 5 ---- .../AppboyReactBridge/AppboyReactBridge.m | 26 +++++++++---------- index.js | 2 +- package.json | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/AppboyProject/ios/Podfile.lock b/AppboyProject/ios/Podfile.lock index 638e7e9..f7a983f 100644 --- a/AppboyProject/ios/Podfile.lock +++ b/AppboyProject/ios/Podfile.lock @@ -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): @@ -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 diff --git a/AppboyProject/yarn.lock b/AppboyProject/yarn.lock index 9f2a8db..5e554a8 100644 --- a/AppboyProject/yarn.lock +++ b/AppboyProject/yarn.lock @@ -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" diff --git a/CHANGELOG.md b/CHANGELOG.md index d310c4f..3ae8b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java b/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java index cbf838d..22657ed 100644 --- a/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java +++ b/android/src/main/java/com/appboy/reactbridge/AppboyReactBridge.java @@ -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); diff --git a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m index 753452b..4e8288e 100644 --- a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m +++ b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m @@ -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) @@ -314,12 +314,12 @@ - (void)handleContentCardsUpdated:(NSNotification *)notification { - (NSArray *)getMappedContentCards { NSArray *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; } @@ -327,11 +327,11 @@ - (nullable ABKContentCard *)getContentCardById:(NSString *)idString { NSArray *cards = [[Appboy sharedInstance].contentCardsController getContentCards]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"idString == %@", idString]; NSArray *filteredArray = [cards filteredArrayUsingPredicate:predicate]; - + if ([filteredArray count]) { return filteredArray[0]; } - + return nil; } @@ -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); @@ -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; @@ -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); @@ -426,7 +426,7 @@ - (void) getInAppMessageFromString:(NSString *)inAppMessageJSONString withInAppM formattedContentCardData[@"domain"] = RCTNullIfNil(classicCard.domain); formattedContentCardData[@"type"] = @"Classic"; } - + return formattedContentCardData; } diff --git a/index.js b/index.js index 444a4df..4f68366 100644 --- a/index.js +++ b/index.js @@ -108,7 +108,7 @@ var ReactAppboy = { */ changeUser: function(userId) { AppboyReactBridge.setSDKFlavor(); - AppboyReactBridge.changeUser(userId); + AppboyReactBridge.changeUser(userId, null); }, /** diff --git a/package.json b/package.json index dfd21d0..7660482 100644 --- a/package.json +++ b/package.json @@ -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",