Customize Fallback Behavior
Android
Add input parameter exceptionHandlingType
copy
// Display a fallback error page when an exception occurs (default)
PromoView.ExceptionHandlingType.REWARDS_ENTRANCE
// Hide page when exception occurs
PromoView.ExceptionHandlingType.HIDE
Example:
copy
<com.iap.ac.android.marketing.ui.PromoView
android:id="@+id/promo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:exceptionHandling="rewards_entrance" />
copy
PromoView promoView = findViewById(R.id.promo);
promoView.setExceptionHandlingType(PromoView.ExceptionHandlingType.REWARDS_ENTRANCE);
copy
val promoView = findViewById<PromoView>(R.id.promo)
promoView.setExceptionHandlingType(PromoView.ExceptionHandlingType.REWARDS_ENTRANCE)
iOS
Configure the fallback type for the handlingType
attribute within PromoViewConfig
copy
typedef enum : NSUInteger {
// Display a fallback error page when an exception occurs (default)
PVExceptionHandlingTypeRewardsEntrance = 1,
// Hide page when exception occurs
PVExceptionHandlingTypeHide
} PVExceptionHandlingType;
Example:
copy
let config = PromoViewConfig()
config.positionId = "YOUR_POSITIONID"
config.handlingType = PVExceptionHandlingTypeHide
let promoView = PromoView(config: config)
Flutter
Add input parameter exceptionHandlingType
copy
enum ExceptionHandlingType {
// Display a fallback error page when an exception occurs (default)
rewardsEntrance(1),
// Hide page when exception occurs
hide(2);
}
Example:
copy
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
RewardsPromoWidget(
positionId: "YOUR_POSITIONID",
exceptionHandlingType: ExceptionHandlingType.hide),
const Text("Im the view under the native"),
],
),
),
);
}
Web
Add a new parameter data-exception-handling-type
with values Hide
and RewardsEntrance
. Hide
is used to hide, while RewardsEntrance
is used to implement the rewards entry.
Example:
copy
<body>
...
<div class="marketing-spot" data-position-id="YOUR_POSITIONID" data-exception-handling-type="Hide" data-dpr="1"></div>
...
</body>
Mini Program
Add a new parameter exceptionHandlingType
with values Hide
and RewardsEntrance
. Hide
is used to hide, while RewardsEntrance
is used to implement the rewards entry.
Example:
copy
<view> ... your content</view>
<ac-widget-config acWidgetVersion="LATEST_VERSION"/>
<ac-widget className="alipayplus-promo-slot" dataPositionId='YOUR_POSITIONID' exceptionHandlingType="Hide" dataDpr='2'/>
<view> ... your content</view>