presentCustomerCenter static method
Future<void>
presentCustomerCenter({
- CustomerCenterRestoreStarted? onRestoreStarted,
- CustomerCenterRestoreCompleted? onRestoreCompleted,
- CustomerCenterRestoreFailed? onRestoreFailed,
- CustomerCenterManageSubscriptions? onShowingManageSubscriptions,
- CustomerCenterRefundRequestStarted? onRefundRequestStarted,
- CustomerCenterRefundRequestCompleted? onRefundRequestCompleted,
- CustomerCenterFeedbackSurveyCompleted? onFeedbackSurveyCompleted,
- CustomerCenterManagementOptionSelected? onManagementOptionSelected,
- CustomerCenterCustomActionSelected? onCustomActionSelected,
Presents the customer center modally using the native SDKs.
Provide callback handlers to receive customer center lifecycle events. All handlers are optional.
Implementation
static Future<void> presentCustomerCenter({
CustomerCenterRestoreStarted? onRestoreStarted,
CustomerCenterRestoreCompleted? onRestoreCompleted,
CustomerCenterRestoreFailed? onRestoreFailed,
CustomerCenterManageSubscriptions? onShowingManageSubscriptions,
CustomerCenterRefundRequestStarted? onRefundRequestStarted,
CustomerCenterRefundRequestCompleted? onRefundRequestCompleted,
CustomerCenterFeedbackSurveyCompleted? onFeedbackSurveyCompleted,
CustomerCenterManagementOptionSelected? onManagementOptionSelected,
CustomerCenterCustomActionSelected? onCustomActionSelected,
}) async {
_setMethodChannelHandlerIfNeeded();
final hasCallbacks = onRestoreStarted != null ||
onRestoreCompleted != null ||
onRestoreFailed != null ||
onShowingManageSubscriptions != null ||
onRefundRequestStarted != null ||
onRefundRequestCompleted != null ||
onFeedbackSurveyCompleted != null ||
onManagementOptionSelected != null ||
onCustomActionSelected != null;
await _clearCustomerCenterCallbacks();
if (hasCallbacks) {
await _registerCustomerCenterCallbacks(
onRestoreStarted: onRestoreStarted,
onRestoreCompleted: onRestoreCompleted,
onRestoreFailed: onRestoreFailed,
onShowingManageSubscriptions: onShowingManageSubscriptions,
onRefundRequestStarted: onRefundRequestStarted,
onRefundRequestCompleted: onRefundRequestCompleted,
onFeedbackSurveyCompleted: onFeedbackSurveyCompleted,
onManagementOptionSelected: onManagementOptionSelected,
onCustomActionSelected: onCustomActionSelected,
);
}
await _methodChannel.invokeMethod('presentCustomerCenter');
}