Unofficial Content

The GeneXusSuperApps module is intended for the development of Super Apps with GeneXus. It implements the following functionalities:

  1. Allow the Super App to query the Mini App catalog in the Mini App Center, filtering by several criteria.
  2. Allow a Super App to load a Mini App and transition to it.
  3. Mini App cache management.

Detail

The GeneXusSuperApps module is compound by two External Objects:

  • MiniApps
  • Provisioning

And these helpers as Structured Data Types (SDTs):

  • MiniAppInformation
  • CachedMiniApp

Note that the External objects are only available when running in a Super App. If the app is not a Super App, or called from a Mini App, then all methods will fail.

Helper Data Types

MiniAppInformation SDT

It is an SDT containing the detailed information of a Mini App.

The following members are part of this SDT (there may be more if needed):

  • Id: String - the Mini App identifier as required by the Load method (see below)
  • Name: String - the Mini App's human-readable name
  • Description: String - a short description of the Mini App
  • Metadata: URL - URL pointing to the Mini App metadata
  • EntryPoint: String - Mini App main name
  • ServiceURL: URL - URL pointing to the Mini App backend service URL
  • Signature: String - Mini App signature
  • Version: Integer - Mini App version
  • Icon: Image - an application icon for the Mini App
  • Banner: Image - an alternative image for promoting or featuring the Mini App
  • Card: Image - an alternative image to present the Mini App in the Super App

Provisioning External Object

It includes the following properties and methods:

Properties

ProvisioningURL: URL

Read-only property returning the provisioning server's URL of the Mini App Center.

Methods

These methods allow the Super App to query the Mini App catalog in the Mini App Center, filtering with various criteria. You need to configure the super application properties to access the corresponding catalog (*).

Notes on returned MiniAppInformation fields:

  • Metadata & ServiceURL are required (should not be empty)
  • Icon, Banner & Card are optional (can be empty) and could be relative URLs. In case URLs are relative, Provisioning implementations transform URLs to absolute, being URLs relative to ProvisioningURL.
GetByText(&text, &start, &count): collectionOf(MiniAppInformation)

Returns the list of Mini Apps that match the given text criteria. The search is performed by doing a full-text search on the Mini Programs (name, title, description).

Parameters:

  • &text: String - The string with the search criteria.
  • &start: Integer - 0-based index from which elements will be returned.
  • &count: Integer - maximum number of returned elements ( 0 means all ).

Returns:

  • A collection of MiniAppInformation.
GetByLocation(&geopoint, &radius, &start, &count): collectionOf(MiniAppInformation)

Returns the list of Mini Apps that are available inside the circular region with the center in the given &geopoint and a maximum radius given by &radius.

Parameters:

  • &geopoint: Geopoint - The center point of the specified region.
  • &radius: Numeric - The radius in meters of the circular region.
  • &start: Integer - 0-based index from which elements will be returned.
  • &count: Integer - maximum number of returned elements ( 0 means all ).

Returns:

  • A collection of MiniAppInformation.
GetByTag(&tag, &start, &count): collectionOf(MiniAppInformation)

When registering a Mini App in the Mini App Center, several tags can be declared. This method will look for exact matches for the given tag.

Parameters:

  • &tag: String - The tag to search for.
  • &start: Integer - 0-based index from which elements will be returned.
  • &count: Integer - maximum number of returned elements ( 0 means all ).

Returns:

  • A collection of MiniAppInformation.
GetFeatured(&start, &count): collectionOf(MiniAppInformation)

Return the list of Mini Apps declared as featured in a time window (validFrom <= &today =< validTo).

Parameters:

  • &start: Integer - 0-based index from which elements will be returned.
  • &count: Integer - maximum number of returned elements ( 0 means all ).

Returns:

  • A collection of MiniAppInformation.
GetById(&Id): MiniAppInformation

Returns the Mini Apps corresponding to the given Id.

Parameters:

  • &Id: String - Mini App Id

Returns:

  • MiniAppInformation SDT.

MiniApps External Object

It includes the following properties and methods:

Properties

IsSandboxEnvironment: Boolean

Can be used to have a conditional code in the API exposed to the Mini App according to the Super App execution mode.

CurrentMiniAppId: MiniAppId

This property can be used to identify which Mini App is called the Super App API.

The CurrentMiniAppId property returns the identifier of the running Mini App. This property proves useful in scenarios where a Mini App redirects to the Super App through the Super App API, and it becomes essential to determine the originating Mini App in that context.

For instance, in the VerdantBank KB, CurrentMiniAppId is used to identify the Mini App from which the call to the Super App is made to process payments. When CurrentMiniAppId returns an empty value, it can be assumed that it is not executing within the context of a Mini App.

This property can be employed in the KBObject implementing the API call method, along with the entire tree of client-side calls made by this object. These include client-side events of menus and panels or explicitly called offline objects.

Methods

The available methods are:

Load(in: &MiniAppInformation)

Loads a Mini App and transitions to it.

Parameters:

  • &MiniAppInformation: SDT - Input parameter with the Mini App information, as previously defined. The following validations should be performed on MiniAppInformation fields, otherwise, load should fail:
    • EntryPoint should have the format {GUID}-{Name}, where {GUID} is the GUID of the KBObject type (currently valid are Panel and Menu (ex Dashboard)).
    • Signature should not be empty and should be valid for the downloaded metadata from URL in Metadata field (If cached, no re-validation is required).

If the Mini App does not exist in the Mini App Center, or if it is not compatible with the current version of the Super App, the method call fails (aborting the composite block when appropriate).

Info: The event where you include the Load Method cannot subsequently contain invocations to other Super App's objects (Procedures, Data Providers, Panels). This is because at that moment, there's a context shift from the Super App to the Mini App, and therefore, it's not possible to guarantee that those requests can be attended..

LoadSandbox()

Loads a Mini App in sandbox mode. Mini App version must be under Review at the Mini App Center in order to scan its QR code.

Warning: It is NOT recommended to distribute applications with this method to production, since it must be used internally by the Super App administrative organization to test the developed Mini Apps.

GetCached(): collectionOf(&CachedMiniApp)

To get a list of the Mini Apps in the cache.

RemoveCached(&miniAppId, &miniAppVersion): boolean.

Used to delete a specific Mini App from the cache.

ClearCached(): boolean.

To delete all the Mini Apps from the cache.

Install

You have to install GeneXusSuperApp module using the Manage Module References dialog from the Knowledge Manager option (located in the GeneXus IDE toolbar).

Availability

GeneXus Beta

Scope

Generators: Apple, Android

 

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant