Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppStore connect rejects due to undescribed permissions #103

Open
theHonzic opened this issue Jan 31, 2024 · 11 comments · May be fixed by #143
Open

AppStore connect rejects due to undescribed permissions #103

theHonzic opened this issue Jan 31, 2024 · 11 comments · May be fixed by #143

Comments

@theHonzic
Copy link

We've just been denied publishing to App Store Connect due to missing descriptions of permissions we do not use. We only use the location and coarse location permissions in the application. However we are asked to add description for NSContactsUsageDescription, NSMotionUsageDescription and NSBluetoothAlwaysUsageDescription.

Apple says this: "While your app might not use these APIs a purpose string is still required."

One way to fix this is by adding the values in info.plist, but doing this the app description will include permissions it does not use in the AppStore.

@theHonzic theHonzic changed the title AppStore connects rejects due to undescribed permissions AppStore connect rejects due to undescribed permissions Jan 31, 2024
@Alex009
Copy link
Member

Alex009 commented Jan 31, 2024

in our apps we just add mock description inside Info.plist and all ok.

someday library will be splitted by each permission, but now you can do same that we do.

@the-best-is-best
Copy link

it will not accept in review app

@Alex009
Copy link
Member

Alex009 commented Jul 30, 2024

@the-best-is-best we have multiple apps that successful pass review.

@the-best-is-best
Copy link

Well, what do you add to the string description for permissions in the plist information that you don't need?

@the-best-is-best
Copy link

the-best-is-best commented Jul 30, 2024

@theHonzic

Are u adding it but the string is empty or what ?

@MeLlamoPablo
Copy link

@the-best-is-best feel free to use my fork with contacts, motion and bluetooth removed: https://github.com/MeLlamoPablo/moko-permissions

You can import it as a git submodule, and then on settings.gradle.kts add:

includeBuild("./external/moko-permissions") // path to your submodule

Then, you give it a different version name, like 0.18.0-slow in my case, and use it in your libs.versions.toml. Note that you may need to update some build settings from moko-permissions to make it work with your local gradle build. In my case I had to use the same version of Android Gradle Plugin, update to Gradle 8 and add jvmTarget = "1.8" to both moko-permissions and moko-permissions-compose.

@MeLlamoPablo
Copy link

@Alex009 if you're willing to accept PRs, I'm happy to help with the package splitting. I assume we would want to create different packages for each iOS permission controller, and then have a way of "installing" them on factory.createPermissionsController. Otherwise, please let me know an alternative approach and I'll be glad to code something!

@Alex009
Copy link
Member

Alex009 commented Sep 21, 2024

@MeLlamoPablo hi. sorry for late response. yes, it's good way.
each group of iOS permissions, that have own requirement to describe permission in plist, should have own package and we should have some "core" module with abstraction for adding any permission as additional library.

installing with factory - ok.

another way that i see:
now we use:

PermissionsController()

and then call

controller.providePermission(Permission.REMOTE_NOTIFICATION)

in new api we can do:

PermissionsController(providers = listOf(
    RemoteNotificationsPermissionsProvider(),
    LocationPermissionsProvider(),
    MotionPermissionsProvider()
))

and call will be again:

controller.providePermission(Permission.REMOTE_NOTIFICATION)

and in library with remote-notifications support for example, we will have:

// marker type-object for strong type checks of compiler
object RemoteNotificationPermission: Permission

const val Permission.Companion.REMOTE_NOTIFICATION = RemoteNotificationPermission

class RemoteNotificationsPermissionsProvider: PermissionsProvider<RemoteNotificationPermission> {
}

in core library we will have:

// marker interface for permission types declaration
interface Permission {
    // companion to add as extensions each new permission type and have single "namespace" for all permissions from all added providers
    companion object
}

interface PermissionsProvider<T: Permission> {
    fun isAppliedFor(permission: Permission): Boolean
    suspend fun providePermission(permission: T)
    suspend fun isPermissionGranted(permission: T): Boolean
    suspend fun getPermissionState(permission: T): PermissionState
}

// in this class we will search in providers list that isAppliedFor will be true. if all providers will return false - we will throw exception "PermissionsProvider for <permission class name> not provided in PermissionsController constructor"
class PermissionsController(providers: List<PermissionsProvider<*>>) {
    suspend fun providePermission(permission: Permission)
    suspend fun isPermissionGranted(permission: Permission): Boolean
    suspend fun getPermissionState(permission: Permission): PermissionState
}

@MeLlamoPablo
Copy link

PR for this: #143. Let me know what you think!

@mofeejegi
Copy link

Please, is there any update on this @Alex009? @MeLlamoPablo ‘s approach seems to work quite well and sadly, using mock descriptions in the info.plist isn’t an option for me.

@MeLlamoPablo
Copy link

Please, is there any update on this @Alex009? @MeLlamoPablo ‘s approach seems to work quite well and sadly, using mock descriptions in the info.plist isn’t an option for me.

@mofeejegi while the PR is being reviewed, you can take a look at my fork as an example for how to delete the permission delegates you don't need. And #103 (comment) details how to include a forked package in your build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants