isLocal

open fun isLocal(): Boolean

Checks if this is a local notification.

Local notifications are scheduled by the app itself using LocalNotification rather than being sent from Pushwoosh servers. This method helps distinguish between remote and local notifications. Example:


  
  protected boolean onMessageReceived(PushMessage message) {
      if (message.isLocal()) {
          Log.d("App", "Local notification triggered");

          // Handle local notification
          String customData = message.getCustomData();
          // Process reminder or scheduled task

      } else {
          Log.d("App", "Remote notification from Pushwoosh");

          // Track delivery for remote notifications
          long campaignId = message.getCampaignId();
          analytics.trackNotificationReceived(campaignId);
      }

      return false; // Show notification
  }

Return

true if this is a local notification scheduled by the app

See also