From 40486c0c092b061e9b1074626c44d62474bc4439 Mon Sep 17 00:00:00 2001 From: TheNerdGuyLulu Date: Fri, 12 Apr 2024 17:24:23 +0200 Subject: [PATCH] chore: add local notifications testing support --- sandboxes/NotificationsSandbox/README.md | 17 ++++++++++++++++- .../NotificationsSandbox/notification.apns | 9 --------- sandboxes/NotificationsSandbox/payload.apns | 9 +++++++++ sandboxes/NotificationsSandbox/payload.json | 8 ++++++++ 4 files changed, 33 insertions(+), 10 deletions(-) delete mode 100644 sandboxes/NotificationsSandbox/notification.apns create mode 100644 sandboxes/NotificationsSandbox/payload.apns create mode 100644 sandboxes/NotificationsSandbox/payload.json diff --git a/sandboxes/NotificationsSandbox/README.md b/sandboxes/NotificationsSandbox/README.md index 68065de..2ac7265 100644 --- a/sandboxes/NotificationsSandbox/README.md +++ b/sandboxes/NotificationsSandbox/README.md @@ -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 ``` @@ -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 +``` diff --git a/sandboxes/NotificationsSandbox/notification.apns b/sandboxes/NotificationsSandbox/notification.apns deleted file mode 100644 index a07c276..0000000 --- a/sandboxes/NotificationsSandbox/notification.apns +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Simulator Target Bundle": "io.intercom.ios.enterprise.sample", - "aps": { - "alert": { - "title": "Transfer Update", - "body": "Your Transfer has been downloaded" - } - } -} diff --git a/sandboxes/NotificationsSandbox/payload.apns b/sandboxes/NotificationsSandbox/payload.apns new file mode 100644 index 0000000..16ff42d --- /dev/null +++ b/sandboxes/NotificationsSandbox/payload.apns @@ -0,0 +1,9 @@ +{ + "Simulator Target Bundle": "replace.with.your.bundle.id", + "aps": { + "alert": { + "title": "Testing push notifications", + "body": "Local notifications are working" + } + } +} diff --git a/sandboxes/NotificationsSandbox/payload.json b/sandboxes/NotificationsSandbox/payload.json new file mode 100644 index 0000000..ba94bc5 --- /dev/null +++ b/sandboxes/NotificationsSandbox/payload.json @@ -0,0 +1,8 @@ +{ + "aps": { + "alert": { + "title": "Testing push notifications", + "body": "Local notifications are working" + } + } +}