Comments (7)
Ok found it! Let me work on this and I'll let you know.
from arek.
Hi @multinerd,
You can update ArekCellVMServiceProgrammatically as follow:
`import Foundation
import arek
class ArekCellVMServiceProgrammatically {
static private var permissions = [
["popupDataTitle": "Media Library Access - native", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Camera Access - PMAlertController", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Location Always Access - native", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
["popupDataTitle": "Motion - PMAlertController", "allowButtonTitle": "Allow 👍🏼", "denyButtonTitle": "No! 👎🏼", "enableTitle": "Please!", "reEnableTitle": "Re-enable please!"],
]
static func numberOfVMs() -> Int {
return self.permissions.count
}
static func buildVM(index: Int) -> ArekCellVM {
let data = permissions[index]
let configuration = ArekConfiguration(frequency: .OnceADay, presentInitialPopup: true, presentReEnablePopup: true)
let initialPopupData = ArekPopupData(title: data["popupDataTitle"]!, message: data["enableTitle"]!, image: "", allowButtonTitle: data["allowButtonTitle"]!, denyButtonTitle: data["denyButtonTitle"]!, type: getPopuptType(index: index))
let reenablePopupData = ArekPopupData(title: data["popupDataTitle"]!, message: data["reEnableTitle"]!, image: "", allowButtonTitle: data["allowButtonTitle"]!, denyButtonTitle: data["denyButtonTitle"]!, type: getPopuptType(index: index))
let permission = getPermissionType(index: index, configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reenablePopupData)
return ArekCellVM(permission: permission!, title: data["popupDataTitle"]!)
}
static private func getPopuptType(index: Int) -> ArekPopupType {
switch index {
case 0:
return .native
case 1:
return .codeido
case 2:
return .native
case 3:
return .codeido
default:
return .native
}
}
static private func getPermissionType(index: Int, configuration: ArekConfiguration, initialPopupData: ArekPopupData, reEnablePopupData: ArekPopupData) -> ArekPermissionProtocol? {
switch index {
case 0:
return ArekMediaLibrary(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
case 1:
return ArekCamera(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
case 2:
return ArekLocationAlways(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
case 3:
return ArekMotion(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)
default:
return nil
}
}
}
`
As you can see I've just appended another permission for you. You have to consider that this doesn't work on simulator.
Let me know if it works for you!
from arek.
Same thing on my side. it prompts for permission on app launch, so by the time i click the cell, i would have already burned my only ios request.
In other words, the framework is completely bypassed.
from arek.
Hi @multinerd,
I think I've fixed this issue in #91, could you please check if the new logic from that branch works for you?
from arek.
@ennioma I've moved over from the iOS project i was working on to a C# desktop version. Ill be able to test it this weekend and let you know.
from arek.
@multinerd In the meanwhile I've merged it to develop
. So you can checkout it.
If everything is fine in the weekend I'll deliver another release.
from arek.
Sorry, i lost track. The latest in the develop
branch seems to be working as expected.
from arek.
Related Issues (20)
- Cannot convert value of type '(_) -> ()' to expected argument type '(() -> Void)?' HOT 1
- ArekNotifications::status(completion:) not exhaustive HOT 5
- Consider making the configuration, initialPopupData and reEnablePopupData public. 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
- 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.