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 89417a0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 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
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"Simulator Target Bundle": "io.intercom.ios.enterprise.sample",
"aps": {
"alert": {
"title": "Transfer Update",
"body": "Your Transfer has been downloaded"
"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 89417a0

Please sign in to comment.