Skip to content

Instantly share code, notes, and snippets.

@MedRedha
Last active February 15, 2024 12:45
Show Gist options
  • Save MedRedha/56331de8f5f4d0983e11d3d198092e60 to your computer and use it in GitHub Desktop.
Save MedRedha/56331de8f5f4d0983e11d3d198092e60 to your computer and use it in GitHub Desktop.
Trigger Xcode Simulator Push Notification
// SINCE IT'S A JSON FILE - PLEASE REMOVE ALL THE COMMENTS -
// You can trigger a local push notification on your simulator by either:
// 1. Change file extension from .json to .apns and Drag & Drop the payload.apns on the simulator
// 2. Use terminal with following commandline: xcrun simctl push booted [APP BUNDLE ID] payload.json
// ENJOY!! 🎉
{
"Simulator Target Bundle": "com.apple.mobilecal", // add app bundle id here Calendar app for example
"aps": {
"alert": {
"title": "Push On Simulator Title", // add push notification title
"subtitle": "Push On Simulator Subtitle", // add push notification subtitle
"body": "You have sent it on simulator 🎉" // add push notification body
},
"sound": "default", // choose notification sound here set to default
"badge": 1 // choose badge number here set to 1 (default value)
}
}
// Here a list of default simulator Apple apps that you can use to test
// App Name | Bundle ID
// ---------------------------------
// Activity | com.apple.Fitness
// App Store | com.apple.AppStore
// Apple Store | com.apple.store.Jolly
// Books | com.apple.iBooks
// Calculator | com.apple.calculator
// Calendar | com.apple.mobilecal
// Camera | com.apple.camera
// Clips | com.apple.clips
// Clock | com.apple.mobiletimer
// Compass | com.apple.compass
// Contacts | com.apple.MobileAddressBook
// FaceTime | com.apple.facetime
// Files | com.apple.DocumentsApp
// Find My | com.apple.findmy
// GarageBand | com.apple.mobilegarageband
// Health | com.apple.Health
// Home | com.apple.Home
// iCloud Drive | com.apple.iCloudDriveApp
// iMovie | com.apple.iMovie
// iTunes Store | com.apple.MobileStore
// iTunes U | com.apple.itunesu
// Mail | com.apple.mobilemail
// Maps | com.apple.Maps
// Messages | com.apple.MobileSMS
// Measure | com.apple.measure
// Music | com.apple.Music
// News | com.apple.news
// Notes | com.apple.mobilenotes
// Phone | com.apple.mobilephone
// Photos | com.apple.mobileslideshow
// Photo Booth | com.apple.Photo-Booth
// Podcasts | com.apple.podcasts
// Reminders | com.apple.reminders
// Safari | com.apple.mobilesafari
// Settings | com.apple.Preferences
// Shortcuts | com.apple.shortcuts
// Stocks | com.apple.stocks
// Tips | com.apple.tips
// TV | com.apple.tv
// Videos | com.apple.videos
// Voice Memos | com.apple.VoiceMemos
// Wallet | com.apple.Passbook
// Watch | com.apple.Bridge
// Weather | com.apple.weather
@MedRedha
Copy link
Author

Simulator Screen Shot - iPhone 12 Pro Max - 2021-05-26 at 20 34 06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment