+
Skip to content

Consider making the configuration, initialPopupData and reEnablePopupData public. #118

@VincentSit

Description

@VincentSit

Hi, thanks for sharing this library.

I have a question. I just want to change the frequency property of the configuration, but write a lot of unnecessary duplicate code. It doesn't seem elegant enough.

The ArekLocalizationManager is also not public, so it is not possible to construct data using it.

I wonder if we can make them public so that we can easily change the values.

func askForPermission() {
    let tmp = ArekNotifications()
    let configuration = ArekConfiguration(frequency: .OnceAWeek, presentInitialPopup: true, presentReEnablePopup: true)
    let initialPopupData = ArekPopupData(title: R.string.localizable.arekNotifications_initial_title(),
                                         message: R.string.localizable.arekNotifications_initial_message(),
                                         image: "\(tmp.identifier)_image",
                                         allowButtonTitle: R.string.localizable.arekNotifications_allow_button_title(),
                                         denyButtonTitle: R.string.localizable.arekNotifications_deny_button_title(),
                                         styling: nil)
    let reEnablePopupData = ArekPopupData(title: R.string.localizable.arekNotifications_reenable_title(),
                                          message: R.string.localizable.arekPhoto_reenable_message(),
                                          image: "\(tmp.identifier)_image",
                                          allowButtonTitle: R.string.localizable.arekNotifications_allow_button_title(),
                                          denyButtonTitle: R.string.localizable.arekNotifications_deny_button_title(),
                                          styling: nil)
    let arek = ArekNotifications(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
    arek.manage { Log.info("APNs permission is \($0)") }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载