Skip to content

Commit

Permalink
chore: add local notifications testing support
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNerdGuyLulu committed Apr 12, 2024
1 parent 147fec3 commit 40486c0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
17 changes: 16 additions & 1 deletion sandboxes/NotificationsSandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ yarn rename -b "my.identifier" # Set bundle ID and package name for iOS and A

# or

yarn rename --iosBundleID "my.ios.bundle.id" # Set iOS Bundle ID
yarn rename --iosBundleID "my.ios.bundle.id" # Set iOS Bundle ID
yarn rename --androidBundleID "my.android.package.name" # Set Android PackageName
```

Expand Down Expand Up @@ -110,3 +110,18 @@ npm run ios
# OR using Yarn
yarn ios
```


# Local notifications testing

>**Note**: We can use this method to test if notifications are working locally (e.g. debugging issue with notification permissions).
## Option 1: Drag payload.apns to the running simulator.

Modify the bundle ID inside `payload.apns` to match yours.


## Option 2: Terminal
```bash
xcrun simctl push booted my.bundle.id payload.json
```
9 changes: 0 additions & 9 deletions sandboxes/NotificationsSandbox/notification.apns

This file was deleted.

9 changes: 9 additions & 0 deletions sandboxes/NotificationsSandbox/payload.apns
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Simulator Target Bundle": "replace.with.your.bundle.id",
"aps": {
"alert": {
"title": "Testing push notifications",
"body": "Local notifications are working"
}
}
}
8 changes: 8 additions & 0 deletions sandboxes/NotificationsSandbox/payload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"aps": {
"alert": {
"title": "Testing push notifications",
"body": "Local notifications are working"
}
}
}

0 comments on commit 40486c0

Please sign in to comment.