Skip to content

Instantly share code, notes, and snippets.

@nimeacuerdo
Created April 6, 2021 07:03
Show Gist options
  • Save nimeacuerdo/1b56a201a5969f2b7ec14b00040df5e8 to your computer and use it in GitHub Desktop.
Save nimeacuerdo/1b56a201a5969f2b7ec14b00040df5e8 to your computer and use it in GitHub Desktop.
Example of module that declares initial permissions
@Module
class ContactsModule {
@Provides
@ElementsIntoSet
@InitialPermission
fun provideInitialPermissions(): Set<InitialPermissionData> {
return if (ContactsFeatureStatus.isEnabled) {
setOf(
InitialPermissionData(
"contacts", setOf(Manifest.permission.READ_CONTACTS),
R.string.contacts_disclaimer_title,
R.string.contacts_disclaimer_detail_title,
R.string.contacts_disclaimer_detail_description
)
)
} else {
emptySet()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment