Migration from 2.3.x to 2.4.x
This guide provides instructions for migrating from Wultra Mobile Token SDK for iOS version 2.3.x to version 2.4.x.
Version 2.4.x introduces a new, extensible Pre‑approval UI Template and replaces the legacy singular screen with a plural model. The goal is to make the UI configurable (images/icons/buttons/alerts) while keeping app code simple.
Added Functionality
- 
    Multiple Pre‑approval Screens 
 The singularpreApprovalScreenis replaced bypreApprovalScreens: [WMTPreApprovalScreen].
- New Screen Fields
 Each screen may now specify:- id: String?- unique identifier for the screen
- backButton: Bool?- when true, show a back button in navigation bar instead of using decline as “back”
- image: String?- asset identifier to be mapped in the app
 
- 
    Structured Screen Content 
 Each screen can include typedelements(LIST_ITEM,ALERT,BUTTON) and configurablecontrols(approve/decline UI).
- Configurable Controls
    - declineis optional (- type: BACK | REJECT, optional- text)
- approveis optional (- type: SLIDER | BUTTON, optional- text, optional- counter). Apps should provide a default approve control if missing. The counter defines how long (in seconds) the approve control remains disabled after the screen appears.
- axis: HORIZONTAL | VERTICALand- flip: Boolcontrol layout order/stacking
 
- Configurable Visuals
    - Screen imageand list itemiconare resolved from app assets (e.g., SVG).
 
- Screen 
- Reject method
    - The OperationsService reject method now also accepts mobileTokenData, just like confirm. If applicable, these values should be attached to WMTOperation when calling confirm/reject methods.
 
- New RejectionReason
    - New rejection reason PREAPPROVALindicates the user cancelled the operation during the Pre-Approval flow.
 
- New rejection reason 
Removed / Changed Functionality
- Singular Pre‑approval Removed from WMTOperationUIData
    - Removed: preApprovalScreen(object withitemsandapprovalType)
- Replaced by: preApprovalScreens: [WMTPreApprovalScreen]
 
- Removed: 
- Ad‑hoc Fields Removed
    - Removed: items: [String]→ useelementswithtype: "LIST_ITEM"andtext
- Removed: approvalType→ usecontrols.approve.type(SLIDERorBUTTON)
 
- Removed: 
- Legacy Fallback Behavior
    - If plural is present, singular is ignored.
- 
        If plural is absent, the SDK still converts the legacy singular via fromLegacy, but your app’s model must be updated.
 
Server / JSON Migration
Before (2.3.x – singular):
{
  "flipButtons": true,
  "blockApprovalOnCall": false,
  "preApprovalScreen": {
    "type": "WARNING",
    "heading": "Watch out!",
    "message": "You may become a victim of an attack.",
    "items": [
      "You activate a new app and allow access to your accounts",
      "Make sure the activation takes place on your device",
      "If you have been prompted for this operation in connection with a payment, decline it"
    ],
    "approvalType": "SLIDER"
  }
}
After (2.4.x – plural):
{
  "flipButtons": true,
  "blockApprovalOnCall": false,
  "preApprovalScreens": [
    {
      "id": "custom_id",
      "type": "WARNING",
      "backButton": true,
      "image": "image-label",
      "heading": "Watch out!",
      "message": "You may become a victim of an attack.",
      "elements": [
        { "id": "e1", "type": "ALERT", "style": "INFO", "text": "Make sure the activation takes place on your device" },
        { "id": "e2", "type": "BUTTON", "action": "PHONE", "text": "Call center", "href": "+42012345678" },
        { "id": "e3", "type": "LIST_ITEM", "icon": "icon-label", "text": "You activate a new app and allow access to your accounts" }
      ],
      "controls": {
        "flip": true,
        "axis": "VERTICAL",
        "decline": { "type": "REJECT", "text": "Reject Payment" },
        "approve": { "type": "BUTTON", "text": "Approve Payment", "counter": 10 }
      }
    },
    {
      "id": "qr1",
      "type": "QR_SCAN",
      "heading": "Watch out!",
      "message": "You may become a victim of an attack."
    }
  ]
}
Migration Checklist
- Replace preApprovalScreen→preApprovalScreens.
- Replace items→elementsof typeLIST_ITEM.
- Map approvalType→controls.approve.type.
- Use id,backButton,imagewhen present.
- For ease of use, consider using new RejectionReason PREAPPROVALwhen rejecting operations during pre-approval screens flow.
Last updated on Oct 10, 2025 (09:01)
    
    Edit on Github
    
    Send Feedback