Skip to content

Commit eb07838

Browse files
onesignal-deploygithub-actions[bot]fadi-georgecursoragent
authored
chore: Release 5.4.7 (#1950)
Co-authored-by: github-actions[bot] <noreply@onesignal.com> Co-authored-by: Fadi George <fadii925@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a6f5146 commit eb07838

12 files changed

Lines changed: 39 additions & 145 deletions

File tree

.github/workflows/create-release-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
cd examples/demo
199199
vp run setup
200200
cd ios
201-
pod install
201+
pod update OneSignalXCFramework
202202
)
203203
echo "✓ Refreshed examples/demo/ios/Podfile.lock"
204204

android/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,13 @@ android {
2727
dependencies {
2828
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
2929

30-
// androidx.startup runs our OneSignalInitializer during Application.onCreate so we can register
31-
// an ActivityLifecycleCallbacks before MainActivity.onResume fires. This avoids the cold-start
32-
// race where ReactApplicationContext.getCurrentActivity() returns null and the OneSignal SDK
33-
// ends up holding an ApplicationContext instead of the real Activity.
34-
implementation 'androidx.startup:startup-runtime:1.1.1'
35-
3630
// api is used instead of implementation so the parent :app project can access any of the OneSignal Java
3731
// classes if needed. Such as com.onesignal.NotificationExtenderService
3832
//
3933
// Exclude OkHttp from OneSignal's transitive deps: the otel module pulls in OkHttp 5.x
4034
// (via opentelemetry-exporter-sender-okhttp) which is binary-incompatible with React Native's
4135
// networking stack (okhttp3.internal.Util removed in 5.x). React Native already provides OkHttp 4.x.
42-
api('com.onesignal:OneSignal:5.9.2') {
36+
api('com.onesignal:OneSignal:5.9.3') {
4337
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
4438
}
4539

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools">
3-
<application>
4-
<provider
5-
android:name="androidx.startup.InitializationProvider"
6-
android:authorities="${applicationId}.androidx-startup"
7-
android:exported="false"
8-
tools:node="merge">
9-
<meta-data
10-
android:name="com.onesignal.rnonesignalandroid.OneSignalInitializer"
11-
android:value="androidx.startup" />
12-
</provider>
13-
</application>
14-
</manifest>
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

android/src/main/java/com/onesignal/rnonesignalandroid/ActivityLifecycleTracker.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

android/src/main/java/com/onesignal/rnonesignalandroid/OneSignalInitializer.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,23 +230,15 @@ public void invalidate() {
230230
@Override
231231
public void initialize(String appId) {
232232
OneSignalWrapper.setSdkType("reactnative");
233-
OneSignalWrapper.setSdkVersion("050406");
233+
OneSignalWrapper.setSdkVersion("050407");
234234

235235
if (oneSignalInitDone) {
236236
Logging.debug("Already initialized the OneSignal React-Native SDK", null);
237237
return;
238238
}
239239

240240
ReactApplicationContext reactContext = getReactApplicationContext();
241-
// Prefer the Activity captured by ActivityLifecycleTracker (registered via androidx.startup
242-
// before MainActivity.onResume), then fall back to ReactApplicationContext's accessor and
243-
// finally the ApplicationContext. Passing the real Activity lets the OneSignal SDK populate
244-
// ApplicationService.current immediately, so requestPermission() can launch the OS dialog
245-
// on the first cold-start instead of waiting for the next foreground event.
246-
Context context = ActivityLifecycleTracker.getInstance().getCurrentActivity();
247-
if (context == null) {
248-
context = reactContext.getCurrentActivity();
249-
}
241+
Context context = reactContext.getCurrentActivity();
250242
if (context == null) {
251243
context = reactContext.getApplicationContext();
252244
}

examples/demo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Environment
22
.env
3+
.rn-demo-env.stamp
34

45
# OSX
56
#

examples/demo/bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/setup.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set -euo pipefail
77
ORIGINAL_DIR=$(pwd)
88
SDK_ROOT="$(cd ../../ && pwd)"
99
STAMP_FILE="$SDK_ROOT/.rn-sdk-source.stamp"
10+
DEMO_ENV_STAMP_FILE="$ORIGINAL_DIR/.rn-demo-env.stamp"
1011
TGZ_FILE="$SDK_ROOT/react-native-onesignal.tgz"
1112
INSTALLED_DIR="$ORIGINAL_DIR/node_modules/react-native-onesignal"
1213

@@ -24,6 +25,34 @@ src_hash=$(find "$SDK_ROOT/src" "$SDK_ROOT/ios" "$SDK_ROOT/android" \
2425
| shasum \
2526
| awk '{print $1}')
2627

28+
demo_env_hash=$(
29+
{
30+
for file in "$ORIGINAL_DIR/.env" "$ORIGINAL_DIR/babel.config.js"; do
31+
if [ -f "$file" ]; then
32+
shasum "$file"
33+
else
34+
echo "missing $file"
35+
fi
36+
done
37+
} | shasum | awk '{print $1}'
38+
)
39+
40+
if [ ! -f "$DEMO_ENV_STAMP_FILE" ] || [ "$(cat "$DEMO_ENV_STAMP_FILE")" != "$demo_env_hash" ]; then
41+
echo "Demo env inputs changed, clearing Metro cache..."
42+
rm -rf "${TMPDIR:-/tmp}"/metro-* "${TMPDIR:-/tmp}"/haste-map-* "$ORIGINAL_DIR/node_modules/.cache/metro" 2>/dev/null || true
43+
metro_pids=$(lsof -ti tcp:8081 2>/dev/null || true)
44+
for pid in $metro_pids; do
45+
args=$(ps -p "$pid" -o args= 2>/dev/null || true)
46+
case "$args" in
47+
*react-native*|*metro*)
48+
echo "Stopping Metro so @env values are reloaded..."
49+
kill "$pid" 2>/dev/null || true
50+
;;
51+
esac
52+
done
53+
echo "$demo_env_hash" > "$DEMO_ENV_STAMP_FILE"
54+
fi
55+
2756
# Skip the whole rebuild when:
2857
# - the demo already has the SDK installed,
2958
# - the cached tarball is still on disk, and

ios/RCTOneSignal/RCTOneSignal.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ - (void)initOneSignal:(NSDictionary *)launchOptions {
2323
return;
2424

2525
OneSignalWrapper.sdkType = @"reactnative";
26-
OneSignalWrapper.sdkVersion = @"050406";
26+
OneSignalWrapper.sdkVersion = @"050407";
2727
// initialize the SDK with a nil app ID so cold start click listeners can be
2828
// triggered
2929
[OneSignal initialize:nil withLaunchOptions:launchOptions];

0 commit comments

Comments
 (0)