From 89417a05498cfcc0df425b0f276546612e6662d7 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 ++++++++++++++++- .../{notification.apns => payload.apns} | 4 ++-- sandboxes/NotificationsSandbox/payload.json | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) rename sandboxes/NotificationsSandbox/{notification.apns => payload.apns} (53%) 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/payload.apns similarity index 53% rename from sandboxes/NotificationsSandbox/notification.apns rename to sandboxes/NotificationsSandbox/payload.apns index a07c276..5f72b48 100644 --- a/sandboxes/NotificationsSandbox/notification.apns +++ b/sandboxes/NotificationsSandbox/payload.apns @@ -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" } } } 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" + } + } +}