README.md 1.6 KB

Sample Standalone watchOS App

This sample demonstrates how to use Firebase Cloud Messaging in a standalone watchOS app.

Getting started

  1. Turn on Developer mode on your watch:
    • Settings > Privacy & Security > Developer Mode
    • You will have to restart your watch
  2. Change the bundle identifier to a unique ID (e.g. dev.<yourcompany>.WatchKitApp.dev.WatchKitApp)
  3. Enable automatic code signing for the Xcode project
  4. Add Firebase to your watchOS Project > Warning > Make sure to add the GoogleServices-Info.plist file to the SampleStandaloneWatchApp Watch App target
  5. Upload your APNs authentication key to Firebase
  6. Run the app
  7. When the app first launches, you will need to accept the notification permission
  8. In the Firebase console, go to Messaging, and click on Create your first campaign
  9. Select Firebase Notification messages and click on Create
  10. Enter a message in the Notification text field
  11. 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.
  12. In the Xcode debug console, find the FCM registration token, and add it in the Test on device dialog
  13. Tick the checkbox for the token, then click on the Test button
  14. The message should now appear on your development watch