PermissionScope icon indicating copy to clipboard operation
PermissionScope copied to clipboard

Too many permissions for AppStore

Open MaeseppTarvo opened this issue 8 years ago • 56 comments

Hey. If you are using PermissionScope with Xcode 8 GM and try to upload it to appstore you are gonna get errors like:

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMotionUsageDescription key with a string value explaining to the user how the app uses this data.

For some reason it thinks that I ask all those permissions. I even do not use any of these. Just the notification one.

MaeseppTarvo avatar Sep 12 '16 08:09 MaeseppTarvo

Thanks @MaeseppTarvo, I'll add this to the readme. At the very least you should be able to add those string values and get past submission.

@bre7 Perhaps it's really time to do subspecs for each permission :/ Not sure how Carthage could work similarly.

nickoneill avatar Sep 12 '16 14:09 nickoneill

One subspec per permission seems....too much. Isn't there a way to use weak linking like in ObjC ?

bre7 avatar Sep 12 '16 16:09 bre7

+1, seeing this as well.

Feels really weird to be adding usage descriptions for permissions we don't even use (Apple is already so picky about exactly how one uses different capabilities/permissions, so it makes me a bit nervous to "declare" we're using all of these).

sansari avatar Sep 13 '16 15:09 sansari

:+1: Also just had a build rejected for the same reason.

robbiet480 avatar Sep 13 '16 22:09 robbiet480

For now I'd suggest forking and removing unused permissions (or editing the Pods project) 😞 Not sure if there's a perfect solution to these problem

bre7 avatar Sep 13 '16 22:09 bre7

Agree with @bre7. This feels pretty bad to add all these keys to my Info.plist, especially since i'm not using any of these. I think i'm going to remove PermissionScope for the time being until a fix can be determined.

@nickoneill I'd suggest putting a giant warning in the README. I have been waiting for my build for almost 2 hours and called Developer Support who also had no idea what was going on, and then thought to check my email which is when I found the problem.

robbiet480 avatar Sep 13 '16 22:09 robbiet480

There are some issues in SO like these:

[...] AdMob seems to have references to the Calendar so an app I have which uses ads, and does not use the Calendar itself, can't be submitted. Thanks Google!

A possible "solution" (albeit hacky) would be to enter all the required keys in Info.plist (it's even suggested by AdMob's team: https://groups.google.com/forum/#!msg/google-admob-ads-sdk/UmeVUDrcDaw/HIXR0kjUAgAJ)

bre7 avatar Sep 13 '16 22:09 bre7

If anyone needs it, I pushed a branch that's compatible with Swift 3/iOS 10 and uses the new UserNotifications framework. It only supports notifications and location. It's available here.

robbiet480 avatar Sep 13 '16 22:09 robbiet480

While more work, perhaps the correct solution is a core cocoapod, with the logic for each individual permission in its own pod. Or, while hacky if you are building from source there are always preprocessor flags you could wrap around each permission.

h3smith avatar Sep 14 '16 13:09 h3smith

I know it won't be the prettiest or swift friendly option -- but what about using preprocessor flag per type of permission and then having to include the list of preprocessors in the project file?

yuvalt avatar Sep 15 '16 03:09 yuvalt

@yuvalt We're not even sure what's causing the requirement at the moment - is it just linking the frameworks or the presence of the code itself? Waiting for more information right now.

nickoneill avatar Sep 15 '16 04:09 nickoneill

@nickoneill It's the presence of the code itself. I didn't remove any framework links and my builds passed. I bet that Apple is looking for the import statement or specific classes.

robbiet480 avatar Sep 15 '16 04:09 robbiet480

Yeah. The frameworks are being linked because of the import statements.

bre7 avatar Sep 15 '16 04:09 bre7

Shows how new I am to Swift 😿. Sorry @nickoneill

robbiet480 avatar Sep 15 '16 04:09 robbiet480

I'm filing a code-level support request in an attempt to get more information on the issue.

nickoneill avatar Sep 15 '16 04:09 nickoneill

I think the problem is actually much Apple sided. I think that if you have whatever piece of line about some permission inside code it just detects it and check if it is allowed. So I think there is nothing to do.

MaeseppTarvo avatar Sep 15 '16 07:09 MaeseppTarvo

They are performing static analysis and finding the calls for the specific permissions and noticing the lack of the description in the plist file. Nothing more than that and you aren't going to get around it.

h3smith avatar Sep 15 '16 12:09 h3smith

That's why I think preprocessing is the only way to go (need to be verified). So we can add a preprocessor definition like PS_INDIVIDUAL_PERMISSIONS and then PS_LOCATION, PS_CONTACTS etc... this way we can make sure that only the relevant code gets compiled. I can implement it quickly if people think it's the right approach.

yuvalt avatar Sep 15 '16 14:09 yuvalt

also looking for a fix.

emreavsar avatar Sep 15 '16 19:09 emreavsar

@yuvalt I'm interested in this approach but wary of asking people to create flags in build settings because it's not always straightforward. Can you think of another way to turn preprocessor definitions on and off?

@emreavsar Your best bet in the short term is adding those plist items for the permissions that you're not using. Users will never see them until they're requested (which they never are) so no impact on your app.

nickoneill avatar Sep 15 '16 19:09 nickoneill

@nickoneill thanks for the quick answer. Yep this looks like the quick-fix for the moment. Are you 100% sure that they're not listed somewhere but only requesting? (App Store Entry, Settings etc.)?

Thanks anyway. Looking for the update mate!

emreavsar avatar Sep 15 '16 20:09 emreavsar

They're not listed in the app settings until they're requested. The code hasn't changed, it's strictly a change in Apple's review process.

nickoneill avatar Sep 15 '16 20:09 nickoneill

@nickoneill I hear you, but that's the only thing I could think of. The user will need to define it under Build Settings -> Swift Compiler -> Custom Flags (it's not under Basic but rather under All). Painful. Anyway, all the could be optional and people can still just include all the descriptions in their Info.plist or just opt to use this. I'll be happy to issue a pull-request for this, if you're interested.

yuvalt avatar Sep 15 '16 20:09 yuvalt

The only solution is that preprocessor flags have to be defined for the build process. There really isn't a way around it. Sadly you can't #define at the top of the .swift file because that would take care of it and make it easier.

But, it'll allow you to pick and choose which support you want which could be seen as a huge plus instead of having everything in there...

h3smith avatar Sep 15 '16 20:09 h3smith

Hey friends, I got a suggested fix from Apple support, importing the framework is what causes the detection for API usage so give me your thoughts on this: each permission will have a single framework associated with it and you would have to import the framework specific to the permission that you're requesting, such as import PermissionScopeCamera, import PermissionScopeNotification, etc.

nickoneill avatar Sep 20 '16 20:09 nickoneill

@nickoneill What would the Podfile look like in that case?

robbiet480 avatar Sep 20 '16 20:09 robbiet480

One Pod per permission ?

bre7 avatar Sep 20 '16 20:09 bre7

Why not a subspec for each framework instead of an entire Pod?

robbiet480 avatar Sep 20 '16 20:09 robbiet480

@bre7 I'm not convinced this is required... if we include many frameworks in a single podspec but don't import them anywhere, I've been given the impression that it will pass app review.

nickoneill avatar Sep 20 '16 20:09 nickoneill

Meant subspec :D

@bre7 I'm not convinced this is required... if we include many frameworks in a single podspec but don't import them anywhere, I've been given the impression that it will pass app review.

Interesting. Guess we'll need to test it

bre7 avatar Sep 20 '16 20:09 bre7