Comments (5)
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.
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.
Hi @ennioma ,
If I ignore the remaining two parameters, they will not be created automatically, you can see the call stack.
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.
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.
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)
- Cannot convert value of type '(_) -> ()' to expected argument type '(() -> Void)?' HOT 1
- ArekNotifications::status(completion:) not exhaustive HOT 5
- New UNAuthorizationStatus case not supported HOT 1
- iOS12 branch is unusable due to Swift4.2-incompatbile PMAlertController HOT 12
- Carthage release 4.0.2 failed to build due Example Pods files HOT 1
- Apple is rejecting binaries with arek installed HOT 5
- Enhancement request: completion handler on the re-enable popup HOT 2
- Health permission caused the banning of appstore review HOT 4
- How to remove AreyLocationAlways Permission
- Compile error iOS 14.0.1: ArekPhoto.swift, Switch must be exhaustive, .limited HOT 1
- Package Resolution Failed
- When permissions denied, go to settings on request HOT 2
- Demo crash when click ArekMicrophone HOT 9
- feature request: i18n HOT 5
- How to adjust configuration values? HOT 3
- [Notification] Should I call UIApplication.shared.registerForRemoteNotifications() by myself? HOT 3
- Sample project HOT 3
- Motion ignores the initial prompt, goes straight to system prompt HOT 7
- How to add sound to ArekNotifications permission? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arek.