Skip to content

Commit

Permalink
Release/2.4.0 (#9)
Browse files Browse the repository at this point in the history
* 📦 Upgrade to RN 0.73.2

* Example | 📦 Upgrade to RN 0.73.2

* EsLint

* Version Bump - 2.3.1

* Implement iOS Notification Extension - WIP

* update NotificationServiceExtension functionality

* NE - WIP

* 🍏 Implementation for NotificationService

* Allow options at initializing for both platforms

* Example | Update example to use iOS Notification Extension

* 🍏 Use pod GoogleUtilities early

* 🍏 Use Ometria 1.5.1

* Update Library to use Ometria 1.5.1 iOS

* Example | Update Example to Use Ometria iOS 1.5.1 - Handle notifications

* Bump verion to 2.4.0

* Android | Add the possibility to use local aar in release mode

* Library | Cleanup & mark deprecation methods

* Example App | Change the methods

* Android | Use 1.6.2

* Example | Version bump - 2.4.0

* Update Readme

* Update Readme

* Update Readme broken link

* 📄 Added some instructions for deprecated methods.

* ⏳ Changelog 2.4.0

* 📄 Readme updates

* Version bump 2.4.0

---------

2024-02

- Updated ReactNative to 0.73.2
- Deprecated `onNotificationInteracted` method. Use `onNotificationOpenedApp` instead for handling notification interaction.
- Deprecated `setBackgroundMessageHandler`Android method. Use the new method `onAndroidBackgroundMessage` to handle background messages on Android.
- Changed `onNotificationOpenedApp` signature to include the remote message object as a parameter for better compatibility with the native SDK.
- Updated Ometria native SDK to the latest versions - 🍏 1.5.1 iOS & 🤖 1.6.2 Android. Both SDK  support quit app state notification handling.


Co-authored-by: Patrascu Vlad <[email protected]>
Co-authored-by: Cata Demian <[email protected]>
  • Loading branch information
3 people authored Feb 22, 2024
1 parent 5c719bc commit 550dfa5
Show file tree
Hide file tree
Showing 59 changed files with 29,568 additions and 43,515 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ android/keystores/debug.keystore

# generated by bob
lib/

# testing
/coverage
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.4.0

2024-02

- Updated ReactNative to 0.73.2
- Deprecated `onNotificationInteracted` method. Use `onNotificationOpenedApp` instead for handling notification interaction.
- Deprecated `setBackgroundMessageHandler`Android method. Use the new method `onAndroidBackgroundMessage` to handle background messages on Android.
- Changed `onNotificationOpenedApp` signature to include the remote message object as a parameter for better compatibility with the native SDK.
- Updated Ometria native SDK to the latest versions - 🍏 1.5.1 iOS & 🤖 1.6.2 Android. Both SDK support quit app state notification handling.

# 2.3.0

2023-11
Expand Down
12 changes: 12 additions & 0 deletions OmetriaReactNativeSdk.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// OmetriaReactNativeSdk.h
// Pods
//
// Created by Vlad on 07.02.2024.
//

#ifndef OmetriaReactNativeSdk_h
#define OmetriaReactNativeSdk_h


#endif /* OmetriaReactNativeSdk_h */
535 changes: 250 additions & 285 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ dependencies {
if (is_production) {
implementation "com.ometria:android-sdk:$ometria_android_sdk_version"
} else {
implementation fileTree(dir: "libs", include: ["*.aar"])
implementation fileTree(dir: "libs", include: ["*.aar"]) // Comment this if you want to use the local AAR in release mode
implementation 'org.chromium.net:cronet-embedded:76.3809.111'
compileOnly files('libs/OmetriaSDK-debug.aar')
debugImplementation files('libs/OmetriaSDK-debug.aar')
debugImplementation files('libs/OmetriaSDK-debug.aar') // Comment this if you want to use the local AAR in release mode
}

api 'com.facebook.react:react-native:+'
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ OmetriaReactNativeSdk_buildToolsVersion=28.0.3
OmetriaReactNativeSdk_targetSdkVersion=28
OmetriaReactNativeSdk_minSdkVersion=23
OmetriaReactNativeSdk_gradleVersion=7.2.2
OmetriaReactNativeSdk_ometriaAndroidSdkVersion=1.6.1
OmetriaReactNativeSdk_ometriaAndroidSdkVersion=1.6.2
OmetriaReactNativeSdk_isProduction=1
31 changes: 23 additions & 8 deletions 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/subprojects/plugins/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 All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand All @@ -205,6 +214,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OmetriaReactNativeSdkModule(private val reactContext: ReactApplicationCont
var deeplinkInteractionPromise: Promise? = null

init {
StorageController(reactContext.applicationContext).saveSdkVersionRN("2.3.0")
StorageController(reactContext.applicationContext).saveSdkVersionRN("2.4.0")
}

override fun getName(): String {
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
};
4 changes: 4 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native',
};
1 change: 1 addition & 0 deletions example/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 3 additions & 2 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'
ruby "2.7.5"

gem 'cocoapods', '>= 1.11.3'
gem 'cocoapods', '~> 1.13'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
68 changes: 12 additions & 56 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"

import com.android.build.OutputFile
/* Added by Ometeria */
apply plugin: "com.google.gms.google-services"

/**
* This is the configuration block to customize your React Native Android app.
Expand All @@ -14,8 +15,8 @@ react {
// 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 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")

Expand Down Expand Up @@ -53,14 +54,6 @@ react {
// hermesFlags = ["-O", "-output-source-map"]
}

/**
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = false

/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
Expand All @@ -79,38 +72,21 @@ def enableProguardInReleaseBuilds = false
*/
def jscFlavor = 'org.webkit:android-jsc:+'

/**
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {
ndkVersion rootProject.ext.ndkVersion

buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.example.ometriareactnativesdk"
defaultConfig {
applicationId "com.example.ometriareactnativesdk"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 22
versionName "2.3.0"
versionCode 25
versionName "2.4.0"
}

splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
Expand All @@ -119,6 +95,7 @@ android {
keyPassword 'android'
}
}

buildTypes {
debug {
signingConfig signingConfigs.debug
Expand All @@ -132,40 +109,19 @@ android {
}
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}

}
}
}

dependencies {
// }
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}")

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
implementation("com.facebook.react:flipper-integration")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}

// Added by Ometeria
// implementation files('../../../android/libs/OmetriaSDK-debug.aar') // Uncomment this line if you are using the local AAR file in release
implementation project(':ometriareactnativesdk')

}
Expand Down
8 changes: 2 additions & 6 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
tools:ignore="GoogleAppIndexingWarning"
/>
</manifest>
Loading

0 comments on commit 550dfa5

Please sign in to comment.