You can render the Loyalty Page
component as a standalone page, suitable for use in a WebView (such as in a
mobile app). This is simpler than embedding your storefront page and is
optimized for mobile devices.
The Loyalty Page will be rendered using the same Theme Editor customisations as
it does on your storefront, i.e. the order & visibility of sections, brand
colors, etc. Any custom CSS delivered as part of your storefront theme will not
be applied.Not all rules and rewards will be available: we’ll only render those that are
suitable for use inside a WebView.
You can use the WebView Session API
to create a short-lived WebView session for a site. This session includes a
URL that can be used as the source for a WebView to render a complete Loyalty Page.
This is a server-side API and must be called from a secure server, using an
API key or OAuth token. You cannot call this API directly from a client-side
app.
If a customer is logged in, you should include their ID and email when creating a
session. The resulting WebView session URL will render for that customer, allowing
them to view their points and redeem rewards. If you don’t include a customer,
the guest Loyalty Page will be rendered.The URL included in the WebView session will expire after a few minutes, so it
should not be saved or reused. You should create a new session each time you need to
render the WebView.
Once you’ve acquired a WebView URL, you can render it in an iOS or Android WebView, and
register various message handlers to support more advanced functionality such as
adding discount codes or free products to the cart, depending on the ecommerce platform.