GithubHelp home page GithubHelp logo

sparrowcode / permissionskit Goto Github PK

View Code? Open in Web Editor NEW
5.6K 94.0 459.0 109.43 MB

Universal API for request permission and get its statuses.

Home Page: https://x.com/sparrowcode_ios

License: MIT License

Ruby 7.90% Swift 92.10%
permission permissions ios request sparrow location notification camera photo-gallery ui

permissionskit's People

Contributors

alexanderpuchta avatar angcosmin avatar cozzin avatar damarte avatar dan12411 avatar ddomovoj avatar devsc avatar dlackty avatar duyhungtnn avatar evaanp avatar hengyu avatar ivanvorobei avatar jminutaglio avatar jobinsjohn avatar juanillo62gm avatar matrixsenpai avatar mohammad-rahchamani avatar moyoteg avatar neobeppe avatar oggerschummer avatar ostatnicky avatar romanpodymov avatar rsickenberg avatar sagaya avatar semty avatar srujanadicharla avatar strobocop avatar svyatoynick avatar tomkremer avatar utsavdave97 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  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

permissionskit's Issues

Xcode 4 compatibility

Hey, so I have updated your git as well as updated my Xcode to version 9. However, when I run my project I receive several errors from sparrow. Wondering if these errors could be fixed.

permission button doesn't work for locationWhileInUse

I'm not sure why, all other Permissions work just fine, but not for locatioWhileInUse

I have used this key in my info.list
NSLocationAlwaysAndWhenInUseUsageDescription
I tried all the other three, but same problem

in podFile
platform :ios, '9.0'
target 'weekend' do

use_frameworks!

pod 'Sparrow/Modules/RequestPermission', :git => 'https://github.com/IvanVorobei/Sparrow.git'

xcode 9.3 swift 4.3 iPhone 7 Plus, iOS 11.3

thanks

didRegisterForRemoteNotificationsWithDeviceToken

When accepting the enable notification .. didRegisterForRemoteNotificationsWithDeviceToken is not being called... I would expect that to be the case? How else would I go about getting the device token after they accepted enabling notifications?

[REQ]is There a way to use RequestPermission with OneSignal ?

Hi, i'm currently using OneSignal for my push notifications in my iOS project.
To instantiate OneSignal, i have to do `OneSignal.initWithLaunchOptions(....)' in the Application.DidFinishingLaunchingWithOption func of the Application Delegate.
This automatically fires the standard request for Push Permissions.

I'd Like to use RequestPermission before all of this happens, but seems i can't because i've to instantiate RequestPermission in a Controller (and none is created at the Application Delegate flow of the app).

Is there a way/workaround ?

Thanks!

Victor

App rejected

Got my app rejected due to:
"Push notifications must be optional and must obtain the user's consent to be used within the app."

attachment-2238713732170665354screenshot_0308_095811

In the picture the "Swipe to dismiss" isn´t visible, i don´t know why. So the user can´t get anywhere from here if the user don´t try to drag the popup.

To fix this i suggest that if you the user don´t allow permission the button should turn red with a cross and don´t show the alertview in the picture. That alert should only show when the user press that button again.
And when all permission is answered (allowed or denied) the popup should automatically close.

Add Reminders?

I think this would be another awesome one to have. Thank you for the fantastic project!

updatePermissionsStyle does not consider

If you have say enable MicroPhone, and Enable Location (whenAppInUse) and you enable the microphone, but reply NO to the request to enable location, then jump to the Settings App and allow it, then jump back to the app

Then the updatePermissionsStyle() function runs via the request earlier made via
NotificationCenter.default.addObserver(self, selector: #selector(self.updatePermissionsStyle), name: NSNotification.Name.UIApplicationDidBecomeActive, object: nil)

But this does not trigger the SPRequestPermissionDialogInteractivePresenter>>actionForControl logic that would run the if allPermissionAllowed {} logic to autoclose the dialog view controller. Rather it just invokes control.setSelectedState(animated: false) for each permission that is true.

The end result is the dialog does not autoclose, nor does the caller's delegate methods viaSPRequestPermissionEventsDelegate get invoked to do any special processing.

notes: perhaps on the app going inactive you'll have to remember state of permissions so you can properly fire delegate methods based on state change found in activation.

black color

@ivanvorobei How can I change the black background color of the rhombus pattern. Which file is it so I can change it. Ive tried every single file and couldn't find it myself. I would appreciate it if you could help me find the property. for it. Thanks.

Segmentation Fault 11

SPRequestPermission.swift is producing a compilation error on given xcodeproj.
Fresh XCode installation on a NEW machine.

Access denied

Reproduce: Presenting SPRequest.Dialog -> Denie access (e.g. for camera) -> you will not see the altert to get directed to settings.

This worked with the last version.

Dismiss on tap

It would be great to have the possibility to dismiss dialog view controller when user taps area outside it

Distingish button for locationAlways and locationWhenInUse

Hi,
is there a possibility to change the text for button "Enable Location" in case of locationAlways to "Enable Location Always"?
Otherwise users will be confused, because they do not know which of the Location Options are required to grant.

Thanks,
Ghent

Allow Escalating Location Permissions

If a user upon first launch authorizes .locationWhenInUse, and then later, when taking a certain action, needs to authorize .locationAlways, it shows as denied and that they need to change the settings from iPhone App settings. In fact, it is possible to upgrade from here, in-app, without going to the iPhone App Settings. (:

Does not work with Xcode 9

When I try to build my project,I get a strange error
If the destination is a simulator, the compiler will give this error:Command failed due to signal: Segmentation fault: 11
If the destination is a device in the real world,it will will give Command failed due to signal: Abort trap: 6

Customization missing

Hello,
I just start to use your lib and it is very nice, easy to use / configure .

I just have an issue with one customization. I am doing an app mainly in French, and there is one popup I did not manage to change / localize
capture d ecran 2017-05-09 a 11 38 46

I am asking the permission one at a time (when needed) so basically one by one. Is very a way to customize the text based on notification type (not very important and maybe to specific to my case)
edit : I just plug my brain and ... I just have to create 2 datasources.... easy

thanks for you work

Use of unresolved identifier 'SPRequestPermission'

Hi Everyone,
i have this error message under Swift Compiler Error Panel , where is the problem?

HomeViewController.swift:32:9: Use of unresolved identifier 'SPRequestPermission'

    override func viewDidAppear(_ animated: Bool) {        
        SPRequestPermission.dialog.interactive.present(on: self, with: [.camera, .photoLibrary, .notification])
    }

setHeaderBackgroundView Called Twice

SPRequestPermissionDialogInteractivePresenter.swift, around line 58.
The method setHeaderBackgroundView is called twice, from my readings it's not necessary.

Xcode 9 / iOS 11

Hi. I was about to use this some app updates that are scheduled to be released in a few weeks. I am reading about issues with Xcode 9/ iOS 11 in both closed issues and open ones with segmentation faults.

I have been using this stand-alone and trying subclassing, but I have not used cocoa pods to put it into my production code base.

Is there being work done to make this transition that we will soon be using? I just do not want to incorporate this great framework if is not close to be ready for Xcode 9, etc.

segmentation fault: 11 error

@BasThomas @ivanvorobei @mgt-la @RobertGolosynsky @telunc I love this project very much. But there is an issue. Every time I download the project and build it I get a command failed due to signal: segmentation fault: 11 error. I tried everything from cleaning the project, to transferring the files directing into my project to using cocoa pods and nothing worked. Can you please help me resolve this so I can use this project.

CLLocationManager created in wrong thread

After user grants always on location usage I see the following warning in XCode console.
And looks like it's the cause of rare crashes in production.

2017-08-10 14:48:20.317102 MY_APP[902:377336] A location manager (0x15fec6c0) was created on a dispatch queue executing on a thread other than the main thread. It is the developer's responsibility to ensure that there is a run loop running on the thread on which the location manager object is allocated. In particular, creating location managers in arbitrary dispatch queues (not attached to the main queue) is not supported and will result in callbacks not being received

Can't Compile- Segmentation Fault

Hi, thanks for spending the time to create this! It looks great and I'm trying to use this in a project of mine.

Unfortunately, when manually integrating this into my project (Not using CocoaPods), I am getting an error while building the file: SPRequestPermission.swift . I'm also encountering the same error when trying to build your sample project. This is the error I get: "Command failed due to signal: Segmentation fault: 11"

As a reference I am using Xcode 8.2.

I'd greatly appreciate your help resolving this issue... Thanks!

Cant get dialog to segue after receiving permission

I am using the isAllowed as documented and when checking if all permissions are granted, it will not print it out let alone segue.. can I have a code sample of checking for a permission and segueing on didHide()

localized the text ?

Currently we haven't possibility to localized text permission, do you think you can integrate this functionnality soon ?

Segmentation 11 - YES AGAIN!

Although it's a nice pod, it needs tons of work regarding its pod handling.
When updating pod, I get that I am at version 1.0.0 whereas previous version was 1.0.1!!! When I remove the pod and reinstall it I get segmentation 11 fault when building. I checked the answers to the other closed issues but really no professional solution has been proposed. A guy deletes a swift file from the pod and uses it's code directly. Not a good way. The author just denies to fix this. And no, I won't zip and send you anything from my machine for you to check.
If you fix this, I 'll try this pod again, otherwise I 'll have to use another permission pod from out there...

Regards

Hide header view

I don't want 'headerView' to appear in dialog. I don't really get its purpose.
request-permission_presenters

See highlighted part - that's the only thing I want to leave.
How can I achieve that?
Thank you for your work

Just a question...

I really like the look of the landscape based alertview you use in this. Is there a way to generalize it to use it as a replacement for UIAlertController? I need something with image and landscape capabilities. If you know of anything let me know. I'll take a look at this project later and see how it is made up. Thank you for the hard work.

VoiceRecognition permission ?

Hey !

Love your work, sincerely !
I need to ask the user for voice recognition (Speech Kit) API, could you add it ?

Thanks !

whose view is not in the window hierarchy!

I get this error: "Sparrow.SPRequestPermissionDialogInteractiveViewController: ... whose view is not in the window hierarchy!".

I setup the RequestPermission like this:

var permissionAssistant = SPRequestPermissionAssistant.modules.dialog.interactive.create(with: [.Location, .PhotoLibrary, .Notification])

override func viewDidAppear(animated: Bool) {
        permissionAssistant.present(on: self)
}

Thanks.

Location when in use permission

First off, great library.

I am trying to add permissions for location except I only want "When in use" and not "Always" which this library does. Is it possible to do this with the library already, if not could you add this functionality? Maybe something like .LocationWhenInUse

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.