Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ yarn-error.log
# jest
coverage/

# tsc
# tsc / build
#
dist
android/build
*.tgz

# OSX
#
Expand Down
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions bun.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lockfileVersion": 1,
"configVersion": 0,
"workspaces": {
"": {
"name": "react-native-onesignal",
Expand Down
23 changes: 6 additions & 17 deletions examples/RNOneSignalTS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped

> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.

Also make sure to run the link command in root:
`bun link`
Run `bun run setup` to package the bundle and use it for the example.

## Step 1: Start Metro

Expand All @@ -23,32 +22,22 @@ With Metro running, open a new terminal window/pane from the root of your React

### Android

Run:

```sh
bun run android
```

### iOS

For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).

The first time you create a new project, run the Ruby bundler to install CocoaPods itself:

```sh
bundle install
```

Then, and every time you update your native dependencies, run:

```sh
bundle exec pod install
```

For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
Run:

```sh
bun run ios
```

If you get an error, you may need to have the simulator be open/running first.

If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.

This is one way to run your app — you can also build it directly from Android Studio or Xcode.
Expand Down
5 changes: 3 additions & 2 deletions examples/RNOneSignalTS/bun.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"lockfileVersion": 1,
"configVersion": 0,
"workspaces": {
"": {
"name": "RNOneSignalTS",
"dependencies": {
"@react-native/new-app-screen": "0.81.4",
"react": "19.1.0",
"react-native": "0.81.4",
"react-native-onesignal": "link:react-native-onesignal",
"react-native-onesignal": "file:../../react-native-onesignal.tgz",
"react-native-safe-area-context": "^5.5.2",
},
"devDependencies": {
Expand Down Expand Up @@ -895,7 +896,7 @@

"react-native": ["[email protected]", "", { "dependencies": { "@jest/create-cache-key-function": "^29.7.0", "@react-native/assets-registry": "0.81.4", "@react-native/codegen": "0.81.4", "@react-native/community-cli-plugin": "0.81.4", "@react-native/gradle-plugin": "0.81.4", "@react-native/js-polyfills": "0.81.4", "@react-native/normalize-colors": "0.81.4", "@react-native/virtualized-lists": "0.81.4", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", "babel-jest": "^29.7.0", "babel-plugin-syntax-hermes-parser": "0.29.1", "base64-js": "^1.5.1", "commander": "^12.0.0", "flow-enums-runtime": "^0.0.6", "glob": "^7.1.1", "invariant": "^2.2.4", "jest-environment-node": "^29.7.0", "memoize-one": "^5.0.0", "metro-runtime": "^0.83.1", "metro-source-map": "^0.83.1", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", "react-devtools-core": "^6.1.5", "react-refresh": "^0.14.0", "regenerator-runtime": "^0.13.2", "scheduler": "0.26.0", "semver": "^7.1.3", "stacktrace-parser": "^0.1.10", "whatwg-fetch": "^3.0.0", "ws": "^6.2.3", "yargs": "^17.6.2" }, "peerDependencies": { "@types/react": "^19.1.0", "react": "^19.1.0" }, "optionalPeers": ["@types/react"], "bin": { "react-native": "cli.js" } }, "sha512-bt5bz3A/+Cv46KcjV0VQa+fo7MKxs17RCcpzjftINlen4ZDUl0I6Ut+brQ2FToa5oD0IB0xvQHfmsg2EDqsZdQ=="],

"react-native-onesignal": ["react-native-onesignal@link:react-native-onesignal", {}],
"react-native-onesignal": ["react-native-onesignal@../../react-native-onesignal.tgz", { "dependencies": { "invariant": "^2.2.4" } }],

"react-native-safe-area-context": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-4XGqMNj5qjUTYywJqpdWZ9IG8jgkS3h06sfVjfw5yZQZfWnRFXczi0GnYyFyCc2EBps/qFmoCH8fez//WumdVg=="],

Expand Down
2 changes: 1 addition & 1 deletion examples/RNOneSignalTS/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2665,7 +2665,7 @@ SPEC CHECKSUMS:
React-logger: a3cb5b29c32b8e447b5a96919340e89334062b48
React-Mapbuffer: 9d2434a42701d6144ca18f0ca1c4507808ca7696
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
react-native-onesignal: b68c981956150f288c1585889871affcef3c0b8b
react-native-onesignal: 6c5758aa56975db4bca9956d18d83dd62444c931
react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d
Expand Down
5 changes: 4 additions & 1 deletion examples/RNOneSignalTS/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.1",
"private": true,
"scripts": {
"setup": "./setup.sh",
"preandroid": "bun run setup",
"preios": "bun run setup",
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start"
Expand All @@ -11,7 +14,7 @@
"@react-native/new-app-screen": "0.81.4",
"react": "19.1.0",
"react-native": "0.81.4",
"react-native-onesignal": "link:react-native-onesignal",
"react-native-onesignal": "file:../../react-native-onesignal.tgz",
"react-native-safe-area-context": "^5.5.2"
},
"devDependencies": {
Expand Down
21 changes: 21 additions & 0 deletions examples/RNOneSignalTS/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ORIGINAL_DIR=$(pwd)

# Build root package
cd ../../
bun run build

rm -f react-native-onesignal.tgz
bun pm pack
mv react-native-onesignal-*.tgz react-native-onesignal.tgz

# Use fresh install of the package
cd $ORIGINAL_DIR
rm -rf node_modules/react-native-onesignal
bun i

# Reinstall pods to pick up the updated native module
if [ -d "ios" ]; then
cd ios
pod install
cd ..
fi
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"name": "react-native-onesignal",
"version": "5.2.14",
"description": "React Native OneSignal SDK",
"files": [
"dist",
"android",
"ios",
"react-native-onesignal.podspec"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
Expand Down
Loading