Marigold

class Marigold

Keeps track of necessary environment variables provided by the developer or google. Also provides the entry point into Marigold for the developer to retrieve device information.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface MarigoldHandler<T>

Generic handler for async calls to the Marigold SDK.

Properties

Link copied to clipboard

Notification Action Tapped Flow - subscribe to this to handle events when notification actions are tapped by the user.

Link copied to clipboard

Notification Received Flow - subscribe to this to handle events when notifications are received on the device.

Link copied to clipboard

Notification Tapped Flow - subscribe to this to handle events when notifications are tapped by the user.

Functions

Link copied to clipboard

Adds listener to be called when a notification action is tapped. This method should be called after startEngine

Link copied to clipboard

Adds listener to be called when a notification is received. This method should be called after startEngine

Link copied to clipboard

Adds listener to be called when a notification is tapped. This method should be called after startEngine

Link copied to clipboard

Gets this devices ID on the Marigold Mobile Platform.

Link copied to clipboard
suspend fun Marigold.getDeviceId(): String?

Gets this device's ID on the Marigold Platform. Marigold

Link copied to clipboard

Gets this device's ID on the Marigold Platform.

Link copied to clipboard
fun handleNotification(remoteMessage: RemoteMessage)

Pass received notification to Marigold Mobile SDK. NOTE: This method should only be called if the app implements its own FirebaseMessagingService instance, in which case it must be called in order to provide FCM notifications to the Marigold Mobile SDK for processing. Otherwise this will be handled automatically by the Marigold Mobile SDK.

Link copied to clipboard

Log a registration event with Marigold. This is used to log users signing in and out of the app. Pass the ID you wish to use for the sign-in or null for a sign-out.

Link copied to clipboard
fun requestNotificationPermission(activity: Activity, isRationaleActivity: Boolean = false, requestCode: Int = DEFAULT_NOTIFICATION_PERMISSION_REQUEST_CODE): NotificationPermissionRequestResult

Handles the flow for requesting the android.Manifest.permission.POST_NOTIFICATIONS permission required for push notifications from Android 13(T)+. This is a no-op on earlier Android versions and will return NotificationPermissionRequestResult.PERMISSION_NOT_REQUIRED.

Link copied to clipboard
fun setDeviceToken(token: String?)

Pass the FCM token into the Marigold Mobile SDK. NOTE: This method should only be called if the app implements its own FirebaseMessagingService instance, in which case it must be called in order to provide the FCM token to the Marigold Mobile Platform. Otherwise this will be handled automatically by the Marigold Mobile SDK.

Link copied to clipboard
fun setGeoIpTrackingDefault(enabledGeoIp: Boolean)

Set whether location tracking based on IP Address will be enabled or disabled by default when a device is created. This method must be called before startEngine.

Link copied to clipboard
suspend fun Marigold.setGeoIPTrackingEnabled(enabledGeoIp: Boolean)

Enabled location tracking based on IP Address. Tracking location tracking is enabled by default. Use this method for users who may not want to have their location tracked at all.

Link copied to clipboard

Enabled location tracking based on IP Address. Tracking location tracking is enabled by default. Use this method for users who may not want to have their location tracked at all.

Link copied to clipboard

Enabled location tracking based on IP Address. Tracking location tracking is enabled by default. Use this method for users who may not want to have their location tracked at all.

Link copied to clipboard

Enables or disables the display of In-App Notifications. Must be called before startEngine. In-App Notifications are enabled by default.

Link copied to clipboard
fun setLogger(logger: Logger)

All logging within Marigold Mobile is routed through this Logger.

Link copied to clipboard
fun setNotificationConfig(notificationConfig: NotificationConfig)

Sets the configuration of notifications built by Marigold.

Link copied to clipboard
fun startEngine(context: Context, appKey: String)

Initialises The Marigold Mobile SDK. See documentation Connecting to Marigold Mobile for usage.

Link copied to clipboard

Checks the notifications enabled setting for the app and updates the device on the Marigold Mobile platform if required. From Android 13(T)+ it is recommended that this be called in when the result of the android.Manifest.permission.POST_NOTIFICATIONS permission is received to ensure the platform has the correct setting.

Link copied to clipboard
fun updateLocation(location: Location)

Updates Marigold with this device's location.