Miniwall Docs
Mobile SDK

Targeting attributes

Tell the SDK about your user so placements can pick an audience, and handle the case where nothing is shown.

Placement audiences can test facts about the user, like plan or country. Your app passes those facts as attributes. They are compared on the device and are never sent to Miniwall. Miniwall stores only the rules.

An attribute is a string, a number or a boolean.

Passing attributes

WhereUse
configure (attributes)Defaults for the whole app.
setAttributesAdds to or changes the saved attributes, for example after sign-in. null (nil on iOS) removes one.
attributes option of a callMerged over the saved ones for that call only.
Miniwall.configure(apiKey: "pk_...", options: .init(attributes: ["plan": "free"]))
// after the user upgrades:
Miniwall.setAttributes(["plan": "pro", "country": "VN"])

In the dashboard a condition on plan is Attribute from your site with the name plan. Names start with a letter and use letters, numbers and _, up to 40 characters. For something the SDK does not know, such as the operating system, pass your own attribute, for example platform set to ios or android.

Built-in facts

These need no attributes: locale (the call's locale, else the device's), device (mobile or tablet; a tablet is a screen at least 600 dp wide on Android and an iPad on iOS), seen_count and days_since_first_seen. The page-based fact path has no value in an app. See Audience for exact rules.

When nothing is shown

Targeting applies to placement sources. In order: the frequency limit, the first matching audience, the holdout. See Audience.

WhereYou get
presentFinishes with skipped and a reason: frequency_cap, audience or holdout. Nothing opens.
Embedded screenonFinish receives skipped. Nothing is drawn.
Auto placementsonResult receives the skipped result.

A holdout skip records a holdout event. The other two send nothing.

Rules on the device

  • Text comparisons ignore case. A missing, null or empty value fails every comparison except is not and is not set.
  • Number comparisons need numbers on both sides.
  • The frequency counters and the first-run date are kept on the device (see Events and privacy). A per session limit counts screens shown since the app process started.

On this page