Giter Site home page Giter Site logo

ennioma / arek Goto Github PK

View Code? Open in Web Editor NEW
951.0 18.0 64.0 5.12 MB

AREK is a clean and easy way to request any kind of iOS permission (with some nifty features ๐Ÿค–)

License: MIT License

Ruby 2.75% Swift 95.99% Objective-C 1.25%
permission healthkit bluetooth cloudkit popup

arek's People

Contributors

alexanderwallin avatar augustorsouza avatar bcylin avatar datouhsu avatar ennioma avatar erikolsson avatar evermeer avatar mouhcine avatar muescha avatar pasevin avatar readmecritic avatar robbiet480 avatar vincentsit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arek's Issues

Add CloudKit discoverability permissions.

For adding CloudKit discoverability permissions you could use this code. You do have to be aware that this is an async call.

        let container = CKContainer.default()
        container.status(forApplicationPermission: CKApplicationPermissions.userDiscoverability, completionHandler: { applicationPermissionStatus, error in
                 // handle applicationPermissionStatus for statuses like
                 // CKApplicationPermissionStatus.Granted, .Denied, .CouldNotComplete, .InitialState
        })


        let container = CKContainer.default()
        container.accountStatus(completionHandler: {status, error in
            switch status {
            case .available, .restricted:
                container.requestApplicationPermission(CKApplicationPermissions.userDiscoverability,  completionHandler: { applicationPermissionStatus, error in
                          // handle applicationPermissionStatus for statuses like CKApplicationPermissionStatus.Granted, .Denied, .CouldNotComplete, .InitialState
                })
            case .couldNotDetermine, .noAccount: break
                // Ask user to login to iCloud
            }
        })

[Notification] Should I call UIApplication.shared.registerForRemoteNotifications() by myself?

When I try to register notification through the code below
open func askForPermission(completion: @escaping ArekPermissionResponse) (ArekNotifications.swift:60)

On iOS10, I cannot get device token while I can on iOS9.
I guess it is because UIApplication.shared.registerForRemoteNotifications() is not called on iOS10.
Am I right or missing something?

I'm using v.1.3.0.
Thank you for reading.

Package Resolution Failed

Hi,

I'm new to Swift/iOS development so I probably am just missing something but I get an error when I try to install the package using the package manager:

because arek >=0.9.1 contains incompatible tools version and root depends on arek 4.0.2..<5.0.0, version solving failed.

How can I solve this?

Thanks

Install from pod

Hi,

I try to use your library via pod install.

i have problem, all classes are not available, visibility are not public class and can't be used outside your module itself.

(And why in your readme, you use EMClass ? What this ? Your class are named ArekPhoto, can you explain?)

Regards

Motion ignores the initial prompt, goes straight to system prompt

Using the sample project, ive added a NSMotionUsageDescription and changed the file ArekCellVMServiceProgrammatically.swift replaceing the line

return ArekLocationAlways(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)

with

return ArekMotion(configuration: configuration, initialPopupData: initialPopupData, reEnablePopupData: reEnablePopupData)

and the system prompt gets called on app launch. I havent looked into CoreMotion that much so im not sure if it can be called any other time.

Ill update if i find anything out.

Cannot convert value of type '(_) -> ()' to expected argument type '(() -> Void)?'

I keep getting that error message upon any cocoapods install.

I am using Xcode 9.3 beta and swift 4, but I added
this to the podfile....

post_install do |installer|
  # List of Pods to use as Swift 3.2
  myTargets = ['arek/Location']

  installer.pods_project.targets.each do |target|
    if myTargets.include? target.name
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '3.2'
      end
  end

any hints on thoughts on what could be foul?

Consider making the configuration, initialPopupData and reEnablePopupData public.

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)") }
  }

iOS12 branch is unusable due to Swift4.2-incompatbile PMAlertController

Currently, PMAlertController is spewing a lot of errors during build on a Swift4.2 project due to Swift 4.2 changes. I've gotten around this by doing the following:

  1. Removing the version requirement of the s.dependency in the Podspec
  2. Installing PMAlertController via a fork which has been updated for Swift4.2
  3. Configuring my Podfile like this so that arek has access to PMAlertController:
pod 'PMAlertController', :git => 'https://github.com/gorbat-o/PMAlertController.git', :branch => 'swift4.2'
pod 'arek', :git => 'https://github.com/robbiet480/arek.git', :branch => 'iOS12'

IOS10 Minimum Podspec

Just checking if there's any reason why it needs to be IOS10 minimum on the pod-spec, can't it be 9+ ?

How to add sound to ArekNotifications permission?

    open func askForPermission(completion: @escaping ArekPermissionResponse) {
        if #available(iOS 10.0, *) {
            UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge]) { (granted, error) in

For iOS10 and above only the alert and badge is requested, how to add the sound permission?
Thank you.

Apple is rejecting binaries with arek installed

Just received this email from Apple upon uploading the first build of Home Assistant for iOS with arek installed:

Dear Developer,

We identified one or more issues with a recent delivery for your app, "Home Assistant Companion". Please correct the following issues, then upload again.

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSContactsUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSCalendarsUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSBluetoothPeripheralUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSMicrophoneUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSAppleMusicUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSSpeechRecognitionUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSHealthShareUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSHealthUpdateUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Best regards,

The App Store Team

So I guess as of Spring 2019, README.md should only contain instructions on installing the specific pieces of arek needed for the app... My binary has been marked as invalid until I fix this. Not sure when this started causing error emails but it feels recent.

Carthage release 4.0.2 failed to build due Example Pods files

Arek 4.0.2 project file references Example Pods files, resulting in a failed build with Carthage.

error: /*/Carthage/Checkouts/arek/Example/Pods/Target Support Files/arek/arek.xcconfig: unable to open file (in target "arek" in project "Pods") (in target 'arek')

Build system information
error: /*/Carthage/Checkouts/arek/Example/Pods/Target Support Files/arek/arek.xcconfig: unable to open file (in target "arek" in project "Pods") (in target 'arek')

Build system information
error: /*/Carthage/Checkouts/arek/Example/Pods/Target Support Files/arek/arek.xcconfig: unable to open file (in target "arek" in project "Pods") (in target 'arek')

Build system information
error: missing module map file: '/*/Carthage/Checkouts/arek/Example/Pods/Target Support Files/arek/arek.modulemap (in target 'arek')

** ARCHIVE FAILED **
Build settings from command line:
    CARTHAGE = YES
    CLANG_ENABLE_CODE_COVERAGE = NO
    CODE_SIGN_IDENTITY = 
    CODE_SIGNING_REQUIRED = NO
    GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphoneos12.0
    SKIP_INSTALL = YES
    STRIP_INSTALLED_PRODUCT = NO

Health permission caused the banning of appstore review

The HealthKit codes made Apple to reject my app, it said:
"We noticed that your app uses HealthKit, but your app does not appear to include any primary features that require health or fitness data.

The intended use of HealthKit is to share health or fitness data with other apps or devices, and it should be used only in apps that require this data as a part of the app's core functionality. "

After I remove Arek, it's passed. So I think you should know about this.

When permissions denied, go to settings on request

If permissions where denied and the user still clicks on the permission to enable it, then you could ask if the user wants to go to the settings to change the permissions. You could then do a quick open of the settings app using:

        UIApplication.shared.openURL(URL(string: UIApplicationOpenSettingsURLString)!)

Enhancement request: completion handler on the re-enable popup

It would be nice to be able to perform an action if the user denies the re-enable popup.

Right now, .denied is called only when the manage() function is initially called, not after the user denies the re-enable popup. Either way, there would be no clean way to discern between the two .denied statuses if .denied did call a second time.

ArekNotifications::status(completion:) not exhaustive

ArekNotifications.swift ArekNotifications::status(completion:) for iOS 10.0 switch is not exhaustive

Need to add case .provisional: return completion(.authorized) or create a new ArekPermissionResponse to provide for provisional cases
(lines 43-53, ArekNotifications.swift)

IMO, you can just set it to authorized, it is on the user to check the status, and when provisional has been revoked, it should return to .denied

Split into multiple Podspecs

Just referencing some code (Health stuff) even if you don't use it requires users to add special authorization to their PLIST. You can get around this, and reduce your library size by splitting it into multiple targets like this library.

How to adjust configuration values?

Hello, arek people. Thanks for the great open source.

I'm trying to adjust the value of configuration declared in ArekBasePermission.
But when I access to configuration property in my project, compile error took place asserting this message. " 'configuration' is inaccessible due to its internal protection level"

Is there anyway to modify configuration of permission objects not by modify code in Arek.swift directly?

P.S. I'm not a native English speaker. So I'm not sure my issue report delivers the issue I experienced.

Why does `status` use a callback?

When would asking for a permission be asynchronous? All of the permissions in this repository which I looked at are not asynchronous. Seems like an unnecessary evil, doesn't it?

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.