pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • Examples
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

Pebble C API

  • Pebble C API
  • Pebble JavaScript API
  • PebbleKit JS
  • PebbleKit iOS
  • PebbleKit Android
  • Foundation
    • App
    • App Communication
    • App Glance
    • AppMessage
    • AppSync
    • AppWorker
    • DataLogging
    • DataStructures
      • UUID
    • Dictation
    • Dictionary
    • Event Service
      • AccelerometerService
      • AppFocusService
      • BatteryStateService
      • CompassService
      • ConnectionService
      • HealthService
      • TickTimerService
    • Exit Reason
    • Internationalization
    • Launch Reason
    • Logging
    • Math
    • Memory Management
    • Platform
    • Resources
      • File Formats
    • Storage
    • Timer
    • Wakeup
    • Wall Time
    • WatchInfo
    • Rocky
  • Graphics
    • Draw Commands
    • Drawing Paths
    • Drawing Primitives
    • Drawing Text
    • Fonts
    • Graphics Context
    • Graphics Types
      • Color Definitions
  • User Interface
    • Animation
      • PropertyAnimation
    • Clicks
    • Layers
      • ActionBarLayer
      • BitmapLayer
      • MenuLayer
      • RotBitmapLayer
      • ScrollLayer
      • SimpleMenuLayer
      • StatusBarLayer
      • TextLayer
    • Light
    • Preferences
    • UnobstructedArea
    • Vibes
    • Window
      • ActionMenu
      • NumberWindow
    • Window Stack
  • Standard C
    • Format
    • Locale
    • Math
    • Memory
    • String
    • Time

Launch Reason

API for checking what caused the application to launch.

This includes the system, launch by user interaction (User selects the application from the launcher menu), launch by the mobile or a mobile companion application, or launch by a scheduled wakeup event for the specified application.

Function Documentation

AppLaunchReason launch_reason(void)

Provides the method used to launch the current application.

Returns

The method or reason the current application was launched

uint32_t launch_get_args(void)

Get the argument passed to the app when it was launched.

Note

Currently the only way to pass arguments to apps is by using an openWatchApp action on a pin.

Returns

The argument passed to the app, or 0 if the app wasn't launched from a Launch App action

Enum Documentation

  • SDK 3
  • SDK 4
enum AppLaunchReason

AppLaunchReason is used to inform the application about how it was launched.

New launch reasons may be added in the future. As a best practice, it is recommended to only handle the cases that the app needs to know about, rather than trying to handle all possible launch reasons.

Enumerators

APP_LAUNCH_SYSTEM

App launched by the system.

APP_LAUNCH_USER

App launched by user selection in launcher menu.

APP_LAUNCH_PHONE

App launched by mobile or companion app.

APP_LAUNCH_WAKEUP

App launched by wakeup event.

APP_LAUNCH_WORKER

App launched by worker calling worker_launch_app()

APP_LAUNCH_QUICK_LAUNCH

App launched by user using quick launch.

APP_LAUNCH_TIMELINE_ACTION

App launched by user opening it from a pin.

enum AppLaunchReason

AppLaunchReason is used to inform the application about how it was launched.

New launch reasons may be added in the future. As a best practice, it is recommended to only handle the cases that the app needs to know about, rather than trying to handle all possible launch reasons.

Enumerators

APP_LAUNCH_SYSTEM

App launched by the system.

APP_LAUNCH_USER

App launched by user selection in launcher menu.

APP_LAUNCH_PHONE

App launched by mobile or companion app.

APP_LAUNCH_WAKEUP

App launched by wakeup event.

APP_LAUNCH_WORKER

App launched by worker calling worker_launch_app()

APP_LAUNCH_QUICK_LAUNCH

App launched by user using quick launch.

APP_LAUNCH_TIMELINE_ACTION

App launched by user opening it from a pin.

APP_LAUNCH_SMARTSTRAP

App launched by a smartstrap.

Need some help?

Functions

  • launch_reason
  • launch_get_args

Enums

  • AppLaunchReason

Getting Help

Do you have questions about the Pebble SDK?

Do you need some help understanding something on this page?

You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!