Giter Site home page Giter Site logo

Comments (5)

VincentSit avatar VincentSit commented on May 13, 2024 1

Hi @ennioma , thanks for response.

I just noticed that three parameters in init are optional, I can totally omit them. What a stupid mistake. so now I don't have any problems.

BTW, I think you add default value to those parameters is good.

from arek.

ennioma avatar ennioma commented on May 13, 2024

Hi @VincentSit,
about the configuration, I agree that I could change the init to this:

public init(frequency: ArekPermissionFrequency = .OnceADay, presentInitialPopup: Bool = true, presentReEnablePopup: Bool = true)

so you can instantiate it only passing the ArekPermissionFrequency.

About the ArekLocalizationManager, I preferred to push for a convention described here. How could it help you if we make the ArekLocalizationManager public?

Thanks for using the library!

from arek.

VincentSit avatar VincentSit commented on May 13, 2024

Hi @ennioma ,

If I ignore the remaining two parameters, they will not be created automatically, you can see the call stack.

image

I think this call stack may not meet the expectations of the code design, init(identifier:) is not called, initialPopupData and reEnablePopupData are not created. The coalescing operator doesn't make sense here.

public init(configuration: ArekConfiguration? = nil,
                initialPopupData: ArekPopupData? = nil,
                reEnablePopupData: ArekPopupData? = nil) {
        
        self.configuration = configuration ?? self.configuration
        self.initialPopupData = initialPopupData ?? self.initialPopupData
        self.reEnablePopupData = reEnablePopupData ?? self.reEnablePopupData
    }

from arek.

ennioma avatar ennioma commented on May 13, 2024

I think the stack is correct because the function signature is init(configuration:initialPopupData:reEnablePopupData). Could you please show me how do you call that?

from arek.

VincentSit avatar VincentSit commented on May 13, 2024

Hi @ennioma ,

let configuration = ArekConfiguration(frequency: .OnceAWeek, presentInitialPopup: true, presentReEnablePopup: true)
let arek = ArekNotifications(configuration: configuration)
arek.manage { Log.info("APNs permission is \($0)") }

from arek.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.