Skip to content

Commit

Permalink
Release version 12.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jerielng committed Sep 16, 2024
1 parent 8c42a02 commit c2f1470
Show file tree
Hide file tree
Showing 23 changed files with 1,557 additions and 843 deletions.
7 changes: 3 additions & 4 deletions BrazeProject/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby File.read(File.join(__dir__, '.ruby-version')).strip

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with the next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
6 changes: 3 additions & 3 deletions BrazeProject/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ GEM
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.3.3)
rexml (3.3.6)
strscan
ruby-macho (2.5.1)
strscan (3.1.0)
Expand All @@ -91,8 +91,8 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
cocoapods (>= 1.13, < 1.15)
activesupport (>= 6.1.7.5, != 7.1.0)
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)

RUBY VERSION
ruby 3.3.0p0
Expand Down
8 changes: 5 additions & 3 deletions BrazeProject/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
import ReactTestRenderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
it('renders correctly', async () => {
await ReactTestRenderer.act(() => {
ReactTestRenderer.create(<App />);
});
});
21 changes: 11 additions & 10 deletions BrazeProject/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import com.android.build.OutputFile
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down Expand Up @@ -51,6 +51,9 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand Down Expand Up @@ -141,5 +144,3 @@ dependencies {
}

apply plugin: 'com.google.gms.google-services'

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
3 changes: 2 additions & 1 deletion BrazeProject/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
android:icon="@mipmap/ic_launcher"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:supportsRtl="true">
<service android:name="com.braze.push.BrazeFirebaseMessagingService"
android:exported="false">
<intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion BrazeProject/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
kotlinVersion = "1.9.24"
}
repositories {
google()
Expand Down
4 changes: 2 additions & 2 deletions BrazeProject/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=false

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down Expand Up @@ -51,3 +49,5 @@ org.gradle.parallel=true
# Enables new incubating mode that makes Gradle selective when configuring projects.
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand
org.gradle.configureondemand=true

importBrazeLocationLibrary=false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion BrazeProject/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
4 changes: 3 additions & 1 deletion BrazeProject/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'BrazeProject'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
9 changes: 8 additions & 1 deletion BrazeProject/ios/BrazeProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
D49243504D0CC62449E7A753 /* libPods-BrazeProject-BrazeProjectTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6966516151504FECB8343E39 /* libPods-BrazeProject-BrazeProjectTests.a */; };
D971B4B9DCDC97E7B7B30086 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0850B22E719905EB0709C451 /* PrivacyInfo.xcprivacy */; };
EC8E1B432C93543400F4A255 /* BrazeReactGIFHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = EC8E1B422C93543400F4A255 /* BrazeReactGIFHelper.m */; };
EC9B91F32B1F698600C6BD5D /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9B91F22B1F698600C6BD5D /* NotificationService.swift */; };
EC9B91F72B1F698600C6BD5D /* BrazeProjectRichPush.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = EC9B91F02B1F698500C6BD5D /* BrazeProjectRichPush.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
EC9B92012B1F6B0C00C6BD5D /* BrazeNotificationService.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC9B92002B1F6B0C00C6BD5D /* BrazeNotificationService.xcframework */; };
Expand Down Expand Up @@ -73,7 +74,7 @@
00E356EE1AD99517003FC87E /* BrazeProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BrazeProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* BrazeProjectTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BrazeProjectTests.m; sourceTree = "<group>"; };
0850B22E719905EB0709C451 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = BrazeProject/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
0850B22E719905EB0709C451 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = BrazeProject/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* BrazeProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BrazeProject.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = BrazeProject/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = BrazeProject/AppDelegate.mm; sourceTree = "<group>"; };
Expand All @@ -93,6 +94,8 @@
C0056B0412B5353A45812729 /* Pods-BrazeProjectRichPush.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BrazeProjectRichPush.debug.xcconfig"; path = "Target Support Files/Pods-BrazeProjectRichPush/Pods-BrazeProjectRichPush.debug.xcconfig"; sourceTree = "<group>"; };
CCCAA9B93114DFE83F9097D0 /* libPods-BrazeProjectPushStory.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BrazeProjectPushStory.a"; sourceTree = BUILT_PRODUCTS_DIR; };
E5BE52AA7479C52FDF496B15 /* Pods-BrazeProjectRichPush.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BrazeProjectRichPush.release.xcconfig"; path = "Target Support Files/Pods-BrazeProjectRichPush/Pods-BrazeProjectRichPush.release.xcconfig"; sourceTree = "<group>"; };
EC8E1B412C93542A00F4A255 /* BrazeReactGIFHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BrazeReactGIFHelper.h; sourceTree = "<group>"; };
EC8E1B422C93543400F4A255 /* BrazeReactGIFHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BrazeReactGIFHelper.m; sourceTree = "<group>"; };
EC9B91F02B1F698500C6BD5D /* BrazeProjectRichPush.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = BrazeProjectRichPush.appex; sourceTree = BUILT_PRODUCTS_DIR; };
EC9B91F22B1F698600C6BD5D /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
EC9B91F42B1F698600C6BD5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -177,6 +180,8 @@
ECE697AC2A3CBE680060A95D /* BrazeProject.entitlements */,
ECE697AD2A3CC0000060A95D /* BrazeReactDelegate.h */,
ECE697AF2A3CC00B0060A95D /* BrazeReactDelegate.m */,
EC8E1B412C93542A00F4A255 /* BrazeReactGIFHelper.h */,
EC8E1B422C93543400F4A255 /* BrazeReactGIFHelper.m */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -663,6 +668,7 @@
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
ECE697B02A3CC00B0060A95D /* BrazeReactDelegate.m in Sources */,
EC8E1B432C93543400F4A255 /* BrazeReactGIFHelper.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -893,6 +899,7 @@
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
USE_HERMES = true;
};
name = Debug;
Expand Down
5 changes: 5 additions & 0 deletions BrazeProject/ios/BrazeProject/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "BrazeReactDelegate.h"

#import <BrazeKit/BrazeKit-Swift.h>
#import "BrazeReactGIFHelper.h"

@implementation AppDelegate

Expand Down Expand Up @@ -46,6 +47,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
Braze *braze = [BrazeReactBridge initBraze:configuration];
braze.delegate = [[BrazeReactDelegate alloc] init];
AppDelegate.braze = braze;

// Use SDWebImage as the GIF provider.
// GIFs are non-animating by default until overridden with a provider.
[BrazeReactGIFHelper setGIFProvider];

if (!pushAutoEnabled) {
// If the user explicitly disables Push Auto, register for push manually
Expand Down
8 changes: 8 additions & 0 deletions BrazeProject/ios/BrazeReactGIFHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#import <Foundation/Foundation.h>

// Braze InAppMessage GIF Support
@interface BrazeReactGIFHelper : NSObject

+ (void)setGIFProvider;

@end
41 changes: 41 additions & 0 deletions BrazeProject/ios/BrazeReactGIFHelper.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#import "BrazeReactGIFHelper.h"
#import <SDWebImage/SDAnimatedImage.h>
#import <SDWebImage/SDAnimatedImageView.h>

@import BrazeUI;

// Braze InAppMessage GIF Support
@implementation BrazeReactGIFHelper

+ (void)setGIFProvider {
BRZGIFViewProvider.shared = [BrazeReactGIFHelper sdWebImage];
}

+ (BRZGIFViewProvider *)sdWebImage {
return [BRZGIFViewProvider
providerWithView:^UIView *_Nonnull(NSURL *_Nullable url) {
UIImage *image = [BrazeReactGIFHelper imageForURL:url];
SDAnimatedImageView *view =
[[SDAnimatedImageView alloc] initWithImage:image];
return view;
}
updateView:^(UIView *_Nonnull view, NSURL *_Nullable url) {
if ([view isKindOfClass:[SDAnimatedImageView class]]) {
((SDAnimatedImageView *)(view)).image =
[BrazeReactGIFHelper imageForURL:url];
}
}];
}

+ (UIImage *)imageForURL:(NSURL *)url {
if (url == nil) {
return nil;
}
if ([url.pathExtension isEqualToString:@"gif"]) {
return [SDAnimatedImage imageWithContentsOfFile:url.path];
} else {
return [UIImage imageWithContentsOfFile:url.path];
}
}

@end
6 changes: 4 additions & 2 deletions BrazeProject/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ target 'BrazeProject' do
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)

pod 'SDWebImage'

target 'BrazeProjectTests' do
inherit! :complete
Expand Down Expand Up @@ -45,9 +47,9 @@ target 'BrazeProject' do
end

target 'BrazeProjectRichPush' do
pod 'BrazeNotificationService', '~> 10.1.0'
pod 'BrazeNotificationService', '~> 10.3.0'
end

target 'BrazeProjectPushStory' do
pod 'BrazePushStory', '~> 10.1.0'
pod 'BrazePushStory', '~> 10.3.0'
end
Loading

0 comments on commit c2f1470

Please sign in to comment.