BatchMessagingView

Class representing a Batch Messaging view.

This is used to manually handle display of Mobile Landings and In-App Messages.

BatchMessagingView should be instantiated from the static factory methods: loadMessagingView.

Then you will have to call showView or showFragment according to the kind.

Note that: this methods should be called from the UI thread.

Example:


  val messagingView = Batch.Messaging.loadMessagingView(this, message)
  when (messagingView.kind) {
      BatchMessagingView.Kind.Fragment -> messagingView.showFragment(supportFragmentManager, "batch-landing")
      BatchMessagingView.Kind.View -> messagingView.showView(this)
   }

Types

Link copied to clipboard
enum Kind
Kind of view which can be wrapped by this class.

Properties

Link copied to clipboard
Represents the kind of view this is.

Functions

Link copied to clipboard
open fun dismissFragment()
Dismiss the BatchMessagingView when it's Fragment.
Link copied to clipboard
open fun dismissView(animated: Boolean)
Dismiss the BatchMessagingView when it's View.
Link copied to clipboard
open fun showFragment(@NonNull activity: FragmentActivity, @Nullable tag: String)
open fun showFragment(@NonNull fragmentManager: FragmentManager, @Nullable tag: String)
Show the wrapped value as a DialogFragment.
Link copied to clipboard
open fun showView(@NonNull activity: Activity)
Shows the BatchMessagingView for the specified activity.
open fun showView(@NonNull anchorView: View)
Show the wrapped value as a View for the specified anchor view.
Link copied to clipboard
Get the wrapped value as a DialogFragment.