mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-11 22:55:59 +05:45
Sample Standalone watchOS App
This sample demonstrates how to use Firebase Cloud Messaging in a standalone watchOS app.
Getting started
- Turn on Developer mode on your watch:
- Settings > Privacy & Security > Developer Mode
- You will have to restart your watch
- Change the bundle identifier to a unique ID (e.g.
dev.<yourcompany>.WatchKitApp.dev.WatchKitApp) - Enable automatic code signing for the Xcode project
- Add Firebase to your watchOS Project
Warning
Make sure to add the
GoogleServices-Info.plistfile to theSampleStandaloneWatchApp Watch Apptarget - Upload your APNs authentication key to Firebase
- Run the app
- When the app first launches, you will need to accept the notification permission
- In the Firebase console, go to Messaging, and click on Create your first campaign
- Select Firebase Notification messages and click on Create
- Enter a message in the Notification text field
- Click on the blue Send test message button on the right
Note
It is easy to miss this button. You have to click on the blue Send test message button on the RIGHT HAND side of the screen.
- In the Xcode debug console, find the FCM registration token, and add it in the Test on device dialog
- Tick the checkbox for the token, then click on the Test button
- The message should now appear on your development watch