UNPKG

@ua/react-native-airship

Version:
43 lines (39 loc) 1.29 kB
"use strict"; /** * Airship Preference Center. */ export class AirshipPreferenceCenter { constructor(module) { this.module = module; } /** * Requests to display a preference center. * * Will either emit an event to display the * Preference Center if auto launch is disabled, * or display the OOTB UI. * @param preferenceCenterId The preference center Id. * @returns A promise. */ display(preferenceCenterId) { return this.module.preferenceCenterDisplay(preferenceCenterId); } /** * Gets the preference center config. * @param preferenceCenterId The preference center Id. * @returns A promise with the result. */ getConfig(preferenceCenterId) { return this.module.preferenceCenterGetConfig(preferenceCenterId); } /** * Enables or disables showing the OOTB UI when requested to display by either * `display` or by a notification with some other action. * @param preferenceCenterId The preference center Id. * @param autoLaunch true to show OOTB UI, false to emit events. */ setAutoLaunchDefaultPreferenceCenter(preferenceCenterId, autoLaunch) { return this.module.preferenceCenterAutoLaunchDefaultPreferenceCenter(preferenceCenterId, autoLaunch); } } //# sourceMappingURL=AirshipPreferenceCenter.js.map