Ionic Action Buttons

Configuring Action Buttons

When creating mobile push notifications, you can add action buttons.

  • iOS supports up to 4 buttons.
  • Android supports up to 3 buttons.

Use unique Action ID values for different buttons.

ParameterNotes
Action IDUnique button action identifier
TextText shown on the button
iOS icon pathAvailable on iOS 15+. Name of image from app bundle
Launch URLURL/deeplink to open
Custom dataAdditional JSON payload

Handle Action Button Click

iOS

Enable handler:

await this.reteno.setNotificationActionHandler({ emitEvent: true });
// or equivalently:
await this.reteno.setNotificationActionHandler({ enabled: true, emitEvent: true });

Any other value (false, null, true, { enabled: true } without emitEvent) clears the handler.

Subscribe:

The plugin delivers the event through document.addEventListener('reteno-push-button-clicked', ...), so the listener receives a DOM CustomEvent whose detail field matches RetenoPushButtonClickedPayload:

const onPushButtonClicked = (event: any) => {
  const detail = event?.detail ?? event;
  console.log('reteno-push-button-clicked:', detail);
  // detail.actionId   — unique button action identifier
  // detail.link       — URL/deeplink associated with the button (may be null)
  // detail.customData — additional JSON from the button (object, or raw string on Android)
  // detail.userInfo   — original notification payload
};

this.reteno.setOnRetenoPushButtonClickedListener(onPushButtonClicked);

// later
this.reteno.removeOnRetenoPushButtonClickedListener(onPushButtonClicked);

Disable:

await this.reteno.setNotificationActionHandler(false);

Android

setNotificationActionHandler(...) is no-op on Android. Action button clicks are detected automatically.