Enum Class ForegroundServiceNotificationOptions.TapAction

java.lang.Object
java.lang.Enum<ForegroundServiceNotificationOptions.TapAction>
es.situm.sdk.location.ForegroundServiceNotificationOptions.TapAction
All Implemented Interfaces:
Serializable, Comparable<ForegroundServiceNotificationOptions.TapAction>, Constable
Enclosing class:
ForegroundServiceNotificationOptions

public static enum ForegroundServiceNotificationOptions.TapAction extends Enum<ForegroundServiceNotificationOptions.TapAction>
Predefined actions performed when tapping the Situm Foreground Service Notification.
  • Enum Constant Details

    • LAUNCH_APP

      public static final ForegroundServiceNotificationOptions.TapAction LAUNCH_APP
      Launch the app's main activity using the information returned by PackageManager.getLaunchIntentForPackage(String).

      The Intent used with LAUNCH_APP contains an extra SITUM_EXTRA_LAUNCH_APP that allows you to detect whether the app launch comes from a notification. You can check this extra in your activity to determine the source of the launch.

      
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);
      
           Intent intent = getIntent();
           if (intent != null && intent.hasExtra(ForegroundServiceNotificationOptions.SITUM_EXTRA_LAUNCH_APP)) {
               // Handle the launch from the notification
               handleNotificationLaunch();
           } else {
               // Handle the normal launch
               handleNormalLaunch();
           }
       }
       
    • DO_NOTHING

      public static final ForegroundServiceNotificationOptions.TapAction DO_NOTHING
      Do nothing when tapping the Notification.
    • LAUNCH_SETTINGS

      public static final ForegroundServiceNotificationOptions.TapAction LAUNCH_SETTINGS
      Launch the operating system settings screen for the current app.
  • Method Details

    • values

      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null