From 3d68180e912e10c60c92658d201628e7c1ee7872 Mon Sep 17 00:00:00 2001 From: wesleyorbin Date: Fri, 5 Mar 2021 14:34:50 -0500 Subject: [PATCH] Release version 1.27.0 --- AppboyProject/AppboyProject.js | 2 + .../AppboyProject.xcodeproj/project.pbxproj | 4 +- AppboyProject/ios/AppboyProject/AppDelegate.m | 11 ++---- AppboyProject/ios/AppboyProject/Info.plist | 4 ++ AppboyProject/ios/Podfile | 2 +- AppboyProject/ios/Podfile.lock | 39 +++++++++---------- CHANGELOG.md | 12 ++++++ android/build.gradle | 2 +- .../AppboyReactBridge/AppboyReactBridge.m | 2 +- .../AppboyReactBridge/AppboyReactUtils.h | 1 + .../AppboyReactBridge/AppboyReactUtils.m | 19 +++++++++ package.json | 2 +- react-native-appboy-sdk.podspec | 2 +- 13 files changed, 68 insertions(+), 34 deletions(-) diff --git a/AppboyProject/AppboyProject.js b/AppboyProject/AppboyProject.js index 88f5cc6..0ea20dc 100644 --- a/AppboyProject/AppboyProject.js +++ b/AppboyProject/AppboyProject.js @@ -68,6 +68,7 @@ class AppboyProject extends Component { Linking.getInitialURL().then((url) => { if (url) { console.log('Linking.getInitialURL is ' + url); + this._showToast('Linking.getInitialURL is ' + url); this._handleOpenUrl({url}); } }).catch(err => console.error('Error getting initial URL', err)); @@ -80,6 +81,7 @@ class AppboyProject extends Component { ReactAppboy.getInitialURL(function(url) { if (url) { console.log('ReactAppboy.getInitialURL is ' + url); + that._showToast('ReactAppboy.getInitialURL is ' + url); that._handleOpenUrl({url}); } }); diff --git a/AppboyProject/ios/AppboyProject.xcodeproj/project.pbxproj b/AppboyProject/ios/AppboyProject.xcodeproj/project.pbxproj index 015856a..8d2e955 100644 --- a/AppboyProject/ios/AppboyProject.xcodeproj/project.pbxproj +++ b/AppboyProject/ios/AppboyProject.xcodeproj/project.pbxproj @@ -543,7 +543,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AppboyProject/AppboyProject.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer: Appboy Appboy (QWFN3H2ZPW)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Appboy Appboy (QWFN3H2ZPW)"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; @@ -566,7 +566,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.appboy.helloreact; PRODUCT_NAME = AppboyProject; PROVISIONING_PROFILE = "45b1f7df-eef1-458b-8139-7ff580e8e80b"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.appboy.helloreact"; + PROVISIONING_PROFILE_SPECIFIER = "match Development com.appboy.helloreact"; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; diff --git a/AppboyProject/ios/AppboyProject/AppDelegate.m b/AppboyProject/ios/AppboyProject/AppDelegate.m index afbcd45..7d53a37 100644 --- a/AppboyProject/ios/AppboyProject/AppDelegate.m +++ b/AppboyProject/ios/AppboyProject/AppDelegate.m @@ -5,6 +5,7 @@ #import #import #import "AppboyKit.h" +#import "ABKPushUtils.h" #import "AppboyReactUtils.h" @implementation AppDelegate @@ -44,16 +45,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSLog(@"Permission granted."); [[Appboy sharedInstance] pushAuthorizationFromUserNotificationCenter:granted]; }]; + [center setNotificationCategories:[ABKPushUtils getAppboyUNNotificationCategorySet]]; [[UIApplication sharedApplication] registerForRemoteNotifications]; - } else if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) { + } else { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeAlert | UIUserNotificationTypeSound) categories:nil]; [[UIApplication sharedApplication] registerForRemoteNotifications]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; - } else { - [[UIApplication sharedApplication] registerForRemoteNotificationTypes: - (UIRemoteNotificationTypeAlert | - UIRemoteNotificationTypeBadge | - UIRemoteNotificationTypeSound)]; } [[AppboyReactUtils sharedInstance] populateInitialUrlFromLaunchOptions:launchOptions]; @@ -69,6 +66,7 @@ - (void) application:(UIApplication *)application didReceiveRemoteNotification:( } - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { + [[AppboyReactUtils sharedInstance] populateInitialUrlForCategories:response.notification.request.content.userInfo]; [[Appboy sharedInstance] userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler]; } @@ -80,7 +78,6 @@ - (void) application:(UIApplication *)application didRegisterForRemoteNotificati [[Appboy sharedInstance] registerDeviceToken:deviceToken]; } - // Deep linking - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation diff --git a/AppboyProject/ios/AppboyProject/Info.plist b/AppboyProject/ios/AppboyProject/Info.plist index b9aa4f7..e0cbe6c 100644 --- a/AppboyProject/ios/AppboyProject/Info.plist +++ b/AppboyProject/ios/AppboyProject/Info.plist @@ -2,6 +2,10 @@ + LSApplicationCategoryType + + CFBundleDisplayName + Appboy LogLevel diff --git a/AppboyProject/ios/Podfile b/AppboyProject/ios/Podfile index 36853ab..2404b87 100644 --- a/AppboyProject/ios/Podfile +++ b/AppboyProject/ios/Podfile @@ -2,7 +2,7 @@ platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'AppboyProject' do - pod 'Appboy-iOS-SDK', '3.31.2' + pod 'Appboy-iOS-SDK', '3.33.1' # If you want to integrate through Cocoapods instead of manual linking use this: # It already comes with a dependency on `Appboy-iOS-SDK` so you're all set. Remember to diff --git a/AppboyProject/ios/Podfile.lock b/AppboyProject/ios/Podfile.lock index 1f8f47d..fc9b764 100644 --- a/AppboyProject/ios/Podfile.lock +++ b/AppboyProject/ios/Podfile.lock @@ -1,17 +1,17 @@ PODS: - - Appboy-iOS-SDK (3.31.2): - - Appboy-iOS-SDK/UI (= 3.31.2) - - Appboy-iOS-SDK/ContentCards (3.31.2): + - Appboy-iOS-SDK (3.33.1): + - Appboy-iOS-SDK/UI (= 3.33.1) + - Appboy-iOS-SDK/ContentCards (3.33.1): - Appboy-iOS-SDK/Core - SDWebImage (< 6, >= 5.8.2) - - Appboy-iOS-SDK/Core (3.31.2) - - Appboy-iOS-SDK/InAppMessage (3.31.2): + - Appboy-iOS-SDK/Core (3.33.1) + - Appboy-iOS-SDK/InAppMessage (3.33.1): - Appboy-iOS-SDK/Core - SDWebImage (< 6, >= 5.8.2) - - Appboy-iOS-SDK/NewsFeed (3.31.2): + - Appboy-iOS-SDK/NewsFeed (3.33.1): - Appboy-iOS-SDK/Core - SDWebImage (< 6, >= 5.8.2) - - Appboy-iOS-SDK/UI (3.31.2): + - Appboy-iOS-SDK/UI (3.33.1): - Appboy-iOS-SDK/ContentCards - Appboy-iOS-SDK/Core - Appboy-iOS-SDK/InAppMessage @@ -199,8 +199,8 @@ PODS: - React-cxxreact (= 0.61.5) - React-jsi (= 0.61.5) - React-jsinspector (0.61.5) - - react-native-appboy-sdk (1.26.0): - - Appboy-iOS-SDK (~> 3.31.2) + - react-native-appboy-sdk (1.27.0): + - Appboy-iOS-SDK (~> 3.33.1) - React - React-RCTActionSheet (0.61.5): - React-Core/RCTActionSheetHeaders (= 0.61.5) @@ -237,13 +237,13 @@ PODS: - React-cxxreact (= 0.61.5) - React-jsi (= 0.61.5) - ReactCommon/jscallinvoker (= 0.61.5) - - SDWebImage (5.10.2): - - SDWebImage/Core (= 5.10.2) - - SDWebImage/Core (5.10.2) + - SDWebImage (5.10.4): + - SDWebImage/Core (= 5.10.4) + - SDWebImage/Core (5.10.4) - Yoga (1.14.0) DEPENDENCIES: - - Appboy-iOS-SDK (= 3.31.2) + - Appboy-iOS-SDK (= 3.33.1) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) @@ -275,10 +275,9 @@ DEPENDENCIES: - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: - https://github.com/CocoaPods/Specs.git: - - boost-for-react-native trunk: - Appboy-iOS-SDK + - boost-for-react-native - SDWebImage EXTERNAL SOURCES: @@ -336,7 +335,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - Appboy-iOS-SDK: a3d61b2dc0a56100f1c10064c1832dfa6c0798fd + Appboy-iOS-SDK: 60abd3c23bcd5c24a624ddaf3adaf166b835a0e0 boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f @@ -352,7 +351,7 @@ SPEC CHECKSUMS: React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7 React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386 React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0 - react-native-appboy-sdk: d4bc0faed0c9b25b1cd1a57a4e8974758d5ded4f + react-native-appboy-sdk: db622f8a6e05758c84c0e213852c3c28ab7a8803 React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76 React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360 React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72 @@ -363,9 +362,9 @@ SPEC CHECKSUMS: React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd - SDWebImage: b969dcfc02c40a5da71eac0b03b8f1a0c794a86f + SDWebImage: c666b97e1fa9c64b4909816a903322018f0a9c84 Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b -PODFILE CHECKSUM: 2ea1c608094ca868863fd7ce9d8f081e07e4fedc +PODFILE CHECKSUM: cb3887f416b92558735fefae86948126a5af2d3e -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ac34db..0d21772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 1.27.0 + +##### ⚠ Breaking +- Updated the native iOS bridge to [Braze iOS SDK 3.33.1](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#3331). +- Updated the native Android bridge to [Braze Android SDK 13.0.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#1300). + +##### Added +- Added support for receiving iOS push action button deep links in `ReactAppboy.getInitialURL()`. If you are using `ReactAppboy.getInitialURL()` and implement iOS push action button categories, add the following code to the beginning of your `userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:`: + ``` + [[AppboyReactUtils sharedInstance] populateInitialUrlForCategories:response.notification.request.content.userInfo]; + ``` + ## 1.26.0 ##### ⚠ Breaking diff --git a/android/build.gradle b/android/build.gradle index a75a80b..afda499 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -17,6 +17,6 @@ android { } dependencies { - api 'com.appboy:android-sdk-ui:12.0.0' + api 'com.appboy:android-sdk-ui:13.0.0' api 'com.facebook.react:react-native:+' } diff --git a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m index 15af1ae..5f6d159 100644 --- a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m +++ b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactBridge.m @@ -69,7 +69,7 @@ - (void)reportResultWithCallback:(RCTResponseSenderBlock)callback andError:(NSSt [Appboy sharedInstance].sdkFlavor = REACT; } -// Returns the deep link from the push dictionary in application:didFinishLaunchingWithOptions: launchOptions, if one exists +// Returns push deep links from cold app starts. // For more context see getInitialURL() in index.js RCT_EXPORT_METHOD(getInitialUrl:(RCTResponseSenderBlock)callback) { if ([AppboyReactUtils sharedInstance].initialUrlString != nil) { diff --git a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.h b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.h index 05b99db..f7755e6 100644 --- a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.h +++ b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.h @@ -5,6 +5,7 @@ + (AppboyReactUtils *)sharedInstance; - (BOOL)populateInitialUrlFromLaunchOptions:(NSDictionary *)launchOptions; +- (BOOL)populateInitialUrlForCategories:(NSDictionary *)userInfo; @property NSString *initialUrlString; diff --git a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.m b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.m index f19730f..28145f5 100644 --- a/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.m +++ b/iOS/AppboyReactBridge/AppboyReactBridge/AppboyReactUtils.m @@ -30,4 +30,23 @@ - (BOOL)populateInitialUrlFromLaunchOptions:(NSDictionary *)launchOptions { return false; } +- (BOOL)populateInitialUrlForCategories:(NSDictionary *)userInfo { + // When action buttons are opened, didFinishLaunchingWithOptions's launchOptions are always nil. + if (sharedInstance.initialUrlString) { + NSLog(@"initialUrlString already populated in didFinishLaunchingWithOptions. Doing nothing."); + return false; + } + NSDictionary *categories = [userInfo valueForKeyPath:@"ab.ab_cat"]; + if (categories && [categories count] > 0) { + NSDictionary *category = [[categories allValues] objectAtIndex:0]; + if (category[@"a_uri"]) { + sharedInstance.initialUrlString = category[@"a_uri"]; + RCTLogInfo(@"[AppboyReactUtils sharedInstance].initialUrlString set to %@.", sharedInstance.initialUrlString); + return true; + } + } + sharedInstance.initialUrlString = nil; + return false; +} + @end diff --git a/package.json b/package.json index e969355..53a3327 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-appboy-sdk", - "version": "1.26.0", + "version": "1.27.0", "description": "Braze SDK for React Native.", "main": "index.js", "types": "index.d.ts", diff --git a/react-native-appboy-sdk.podspec b/react-native-appboy-sdk.podspec index 98d6cda..f69a775 100644 --- a/react-native-appboy-sdk.podspec +++ b/react-native-appboy-sdk.podspec @@ -18,6 +18,6 @@ Pod::Spec.new do |s| s.preserve_paths = 'LICENSE.md', 'README.md', 'package.json', 'index.js' s.source_files = 'iOS/**/*.{h,m}' - s.dependency 'Appboy-iOS-SDK', '~> 3.31.2' + s.dependency 'Appboy-iOS-SDK', '~> 3.33.1' s.dependency 'React' end