Package com.netmera

Class Netmera

java.lang.Object
com.netmera.Netmera

public class Netmera extends Object
Netmera is the main class to be used for configuring the SDK and interacting with Netmera servers.
  • Constructor Details

    • Netmera

      public Netmera()
  • Method Details

    • init

      public static void init(@NonNull NetmeraParams params)
      Initialize the Netmera instance using a lightweight NetmeraParams object, combined with a netmera-config.json file bundled in the host app's assets.

      NetmeraParams carries the apiKey, providers, and an optional base URL override. SSL pin keys and the Firebase/Huawei sender IDs are not part of NetmeraParams — they must come from netmera-config.json, so that file is mandatory for this entry point; initialization fails (logs an error, does nothing) if it's missing, unreadable, or has no sender ID set.

      Netmera does not start operating, it even does not exist, unless this method is called. Any Netmera method called before this method is simply ignored.

      In order for Netmera to operate correctly, this method must definitely be called in the Application.onCreate() method.

      Parameters:
      params - NetmeraParams encapsulates the apiKey, providers, and an optional base URL override.
    • init

      @Deprecated public static void init(@NonNull NetmeraConfiguration netmeraConfiguration)
      Deprecated.
      Use init(NetmeraParams) together with a netmera-config.json file bundled in the host app's assets instead. This will be removed in a future release.
      Initialize the Netmera instance.

      Netmera does not start operating, it even does not exist, unless this method is called. Any Netmera method called before this method is simply ignored.

      In order for Netmera to operate correctly, this method must definitely be called in the Application.onCreate() method.

      Parameters:
      netmeraConfiguration - NetmeraConfiguration encapsulates all the necessary information for initialization of Netmera instance.
    • init

      @Deprecated public static void init(@NonNull NetmeraConfiguration netmeraConfiguration, @Nullable NMInitSessionListener listener)
      Deprecated.
      Use setInitSessionCallback(NMInitSessionResultListener) to receive init session result. The NMInitSessionListener variant will be removed in a future release.
    • initWithHoldingOperation

      public static void initWithHoldingOperation(@NonNull NetmeraParams params)
      This method is for advanced usage; if you think it's required for you, you can contact support@netmera.com

      Initialize the Netmera instance with holding operations till startOperation() is called, using a lightweight NetmeraParams object combined with a netmera-config.json file bundled in the host app's assets (mandatory — see init(NetmeraParams) for details).

      If SDK is initialized with this method and later startOperation() is not called, Netmera will not do anything. Any Netmera method called before this method is simply ignored.

      In order for Netmera to operate correctly, this method must definitely be called in the Application.onCreate() method.

      Parameters:
      params - NetmeraParams encapsulates the apiKey, providers, and an optional base URL override.
    • initWithHoldingOperation

      @Deprecated public static void initWithHoldingOperation(@NonNull NetmeraConfiguration netmeraConfiguration)
      Deprecated.
      Use initWithHoldingOperation(NetmeraParams) together with a netmera-config.json file bundled in the host app's assets instead. This will be removed in a future release.
      This method is for advanced usage; if you think it's required for you, you can contact support@netmera.com

      Initialize the Netmera instance with holding operations till startOperation() is called.

      If SDK is initialized with this method and later startOperation() is not called, Netmera will not do anything. Any Netmera method called before this method is simply ignored.

      In order for Netmera to operate correctly, this method must definitely be called in the Application.onCreate() method.

      Parameters:
      netmeraConfiguration - NetmeraConfiguration encapsulates all the necessary information for initialization of Netmera instance.
    • initWithHoldingOperation

      @Deprecated public static void initWithHoldingOperation(@NonNull NetmeraConfiguration netmeraConfiguration, @Nullable NMInitSessionListener listener)
      Deprecated.
      Use initWithHoldingOperation(NetmeraConfiguration) combined with setInitSessionCallback(NMInitSessionResultListener) to receive init session results. The NMInitSessionListener variant will be removed in a future release.
    • setInitSessionCallback

      public static void setInitSessionCallback(@Nullable NMInitSessionResultListener listener)
      Registers a listener that is called on every init session completion, including re-sessions that occur after a session timeout during the app lifecycle, and every background retry the SDK performs after an init session attempt fails.

      The listener receives a NetmeraInitSessionResult containing the response from the server. It is retained by the SDK and fires again after each new init session and each retry attempt; pass null to release it.

      Can be called before or after init(NetmeraConfiguration).

      Parameters:
      listener - the listener to register, or null to remove it
    • startOperation

      public static void startOperation()
      Tells Netmera to start working if the SDK is initialized with initWithHoldingOperation(NetmeraConfiguration) method, or to resume after a holdOperation() call.

      If SDK is not in a hold state, this method does nothing.

    • holdOperation

      public static void holdOperation()
      Pauses SDK operations without requiring re-initialization.

      Flushes the active session, then waits for all pending network requests to drain before fully suspending. While suspended, new events are buffered and sent when startOperation() is called.

      Can be called multiple times during the app lifecycle. If the SDK is not in OPERATING state this method is a no-op.

    • isOperating

      public static boolean isOperating()
      Returns true if the SDK is in the OPERATING state — fully initialized, not on hold, and not killed.
    • kill

      public static void kill()
      Kills Netmera completely as if it never exists.

      If you want Netmera to work again, the SDK should be re-initialized in app launch.

    • setBaseUrl

      public static void setBaseUrl(String url)
      Changes base API URL to given URL string.

      The only use case for this method is when a custom Netmera domain is defined to your application.

      Parameters:
      url - Custom domain string.
    • skipAppConfigAndSetBaseUrl

      public static void skipAppConfigAndSetBaseUrl(String url)
    • setApiKey

      public static void setApiKey(String apiKey)
      Set given Netmera SDK API key.

      Calling this method with a valid API key will effectively start communication with Netmera servers. Netmera will store any operation until it has an API key

      Setting API key to null or empty string will stop all network operations, and all pending operations will be stored until a valid API key is set again.

      Parameters:
      apiKey - Application specific API key gathered from Netmera panel.
    • setBaseUrlWithApiKey

      public static void setBaseUrlWithApiKey(String baseUrl, String apiKey)
      Sets given Netmera SDK API key and changes base API URL to given URL string.

      Calling this method with a valid API key will effectively start communication with Netmera servers. Netmera will store any operation until it has an API key

      Setting API key to null or empty string will stop all network operations, and all pending operations will be stored until a valid API key is set again.

      Please refer to use this method when a custom Netmera domain is defined to your application.

      Parameters:
      apiKey - Application specific API key gathered from Netmera panel.
    • turnOffSendingEventAndUserUpdate

      public static void turnOffSendingEventAndUserUpdate(boolean turnOff)
      Completely turn off sending all events and user data. If a true boolean parameter is passed to this method, NetmeraUser updates and NetmeraEvents will never be sent to server.

      Parameters:
      turnOff - Flag for opt-out user data and events. Default value is false.
    • startDataTransfer

      public static void startDataTransfer()
      Enables event sharing and update user if it has been blocked before.
    • stopDataTransfer

      public static void stopDataTransfer()
      Blocks event sharing and updating user. After this method call startDataTransfer must be called for reactivating.
    • sendEvent

      public static <T extends NetmeraEvent> void sendEvent(@NonNull T netmeraEvent)
      Send an event to Netmera servers.

      You can send behavioral actions of your users using this method.

      Rather than accepting unstructured information inside events, SDK requires given event to be a valid subclass of NetmeraEvent class. This approach provides Netmera to verify type of the given event attributes, which is crucial during event analytics operations on Netmera servers.

      Parameters:
      netmeraEvent - An event object which is subclass of NetmeraEvent
    • sendEvent

      public static void sendEvent(@NonNull String code, Map<String,Object> attributes)
      Send an event to Netmera servers.

      You can send behavioral actions of your users using this method.

      This method accepts an event code and a map of attributes, which will be wrapped in a NetmeraEventGeneric object internally. This provides a flexible way to send events without requiring a specific NetmeraEvent subclass. However, attributes still need to match the schema defined on the server.

      For all public event classes, you can use the EVENT_CODE constant instead of hardcoding the event code string. For example, use NetmeraEventLogin.EVENT_CODE instead of "n:cl".

      Parameters:
      code - The event code identifying the type of event
      attributes - A map of event attributes (key-value pairs) to be sent with the event
    • trackComposeView

      public static void trackComposeView(@NonNull String viewIdentifier)
      Track a Compose view with the given view identifier.

      This method is for autotracking only. It tracks when a Compose view is displayed.

      The given viewIdentifier will be prepended with the current page name (activity name and fragment name if available) in the format: "currentPageName|viewIdentifier". The current page name is automatically determined by the SDK based on the current activity and fragment context.

      Parameters:
      viewIdentifier - The unique identifier for the Compose view
    • trackComposeAction

      public static void trackComposeAction(@NonNull String viewIdentifier)
      Track a Compose action with the given view identifier.

      This method is for autotracking only. It tracks when a user interacts with a Compose component (e.g., button click).

      The given viewIdentifier will be prepended with the current page name (activity name and fragment name if available) in the format: "currentPageName|viewIdentifier". The current page name is automatically determined by the SDK based on the current activity and fragment context.

      Parameters:
      viewIdentifier - The unique identifier for the Compose action
    • identifyUser

      public static void identifyUser(@NonNull NMUser nmUser)
      Set or update the identifiers of the user in Netmera.

      In order to update attributes of the user, you should use updateUserProfile(NMUserProfile)

      Parameters:
      nmUser - NMUser object for setting user related identifiers
    • identifyUser

      @Deprecated public static void identifyUser(@NonNull NMUser nmUser, @Nullable NMUpdateUserListener listener)
      Deprecated.
      Use identifyUser(NMUser, NMIdentifyUserListener) to receive the identify user result
      Set or update the identifiers of the user in Netmera.

      In order to update attributes of the user, you should use updateUserProfile(NMUserProfile)

      Parameters:
      nmUser - NMUser object for setting user related identifiers
      listener - NMUpdateUserListener to receive success or failure callbacks
    • identifyUser

      public static void identifyUser(@NonNull NMUser nmUser, @Nullable NMIdentifyUserListener listener)
      Set or update the identifiers of the user in Netmera.

      In order to update attributes of the user, you should use updateUserProfile(NMUserProfile)

      Parameters:
      nmUser - NMUser object for setting user related identifiers
      listener - NMIdentifyUserListener to receive the identify user result
    • updateUser

      @Deprecated public static <T extends NetmeraUser> void updateUser(T netmeraUser)
      Deprecated.
      Use identifyUser(NMUser) for user identification and updateUserProfile(NMUserProfile) for updating profile attributes.
      Set or update the attributes of the user in Netmera.

      Parameters:
      netmeraUser - NetmeraUser object for setting user related attributes
    • updateUser

      @Deprecated public static <T extends NetmeraUser> void updateUser(T netmeraUser, NMUpdateUserListener listener)
      Deprecated.
      Use identifyUser(NMUser) for user identification and updateUserProfile(NMUserProfile) for updating profile attributes.
      Set or update the attributes of the user in Netmera.

      Parameters:
      netmeraUser - NetmeraUser object for setting user related attributes
      listener - NMUpdateUserListener to receive success or failure callbacks
    • updateUserProfile

      public static <T extends NMUserProfile> void updateUserProfile(T userProfile)
      Set or update the attributes of the user in Netmera.

      Parameters:
      userProfile - NMUserProfile object for setting user related attributes
    • updateUserProfile

      public static <T extends NMUserProfile> void updateUserProfile(T userProfile, NMUpdateUserProfileListener listener)
      Set or update the attributes of the user in Netmera with a listener for the operation result.

      Parameters:
      userProfile - NMUserProfile object containing user-related attributes to be updated
      listener - NMUpdateUserProfileListener to receive success or failure callbacks
    • enablePush

      public static boolean enablePush()
      Enable push notification for this device if system notifications are enabled.

      Push notification is enabled by default but if push notification is disabled via disablePush(), it can be re-enabled via this method.

    • enablePush

      public static void enablePush(android.app.Activity activity)
      Enable push notification for this device if system notifications are enabled.

      Push notification is enabled by default but if push notification is disabled via disablePush(), it can be re-enabled via this method.

      Parameters:
      activity - Activity request permission if system notifications are disabled below API 33 goes to app settings
    • disablePush

      public static void disablePush()
      Disable push notification for this device.

      This method can be used to prevent Netmera servers to send push notifications to this device.

    • isPushEnabled

      public static boolean isPushEnabled()
      Check push notification state.

      This method checks both system level state and app level state.

      Returns:
      True if both of the states are @code{true}, false otherwise.
    • enablePopupPresentation

      public static void enablePopupPresentation()
      Enable Netmera to present received popups immediately.

      By default, Netmera does not present received popup style notifications automatically.

      Use this method to enable Netmera to automatically present popup style notifications if you previously disabled using disablePopupPresentation() method.

      If a popup style notification has been received during the time at which popup presentation was disabled, it will be shown immediately after you call this method.

      If multiple popup notifications have been received, only the most recent one will be presented.

    • disablePopupPresentation

      public static void disablePopupPresentation()
      Disable Netmera to present received popups.

      By default, Netmera presents received popup style notifications automatically.

      Use this method to disable Netmera to automatically present popup style notifications.

      If any popup notification is received during the time at which presentation is disabled, it will be presented immediately after presentation is enabled again via enablePopupPresentation().

    • dismissAllPresentations

      public static void dismissAllPresentations()
      Dismisses all currently active WebView presentations (popups and other web content activities).

      This method will close all active BaseWebViewActivity instances that are currently displayed, including popup activities and any other web view presentations managed by the SDK.

      This is useful when you need to programmatically close all Netmera web presentations at once, for example when the user logs out or when you want to clear all active presentations.

      The method is thread-safe and will ensure that activity finish operations are performed on the main thread.

    • handleWebContent

      public static void handleWebContent(@NonNull android.webkit.WebView webView)
      Load contents of the web view action of recent push notification in given web view.

      When this method is called, Netmera will immediately load the contents of the web view action inside given WebView object.

      If you need to be notified about WebViewClient.shouldOverrideUrlLoading(WebView, String)} method calls, you should use handleWebContent(WebView, NetmeraWebViewCallback) method.

      Parameters:
      webView - A WebView instance upon which related HTML content will be loaded.
    • handleWebContent

      public static void handleWebContent(@NonNull android.webkit.WebView webView, NetmeraWebViewCallback netmeraWebViewCallback)
      Load contents of the web view action of recent push notification in given web view and delegates WebViewClient.shouldOverrideUrlLoading(WebView, String)} method calls to given callback.

      When this method is called, Netmera will immediately load the contents of the web view action inside given WebView object.

      Parameters:
      webView - A WebView instance upon which related HTML content will be loaded.
      netmeraWebViewCallback - A callback instance which will be called for url loadings
    • displayWidget

      public static void displayWidget(@NonNull String url)
      Display a widget given only its URL, without requiring a push object.

      When this method is called, Netmera presents the widget itself in its own popup/activity, reusing the same widget-presentation flow used for widget pushes. The same widget URL processing that is applied to widget pushes is applied before loading.

      Parameters:
      url - The widget URL to display.
    • displayWidget

      public static void displayWidget(@NonNull String url, @Nullable android.webkit.WebView webView, @Nullable NetmeraWebViewCallback netmeraWebViewCallback)
      Display a widget given its URL.

      When a WebView is provided, Netmera loads the widget URL into that web view and delegates WebViewClient.shouldOverrideUrlLoading(WebView, String)} method calls to the given callback, so the host app is responsible for presenting it. When no WebView is provided, Netmera presents the widget itself in its own popup/activity, reusing the same widget-presentation flow used for widget pushes.

      In all cases, the same widget URL processing that is applied to widget pushes is applied before loading.

      Parameters:
      url - The widget URL to display.
      webView - A WebView instance upon which the widget content will be loaded, or null to let the SDK present the widget.
      netmeraWebViewCallback - A callback instance which will be called for url loadings.
    • handlePushObject

      public static void handlePushObject(@NonNull android.app.Activity activity, @NonNull NetmeraPushObject netmeraPushObject)
      Perform push object's action or show a simple dialog with action buttons according to push type

      When this method is called, if push object has action buttons, a simple dialog with buttons will be shown. If one of button is clicked by user, its action will be taken. If push object has no action buttons, the action related to object itself will be taken directly.

      Parameters:
      activity - The activity in which dialog will be shown.
      netmeraPushObject - Push object instance to process
    • fetchInbox

      public static void fetchInbox(@NonNull NetmeraInboxFilter filter, @NonNull NetmeraInbox.NetmeraInboxFetchCallback callback)
      Fetch list of push notifications matching with given filter from Netmera.

      This method will start the fetch process and return immediately. When fetch process is finished, given callback will be called with a NetmeraInbox object or with a non-null NetmeraError object if fetch operation has failed.

      Use returned NetmeraInbox object for future operations on the inbox such as accessing the objects, fetching next pages of the inbox list, and modifying the status of objects.

      Parameters:
      filter - A NetmeraInboxFilter object defining the filter options for the list of push objects to be returned from server.
      callback - A NetmeraInbox.NetmeraInboxFetchCallback to be triggered after fetch process is completed.
      See Also:
    • fetchCategory

      public static void fetchCategory(@NonNull NetmeraCategoryFilter filter, @NonNull NetmeraInboxCategory.NetmeraInboxCategoryCallback callback)
      Fetch the categories of push notifications matching with given filter from Netmera.

      This method will start the fetch process and return immediately. When fetch process is finished, given callback will be called with a NetmeraCategory object or with a non-null NetmeraError object if fetch operation has failed.

      Use returned NetmeraInboxCategory object for future operations on the category such as accessing the objects or fetching next pages of the category list.

      Parameters:
      filter - A NetmeraCategoryFilter object defining the filter options for the list of categories to be returned from server.
      callback - A NetmeraInboxCategory.NetmeraInboxCategoryCallback to be triggered after fetch process is completed.
      See Also:
    • requestPermissionsForLocation

      public static void requestPermissionsForLocation()
      Request location permissions from user (For Android version level 23 and above).

      Calling this method will trigger OS to present location permission dialog to user. After permissions are granted, location tracking and geofence monitoring will start if they have been configured on Netmera panel.

      You do not need to call this method if your app already has Location permission.

    • requestNotificationPermissions

      public static void requestNotificationPermissions(android.app.Activity activity)
      This method allows you to get the Push Notification Permissions that come with Android API Level 33 at runtime.
      Parameters:
      activity - Necessary for context
    • requestNotificationPermissions

      public static void requestNotificationPermissions(android.app.Activity activity, @Nullable NMPermissionResultListener listener)
      This method allows you to get the Push Notification Permissions that come with Android API Level 33 at runtime.
      Parameters:
      activity - Necessary for context
      listener - NMPermissionResultListener to receive result: onSuccess(true) when granted, onSuccess(false) when denied, onFailure on error
    • checkNotificationPermission

      public static NotificationPermissionStatus checkNotificationPermission(android.app.Activity activity)
      Checks and returns the user's notification permission status.
      Parameters:
      activity - Necessary for context
      Returns:
      NotificationPermissionStatus enum representing the current permission status.
    • areNotificationsEnabled

      public static boolean areNotificationsEnabled()
      This method is used to query the Push Notification permissions that come with Android API Level 33.
      Returns:
      Always returns true if the application has Build.VERSION.SDK_INT < 33 or if the user grants the necessary permissions. Otherwise false
    • setNetmeraMaxActiveRegions

      public static void setNetmeraMaxActiveRegions(int netmeraMaxActiveRegions)
      Request maximum active geofence region from user

      If user sets max active regions' number greater than 100 or smaller than 0, it will be set as the default which is 100

      Parameters:
      netmeraMaxActiveRegions - Maximum Netmera active geofence regions
    • onNetmeraPushMessageReceived

      public static void onNetmeraPushMessageReceived(Object remoteMessage)
      This method must be called when the application has its own integration of either FirebaseMessagingService or HmsMessageService. Please consider calling this when application's onMessageReceived(Object remoteMessage) method was triggered by either Firebase Console or Huawei Console.
      Parameters:
      remoteMessage - com.google.firebase.messaging.RemoteMessage or com.huawei.hms.push.RemoteMessage Push notification message, which was caught by either FirebaseMessagingService or HmsMessageService
    • onNetmeraNewToken

      public static void onNetmeraNewToken(String token)
      This method must be called when the application has its own integration of FirebaseMessagingService. Please consider calling this when application's onNewToken(String s) method was triggered by Firebase or HMS.
      Parameters:
      token - Token, which was caught by depending on provider.
    • onNetmeraNewToken

      public static void onNetmeraNewToken(String token, boolean forceToSend)
      This method must be called when the application has its own integration of FirebaseMessagingService. Please consider calling this when application's onNewToken(String s) method was triggered by Firebase or HMS.
      Parameters:
      token - Token, which was caught by depending on provider.
      forceToSend - Force to send new token to the server.
    • fetchPushToken

      public static void fetchPushToken(NMPushTokenResultListener listener)
    • isNetmeraRemoteMessage

      @Deprecated public static boolean isNetmeraRemoteMessage(Object remoteMessage)
      Deprecated.
      Use isNetmeraRemoteMessage(Map) for more straightforward way to check the incoming RemoteMessage.
      Parameters:
      remoteMessage - Push notification message, which was sent by FCM or HMS
    • isNetmeraRemoteMessage

      public static boolean isNetmeraRemoteMessage(Map<String,String> dataOfRemoteMessage)
      This method should be called for obtaining, if the incoming RemoteMessage is sent from the Netmera Console. True - If RemoteMessage belongs Netmera Console False - For other sources
      Parameters:
      dataOfRemoteMessage - Push notification message, which was sent by FCM or HMS, If called from FCM service pass remoteMessage.data, If called from HMS service pass remoteMessage.dataOfMap.
    • setNetmeraHeaders

      public static void setNetmeraHeaders(android.content.ContentValues headerValueSet)
      This method should be called to add custom headers to Netmera Requests for hybrid platforms. Usage of this method is not obligatory.
      Parameters:
      headerValueSet - - Header Map, which holds key-value pairs
    • updateAll

      public static void updateAll(int inboxStatus, NetmeraInbox.NetmeraInboxStatusCallback callback)
      Update status of all push objects in the inbox.

      Calling this method will update the inbox status of all push objects, and result will be informed via given NetmeraInbox.NetmeraInboxStatusCallback object. A null error value means operation succeeded.

      Setting multiple status options to status parameter will result in an immediate error.

      Parameters:
      inboxStatus - Status option to be set upon given push objects.
      callback - A NetmeraInbox.NetmeraInboxStatusCallback to be triggered after update process is completed.
    • updateStatusByCategories

      public static void updateStatusByCategories(int inboxStatus, @NonNull List<String> categoryList, NetmeraInbox.NetmeraInboxStatusCallback callback)
      Update status of the push objects which are in the given categories.

      Calling this method will update the inbox status of push objects which are in the given categories, and result will be informed via given NetmeraInbox.NetmeraInboxStatusCallback object. A null error value means operation succeeded.

      Setting multiple status options to status parameter will result in an immediate error.

      Parameters:
      inboxStatus - Status option to be set upon to all push objects which are in the given categories.
      categoryList - The list of categories whose push objects will be updated.
      callback - A NetmeraInbox.NetmeraInboxStatusCallback to be triggered after update process is completed.
    • handleInteractiveAction

      public static void handleInteractiveAction(@NonNull android.content.Context context, @NonNull NetmeraInteractiveAction interactiveAction)
      Perform push object's interactive actions

      When this method is called, action according to push object's interactive action will be triggered/shown. (For example triggering of a deeplink or showing webpage upon button click.)

      Parameters:
      context - Activity context will be accepted.
      interactiveAction - Push object's NetmeraInteractiveAction.
    • getCurrentExternalId

      public static String getCurrentExternalId()
      Returns the user's external Id if it has already been set.
      Returns:
      String external id of the user
    • setUserCategoryPreference

      public static void setUserCategoryPreference(int categoryId, Boolean categoryEnabled, NMCategoryPreferenceSetCallback listener)
      Update enable status of user's category preference according to the given category id.
      Parameters:
      categoryId - Category preference id, which will be updated.
      categoryEnabled - Status of the category preference. True stands for enable.
      listener - NMCategoryPreferenceSetCallback Needed for listening network results.
    • getInboxCountForStatus

      public static void getInboxCountForStatus(NMInboxStatusCountFilter filter, @NonNull NMInboxCountResultListener listener)
      Returns the number of inbox messages according to the parameters given with the NMInboxStatusCountFilter.
      Parameters:
      filter - NMInboxStatusCountFilter
      listener - NMInboxCountResultListener Needed for listening network results.
    • fetchCoupons

      public static void fetchCoupons(int page, int max, @NonNull NMFetchCouponsResultListener listener)
      Returns the coupons according to the parameters given with the NMFetchCouponsResultListener.
      Parameters:
      page - the page number [0...Max_Int]
      max - maximum count [1...Max_Int]
    • getUserCategoryPreferenceList

      public static void getUserCategoryPreferenceList(@NonNull NMCategoryPreferenceFetchCallback listener)
      Fetch the category preference list of a single user.
      Parameters:
      listener - NMCategoryPreferenceFetchCallback Needed for listening network results. NMCategoryPreference list will be returned onSuccess method callback.
    • initCrashTracker

      @Deprecated public static void initCrashTracker()
      Deprecated.
      This method should not be used, as the crash tracker functionality has been removed from the SDK.
    • logException

      @Deprecated public static void logException(Exception e)
      Deprecated.
      This method should not be used, as the crash tracker functionality has been removed from the SDK.
    • setLoggingEnabled

      public static void setLoggingEnabled(boolean enabled)
      Enables or disables SDK logging. Required when using the init(NetmeraParams) entry point, since neither NetmeraParams nor netmera-config.json carry a logging flag.

      Can be called before or after init(NetmeraParams). Note that the deprecated init(NetmeraConfiguration) path unconditionally applies NetmeraConfiguration.Builder#logging(boolean) on init, overwriting whatever was set here if this was called first.

      Parameters:
      enabled - whether SDK logging should be enabled
    • setPushActionCallbacks

      public static void setPushActionCallbacks(@Nullable NMPushActionCallbacks callbacks)
      Registers a listener for push notification action events (open, button click, carousel selection). Can be called before or after init(NetmeraConfiguration).
      Parameters:
      callbacks - the callbacks to register, or null to remove them
    • setInAppMessageActionCallbacks

      public static void setInAppMessageActionCallbacks(@Nullable NMInAppMessageActionCallbacks callbacks)
      Registers a listener for in-app message action events (shown, opened, dismissed). Can be called before or after init(NetmeraConfiguration).
      Parameters:
      callbacks - the callbacks to register, or null to remove them
    • setWebWidgetCallbacks

      public static void setWebWidgetCallbacks(@Nullable NMWebWidgetCallbacks callbacks)
      Registers a listener for web widget events (shown, dismissed, deeplink/url triggered). Can be called before or after init(NetmeraConfiguration).
      Parameters:
      callbacks - the callbacks to register, or null to remove them
    • setPushPresentationCallbacks

      public static void setPushPresentationCallbacks(@Nullable NMPushPresentationCallbacks callbacks)
      Registers a listener for push/in-app presentation events (e.g. custom web view presentation). Can be called before or after init(NetmeraConfiguration).
      Parameters:
      callbacks - the callbacks to register, or null to remove them
    • setDeeplinkCallback

      public static void setDeeplinkCallback(@Nullable NMDeeplinkCallback callback)
      Registers a listener for deeplink open events. Can be called before or after init(NetmeraConfiguration).
      Parameters:
      callback - the callback to register, or null to remove it
    • registerForPushActions

      @Deprecated public static void registerForPushActions(NMPushActionCallbacks nmPushActionCallbacks)
    • registerForNetmeraInAppmessageActions

      @Deprecated public static void registerForNetmeraInAppmessageActions(NMInAppMessageActionCallbacks nmInAppMessageActionCallbacks)
    • registerForNetmeraWebWidgetCallbacks

      @Deprecated public static void registerForNetmeraWebWidgetCallbacks(NMWebWidgetCallbacks nmWebWidgetCallbacks)
    • registerForPushPresentationCallbacks

      @Deprecated public static void registerForPushPresentationCallbacks(NMPushPresentationCallbacks nmPushPresentationCallbacks)
    • registerForNetmeraDeeplinkCallback

      @Deprecated public static void registerForNetmeraDeeplinkCallback(NMDeeplinkCallback nmDeeplinkCallback)
      Deprecated.
    • sendScreenErrorEvent

      public static void sendScreenErrorEvent(String errorTitle, String errorMessage)
    • registerProviderComponent

      public static void registerProviderComponent(NMProviderComponent nmProviderComponent, NMProviderRegistrationCallback registrationCallback)
    • setEmailPermission

      public static void setEmailPermission(boolean isAllowed)
      Sets the email permission for the user
      Parameters:
      isAllowed - permission to be set
    • getEmailPermission

      public static void getEmailPermission(@NonNull NMPermissionResultListener listener)
      Returns the email permission for the user
      Parameters:
      listener - NMPermissionResultListener to receive success or failure callbacks
    • setSmsPermission

      public static void setSmsPermission(boolean isAllowed)
      Sets the SMS permission for the user
      Parameters:
      isAllowed - permission to be set
    • getSmsPermission

      public static void getSmsPermission(@NonNull NMPermissionResultListener listener)
      Returns the SMS permission for the user
      Parameters:
      listener - NMPermissionResultListener to receive success or failure callbacks
    • setWhatsAppPermission

      public static void setWhatsAppPermission(boolean isAllowed)
      Sets the WhatsApp permission for the user
      Parameters:
      isAllowed - permission to be set
    • getWhatsAppPermission

      public static void getWhatsAppPermission(@NonNull NMPermissionResultListener listener)
      Returns the WhatsApp permission for the user
      Parameters:
      listener - NMPermissionResultListener to receive success or failure callbacks