বিষয়বস্তুতে যান

Pushwoosh Mendix module actions

এই বিষয়বস্তু এখনও আপনার ভাষায় উপলব্ধ নয়।

The Pushwoosh module for Mendix exposes its functionality in two places: the Pushwoosh events widget, which starts the SDK and turns incoming notifications into nanoflow events, and the JavaScript actions you call from any nanoflow on the native mobile navigation profile. This page lists both.

Pushwoosh events widget properties

Anchor link to

The widget renders nothing. Place it once, on the page that loads first in the native mobile navigation profile. It initializes the SDK, optionally registers the device, and triggers a nanoflow for each push notification event.

The properties pane of the Pushwoosh events widget, with the Setup, Push events and Deep links groups

These properties start the SDK and report when it is ready.

PropertyWhat it does
Application CodeThe Pushwoosh Application Code of your app, for example XXXXX-XXXXX. Required.
Register on loadRegisters the device as soon as the widget loads. On iOS this shows the system permission prompt, so turn it off if you would rather ask later with the RegisterForPushNotifications action.
On initializedA nanoflow that runs once the SDK has started.
On registeredA nanoflow that runs when the device has a push token.
Push tokenThe string attribute the push token is written to before On registered runs.

Push events

Anchor link to

These properties deliver an incoming notification into your model and trigger a nanoflow.

PropertyWhat it does
PayloadThe string attribute that receives the full notification payload as JSON.
MessageThe string attribute that receives the notification text.
On push receivedA nanoflow that runs when a notification arrives while the app is in the foreground.
On push openedA nanoflow that runs when the user taps a notification.
Anchor link to

These properties handle a notification that carries a link into a specific page of the app.

PropertyWhat it does
Deep linkThe string attribute that receives the deep link URL from the notification.
On deep linkA nanoflow that runs when an opened notification carries a link. It runs in addition to On push opened.

The attributes are filled before the nanoflow runs, so the nanoflow can read them straight away.

Setup actions

Anchor link to

Use these actions when you start the SDK yourself instead of using the widget.

Initialize

Anchor link to

Initializes the Pushwoosh SDK. Call it once, before any other Pushwoosh action, typically from the on-load nanoflow of the home page. You do not need it when the Pushwoosh events widget is on the page, because the widget initializes the SDK itself.

On Android, the FCM Sender ID comes from google-services.json, which the native build picks up. It is not passed to this action.

ParameterTypeDescription
applicationCodeStringThe Pushwoosh Application Code, for example XXXXX-XXXXX. Required.
notificationHandlingStringOptional. default or manual. Leave it empty for the default behavior.

Returns a Boolean that is true when the SDK started.

Registration actions

Anchor link to

These actions control whether this device receives notifications, and expose the identifiers that address it.

RegisterForPushNotifications

Anchor link to

Registers the device for push notifications and returns the push token. On iOS this triggers the system permission prompt, so call it at a point in the flow where asking makes sense to the user.

Returns a String with the push token.

UnregisterForPushNotifications

Anchor link to

Unregisters the device. It stops receiving notifications until RegisterForPushNotifications is called again.

Returns a String with the token the device was unregistered with.

GetPushToken

Anchor link to

Returns the current push token, or an empty string if the device is not registered yet.

Returns a String.

Returns the HWID of the device, the identifier Pushwoosh addresses it by. Use it to target a single device from the Pushwoosh Control Panel or the server API.

Returns a String.

User identity actions

Anchor link to

These actions connect a device to a person, so that one message reaches every device that person uses.

Associates the device with a user. Call it after login.

ParameterTypeDescription
userIdStringYour own identifier for the user. Required.

Returns a Boolean.

Returns the user ID currently associated with the device, or an empty string if none is set.

Returns a String.

Registers the user’s email addresses with Pushwoosh, so they can be reached by email as well as by push.

ParameterTypeDescription
emailsStringOne address, or several separated by commas. Required.

Returns a Boolean.

Tag actions

Anchor link to

Tags are the device properties that segments are built from in the Pushwoosh Control Panel.

Sets tags on the device.

ParameterTypeDescription
tagsJsonStringA JSON object, for example {"Language":"en","Level":7,"Premium":true}. Required.

Returns a Boolean.

Returns the tags currently set on the device, as a JSON string.

Returns a String.

Event actions

Anchor link to

Events are what triggered campaigns and in-app messages are started from.

Posts an event to Pushwoosh.

ParameterTypeDescription
eventNameStringThe event name as configured in the Control Panel. Required.
attributesJsonStringOptional. A JSON object of event attributes.

Returns a Boolean.

The underlying SDK call reports neither success nor failure, so the action returns true as soon as the call has been handed to the SDK.

Local notification actions

Anchor link to

Local notifications are produced by the app itself and need no network, which makes them suitable for reminders.

ScheduleLocalNotification

Anchor link to

Schedules a local notification on the device.

ParameterTypeDescription
messageStringThe notification text. Required.
afterSecondsInteger/LongHow long to wait before showing it, in seconds. Required, and zero or greater.
customDataJsonStringOptional. A JSON object delivered back with the notification.

Returns a Boolean as soon as the call has been handed to the SDK. The SDK does not report back whether the notification was actually scheduled.

ClearLocalNotifications

Anchor link to

Cancels local notifications that were scheduled but have not fired yet.

Returns a Boolean as soon as the call has been handed to the SDK.

ClearNotificationCenter

Anchor link to

Removes the app’s already-delivered notifications from the notification center.

Returns a Boolean as soon as the call has been handed to the SDK.

Privacy actions

Anchor link to

These actions back a consent toggle in your app, and switch all Pushwoosh messaging for the device on or off.

IsCommunicationEnabled

Anchor link to

Tells whether the device is currently allowed to receive communication from Pushwoosh. Use it to render the state of a privacy toggle.

Returns a Boolean.

SetCommunicationEnabled

Anchor link to

Turns communication with Pushwoosh on or off for the device. Switching it off stops all messaging, which makes it the action to wire to a “do not contact me” toggle.

ParameterTypeDescription
enabledBooleanTrue to allow messaging, false to stop it. Required.

Returns a Boolean.

Settings actions

Anchor link to

These actions change how the SDK behaves for this device.

SetLanguage

Anchor link to

Overrides the language Pushwoosh uses to localize messages for the device. By default the device language is used.

ParameterTypeDescription
languageStringA two-letter code such as en, de, nl. Required.

Returns a Boolean as soon as the call has been handed to the SDK.

SetReverseProxy

Anchor link to

Routes all Pushwoosh traffic through your own endpoint. Call it before Initialize, otherwise the early requests still go straight to Pushwoosh.

ParameterTypeDescription
urlStringThe proxy base URL. Required.
headersJsonStringOptional. A JSON object of extra HTTP headers.

Returns a Boolean as soon as the call has been handed to the SDK.

SetShowForegroundAlert

Anchor link to

Controls whether a notification that arrives while the app is open is shown as a system alert. The default is on, so turn it off to handle foreground notifications yourself through the On push received event of the widget.

ParameterTypeDescription
showAlertBooleanTrue to show the system alert. Required.

Returns a Boolean as soon as the call has been handed to the SDK.

GetShowForegroundAlert

Anchor link to

Tells whether a notification arriving while the app is open will be shown as a system alert. It is on by default.

Returns a Boolean.

Other channel actions

Anchor link to

These actions register the user for the messaging channels Pushwoosh supports beyond push.

RegisterSmsNumber

Anchor link to

Registers the user’s phone number so Pushwoosh can reach them over SMS.

ParameterTypeDescription
phoneNumberStringIn international format, for example +31201234567. Required.

Returns a Boolean as soon as the call has been handed to the SDK.

RegisterWhatsappNumber

Anchor link to

Registers the user’s phone number so Pushwoosh can reach them over WhatsApp.

ParameterTypeDescription
phoneNumberStringIn international format, for example +31201234567. Required.

Returns a Boolean as soon as the call has been handed to the SDK.