RedeemPointView
Introduction#
Use this built-in view to allow your users to spend loyalty points for shopping. Users can click on it to open RedeemPointPopup - which shows their loyalty account balance, and choose a number of points to use.
Usage#
- Android
- iOS
Prerequiresite#
To use loyalty-component, the main app needs to use androidx component for its fragment/activity:
Add LoyaltyRedeemPointView to your layout#
Setting up the controller in activity/fragment#
There is a note when we use the LoyaltyRedeemPointView. When we add that view to our screen, it will fetch data of member automatically. This process can cause some errors like network connect... In these cases, that view will notify error to the client via callback. The client can show dialog or something for these errors and try to reload LoyaltyRedeemPointView by reload method.
- Setup in Activity
- Or setup in Fragment
Usage#
You can embed LoyaltyRedeemPointView as a subview in .xib files, or can create it programatically.
LoyaltyRedeemPointView use LoyaltyRedeemPointController as its controller.
- Step 1: Create an instance of LoyaltyRedeemPointController
- Step 2: Set that instance for
redeemPointView - Step 3: Call method
controller.enable()
When controller.enable(), it will get network config and member info.
In case there is an error, client app can call controller.reload() to retry request these data.
The parent ViewController must conform to LoyaltyRedeemPointDelegate
RedeemPointError includes these cases: