Note: these requirements are strictly based off of my development on this app. There may be other versions of macOS / XCode that work. Feel free to test on other versions!
- macOS Monterey or later
- XCode 13.2+
- A physical iOS device (for push notifications, I could not get them to work in the XCode simulator)
- The macOS development branch for ntfy (for APNS configuration)
- Firebase account
- Apple Developer license? (I forget if its possible to do testing without purchasing the license)
- Create a new key in Apple Developer Member Center
- Select "Apple Push Notifications service (APNs)"
- Download the newly created key (should have a file name similar to
AuthKey_ZZZZZZ.p8
, whereZZZZZZ
is the Key ID) - Record your Team ID - it can be seen in the top-right corner of the page, or on your Account > Membership page
- If you haven't already, create a Google / Firebase account
- Visit the Firebase console
- Create a new Firebase project:
- Enter a project name
- Disable Google Analytics (currently iOS app does not support analytics)
- On the "Project settings" page, add an iOS app
- Apple bundle ID - "com.copephobia.ntfy-ios" (this can be changed to match XCode's ntfy.sh target > "Bundle Identifier" value)
- Register the app
- Download the config file - GoogleInfo.plist (this will need to be included in the ntfy-ios repository / XCode)
- Generate a new service account private key for the ntfy server
- Go to "Project settings" > "Service accounts"
- Click "Generate new private key" to generate and download a private key to use for sending messages via the ntfy server
- Checkout the macOS development branch for ntfy
- If not already made, make the
/etc/ntfy/
directory and move the service account private key to that folder - Copy the
server/server.yml
file from the ntfy repository to/etc/ntfy/
- Modify the
/etc/ntfy/server.yml
filefirebase-key-file
value to the path of the private key - Install go:
brew install go
- In the ntfy repository, run
make build-simple
- Follow step 4 of [https://firebase.google.com/docs/ios/setup](Add Firebase to your Apple project) to install the firebase-ios-sdk in XCode, if it's not already present - you can select any packages in addition to Firebase Core / Firebase Messaging
- Similarly, install the SQLite.swift package dependency in XCode
- When running the debug build, ensure XCode is pointed to the connected iOS device - registering for push notifications does not work in the iOS simulators
- https://www.raywenderlich.com/14958063-modern-efficient-core-data
- https://www.hackingwithswift.com/books/ios-swiftui/how-to-combine-core-data-and-swiftui
- https://stackoverflow.com/a/41783666/1440785
- https://stackoverflow.com/questions/47374903/viewing-core-data-data-from-your-app-on-a-device
- https://debashishdas3100.medium.com/save-push-notifications-to-coredata-userdefaults-ios-swift-5-ea074390b57
- https://cocoacasts.com/cocoa-fundamentals-how-to-access-builds-settings-in-swifti
- https://www.hackingwithswift.com/articles/216/complete-guide-to-navigationview-in-swiftui
- https://stackoverflow.com/a/70731861/1440785