Traveling Foreground notification customizations

When implementing Traveling Foreground notification, you can customize these aspects.
  1. Add a custom Activity

    When adding custom_more_info_activity, the SDK launches the app's Activity instead of its own Webview Activity when tapping the foreground notification's More Info button. This custom Activity should include a privacy policy and options for the user to opt-out of data collection. See 3.c for more information.

    Note: Do not include these optional meta-data values unless explicitly using the features they support.
    <!-- Optional: Do not include this field unless the App has an Activity for displaying the privacy policy and opt-out. Whether to open a custom Activity within the app when tapping the Sense360 foreground notification's "More Info" button -->
    <meta-data  
      android:name="com.sense360.custom_more_info_activity"  
      android:value="com.example.CustomActivity" />
  2. Add the foreground service permission
    Add this permission to AndroidManifest.xml.
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
  3. (Optional) Customize the foreground notification at runtime.
    1. Pass null for the ForegroundServiceConfig
      If you pass in null for the ForegroundServiceConfig object, it uses the default defined in the AndroidManifest.xml in step 2. If you do not want to update the notification at runtime, do not make a call to Sense360.updateForegroundService.
    2. Pass non-null values
      Pass non-null values for newTitle and newMessage if isEnabled = true:
      boolean isEnabled = true;
      Boolean clickOpensApp = false;
      String newTitle = "Searching for surveys...";
      String newMessage = "Searching for location-based surveys...";
      ForegroundServiceConfig newConfig = new ForegroundServiceConfig(isEnabled, clickOpensApp, newTitle, newMessage);
      
      //Replace "ic_notification_icon" with your notification icon 
      
      namenewConfig.passNotificationIconId(R.drawable.ic_notification_icon);
      Sense360.updateForegroundService(getActivity().getApplicationContext(), newConfig);
    3. Pass a valid Activity name
      For the Sense360 notification's More Info button to open your Activity instead of the Sense360 Webview Activity to display your privacy policy and opt-out. This Activity must be within your own app, into which the Sense360 SDK is integrated. If the Activity associated with the Activity name is unavailable, the SDK defaults to display its own notification with the More Info button opening the Sense360 privacy policy page and opt-out option. This Activity name is entirely optional and not required for complete functionality of the SDK.
      boolean isEnabled = true;
      Boolean clickOpensApp = false;
      String newTitle = "Searching for surveys...";
      String newMessage = "Searching for location-based surveys...";
      ForegroundServiceConfig newConfig = new ForegroundServiceConfig(isEnabled, clickOpensApp, newTitle, newMessage);
      
      //Replace "ic_notification_icon" with your notification icon 
      
      namenewConfig.passNotificationIconId(R.drawable.ic_notification_icon);
      Sense360.updateForegroundService(getActivity().getApplicationContext(), newConfig);
    4. Pass a valid Activity name
      For the Sense360 notification's click-action (not the More Info button) to open a specific Activity when tapping the notification. This Activity must be within your own app integrated to the Sense360 SDK. This Activity name is entirely optional and not required for complete functionality of the SDK.
      <meta-data  
        android:name="com.sense360.foreground_notification_click_opens_app"  
        android:value="true" />
      
      //Replace com.example.CustomActivity with your app's own Activity
      
      <meta-data  
        android:name="com.sense360.custom_launch_activity"  
        android:value="com.example.CustomActivity" />
      To dynamically pass in the CustomActivity, use this code snippet:
      boolean isEnabled = true;
      Boolean clickOpensApp = true;
      String newTitle = "Searching for surveys...";
      String newMessage = "Searching for location based surveys...";
      ForegroundServiceConfig newConfig = new ForegroundServiceConfig(isEnabled, clickOpensApp, newTitle, newMessage);
      
      //Replace "CustomActivity" with your Activity's 
      
      namenewConfig.passCustomLaunchActivityName(CustomActivity.class.getName());
      Sense360.updateForegroundService(getActivity().getApplicationContext(), newConfig);
  4. Get current Foreground notification configuration
    ForegroundServiceConfig config = Sense360.getForegroundServiceDetails(getActivity().getApplicationContext());
You have customized you travel Foreground notification.