NeoDay Android SDK - Reward Shop
The NeoDaySDK
factory methods are executed asynchronously in order to fetch the data and return a NeoDayViewController
.
/**
* @param completion returns NeoDayViewController or an ExceptionException
*/
fun makeRewardShop(completion: (Result<NeoDayViewController>) -> Unit)
/**
* @param completion returns NeoDayViewController or an ExceptionException
*/
fun makeRewardShopOrderHistory(completion: (Result<NeoDayViewController>) -> Unit)
Directly requesting a Reward Shop screen
val vc = remember { mutableStateOf<NeoDayViewController?>(null) }
neoDaySDK.makeRewardShop { result ->
try {
vc.value = result.getOrThrow()
} catch (ex: Exception) {
ex.printStackTrace()
}
}
vc.value?.getView()?.invoke()
Directly requesting a Reward Shop Order History screen
val vc = remember { mutableStateOf<NeoDayViewController?>(null) }
neoDaySDK.makeRewardShopOrderHistory { result ->
try {
vc.value = result.getOrThrow()
} catch (ex: Exception) {
ex.printStackTrace()
}
}
vc.value?.getView()?.invoke()
Directly requesting a Reward Shop Cart screen
// Since NeoDaySDK 1.16.6
val vc = remember { mutableStateOf<NeoDayViewController?>(null) }
neoDaySDK.makeRewardShop(RewardShopAction.ShowCart) { result ->
try {
vc.value = result.getOrThrow()
} catch (ex: Exception) {
ex.printStackTrace()
}
}
vc.value?.getView()?.invoke()
Directly requesting a Reward Shop Product Detail screen
// Since NeoDaySDK 1.16.6
val vc = remember { mutableStateOf<NeoDayViewController?>(null) }
neoDaySDK.makeRewardShop(RewardShopAction.ShowProductDetail(<productId>)) { result ->
try {
vc.value = result.getOrThrow()
} catch (ex: Exception) {
ex.printStackTrace()
}
}
vc.value?.getView()?.invoke()
Navigating to Reward Shop Cart using an existing Reward Shop ViewController
// Since NeoDaySDK 1.16.6
viewModel.rewardShopViewController.value?.getView()?.invoke()
LaunchedEffect(action) {
neoDaySDK.executeRewardShopAction(RewardShopAction.ShowCart)
}
Navigating to Reward Shop Product Detail using an existing Reward Shop ViewController
// Since NeoDaySDK 1.16.6
viewModel.rewardShopViewController.value?.getView()?.invoke()
LaunchedEffect(action) {
neoDaySDK.executeRewardShopAction(RewardShopAction.ShowProductDetail(<productId>))
}
Applying DismissalStyle.Back to the Reward Shop
// Since NeoDaySDK 2.1.5
if (viewController is RewardShopDismissStyling) {
viewController.dismissalStyle = DismissalStyle.Back
}
Applying DismissalStyle.Close to the Reward Shop
// Since NeoDaySDK 2.1.5
if (viewController is RewardShopDismissStyling) {
viewController.dismissalStyle = DismissalStyle.Close
}
Applying DismissalStyle.None to the Reward Shop
// Since NeoDaySDK 2.1.5
if (viewController is RewardShopDismissStyling) {
viewController.dismissalStyle = DismissalStyle.None
}
Payment Service Provider integration
Reference: custom domain
For the payment flow via a PSP to work, the customer will need to:
Provide NeoDay with the required values for the Android app, including the namespace (application ID), package name, and SHA-256 certificate fingerprints. These details are used to create the assetlinks.json file, which enables domain verification. Add the 'custom' or 'long form' client-web URL as a host entry in the app configuration — this allows the app to handle return links after a payment is completed. The long form typically uses a NeoDay domain (e.g. neoday.web.location.neoday.cloud), or a custom domain (e.g. loyalty.company.com). Ensure the app is capable of receiving and handling these links by properly setting up an intent-filter in the Android manifest. This allows the app to automatically open when the user is redirected back from the PSP or banking app.