Skip to content

Conversation

lukmccall
Copy link
Contributor

@lukmccall lukmccall commented Jul 24, 2019

Why

Resolves #4972.
Resolves #5831.
Resolves #4289.
Resolves #4618.

How

Flowgraph

  • iOS
    iOS_flow_graph

  • Android
    android_flow_graph

Test Plan

  • test-suite passed.
  • I tested it with a simple demo (run on several experiences to be able to test scoped permissions).

Test cases:

Test Android iOS
Permissions are properly set in settings. 🆗 🆗
Permissions are properly scoped (switching between two apps). 🆗 🆗
Global combined status is correct. 🆗 🆗
Scoped status is correct (the previous test but enforce using scoped permission). 🆗 🆗
Check if canAskAgain and granted fields have the correct value. 🆗 🆗
Test added module methods (getting/asking using, for example, the Camera module). 🆗 🆗
Test backward compatibility. 🆗 🆗
Changing permissions in system settings. 🆗 🆗
Bare workflow. 🆗 🆗

@lukmccall lukmccall force-pushed the @lukmccall/permissions-rework branch from 6351791 to f859223 Compare July 25, 2019 14:06
@lukmccall lukmccall requested review from bbarthec and tsapeta July 25, 2019 14:07
@lukmccall lukmccall force-pushed the @lukmccall/permissions-rework branch from f859223 to f611d80 Compare July 25, 2019 14:38
@lukmccall lukmccall changed the title [Permission] Rework - refactor [Permission] Rework Jul 30, 2019
@lukmccall lukmccall requested a review from bbarthec August 1, 2019 08:16
@lukmccall lukmccall force-pushed the @lukmccall/permissions-rework branch from 14e9f5a to 1c9c53d Compare August 1, 2019 10:26
tsapeta added a commit that referenced this pull request Aug 5, 2019
…5166)

# Why

There are some use cases where we want to pick media assets from some specific period of time, like during a visit in a food place. That use case is also used in Gyroscope app where I wanted to make it work more smoothly and get rid of filtering all the assets in JS.

# How

Added `createdAfter` and `createdBefore` options to `MediaLibrary.getAssetsAsync` and also added `requestPermissionsAsync` and `getPermissionsAsync` functions which would also be a part of #5061 but I decided to include them earlier so I don't have to migrate in the future releases 😅 

# Test Plan

Added tests to test-suite + I tested it in Gyroscope app
@bbarthec bbarthec requested review from mczernek and Szymon20000 and removed request for mczernek August 8, 2019 11:45
@lukmccall lukmccall force-pushed the @lukmccall/permissions-rework branch 2 times, most recently from c443b83 to abcda97 Compare August 8, 2019 15:28
@lukmccall lukmccall requested a review from bbarthec August 9, 2019 08:02
Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯 Amazing work 👍
One suggestion:
Maybe these's some clever way to rewrite

%{
	@"status": sth,
	@"expires": sth
}

into some POJO-style or NSDictionary-based?

There are many places where this construction is used and it's always typed by hand, but maybe we can somehow enforce more class-based behaviours instead of JSON-like behaviour.

@lukmccall lukmccall force-pushed the @lukmccall/permissions-rework branch from d3426d4 to ae0aa78 Compare November 8, 2019 12:27
@lukmccall lukmccall force-pushed the @lukmccall/permissions-rework branch from ae0aa78 to 26c161e Compare November 8, 2019 15:08
@lukmccall lukmccall merged commit 284d484 into master Nov 8, 2019
@lukmccall lukmccall deleted the @lukmccall/permissions-rework branch November 8, 2019 15:51
Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
* [Permissions] Extract base class for requester

* [Permissions] Refactor

* [Permissions] Make podspecs for each requester

* [Permissions] Add missing self ensurement to requesters

* [Permissions] Android fix

* [Permissions] Rewrite module to kotlin

* [Permissions] Move scoped ask to activity

* [Permissions] Remove permissions manager

* [Permissions] Remove PermissionsServiceBinding

* [Permissions] Make requesters

* [Permissions] Improve code styling

* [Permissions] Make SystemBrightnessRequester (expo#5147)

* Make SystemBrightnessRequester

* Make type enum

Co-Authored-By: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>

* [Permissions] Rewrite android native api (expo#5186)

* Move logic form module to service

* Remove static var from PermissionsService

* Make getPermission not throwable

* Store asked permissions

* [Permissions] Make requester registrable (expo#5187)

* Clean iOS

* Fix scoped permissions status (never undetermined)

* Requesters belong to EXPermission

* Remove permissions delegate

* Make requester registrable

* [Permissions] Small fixes

* [Permissions] Add app ownership check and fix code style

* [Permissions] Rework native api (expo#5418)

* [Permissions] Move requesters to modules on iOS

* [Permissions] Add bool granted

* [Permissions] Add to native modules, permissions related methods

* [Permissions] Repair CI

* [Permissions] Fix typo

* [Permissions] Reduce boilerplate code

* [Permissions] Fix error description

* [Permissions] Export constants for permissions status

* [Permissions] Rename methods wrapper

* [Permissions] Remove scoped permissions from standalone apps

* [Permissions] Fix lateinit and scoped permissions

Location module in OnHostResume calls getPermissions method before Activity Provider is available.

* [Permissions] Add `never ask again` support

* [Permissions] Scoping only dangerous permission

* [Permissions] Rename  `neverAskAgain` to `canAskAgain`

* [Permissions] Run pod install

* [Permissions] Update docs

* [Permissions] Fix CI

* [Permissions] Fix typo and imports after rebase

* [Permissions] Small improvements in Android

* [Permissions] Make test-suits pass

* [Permissions] Add requested changes

* [Permissions] Move ts types to unimodule

* [Permissions] Add missing requester

* [Permissions] Small fixes

* [Permissions] Fix after rebase

* [Permissions] Update docs

* [Permissions] Publish dev home

* [Permissions] Add kotlin dependency to build.gradle

* [Permissions] Fix permissions in ContactsModule

* [Permissions] Set manifest in HomeActivity class

* [Permissions] Regenerate pods projects
prakashbask pushed a commit to prakashbask/expo that referenced this pull request Mar 16, 2022
* [Permissions] Extract base class for requester

* [Permissions] Refactor

* [Permissions] Make podspecs for each requester

* [Permissions] Add missing self ensurement to requesters

* [Permissions] Android fix

* [Permissions] Rewrite module to kotlin

* [Permissions] Move scoped ask to activity

* [Permissions] Remove permissions manager

* [Permissions] Remove PermissionsServiceBinding

* [Permissions] Make requesters

* [Permissions] Improve code styling

* [Permissions] Make SystemBrightnessRequester (expo#5147)

* Make SystemBrightnessRequester

* Make type enum

Co-Authored-By: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>

* [Permissions] Rewrite android native api (expo#5186)

* Move logic form module to service

* Remove static var from PermissionsService

* Make getPermission not throwable

* Store asked permissions

* [Permissions] Make requester registrable (expo#5187)

* Clean iOS

* Fix scoped permissions status (never undetermined)

* Requesters belong to EXPermission

* Remove permissions delegate

* Make requester registrable

* [Permissions] Small fixes

* [Permissions] Add app ownership check and fix code style

* [Permissions] Rework native api (expo#5418)

* [Permissions] Move requesters to modules on iOS

* [Permissions] Add bool granted

* [Permissions] Add to native modules, permissions related methods

* [Permissions] Repair CI

* [Permissions] Fix typo

* [Permissions] Reduce boilerplate code

* [Permissions] Fix error description

* [Permissions] Export constants for permissions status

* [Permissions] Rename methods wrapper

* [Permissions] Remove scoped permissions from standalone apps

* [Permissions] Fix lateinit and scoped permissions

Location module in OnHostResume calls getPermissions method before Activity Provider is available.

* [Permissions] Add `never ask again` support

* [Permissions] Scoping only dangerous permission

* [Permissions] Rename  `neverAskAgain` to `canAskAgain`

* [Permissions] Run pod install

* [Permissions] Update docs

* [Permissions] Fix CI

* [Permissions] Fix typo and imports after rebase

* [Permissions] Small improvements in Android

* [Permissions] Make test-suits pass

* [Permissions] Add requested changes

* [Permissions] Move ts types to unimodule

* [Permissions] Add missing requester

* [Permissions] Small fixes

* [Permissions] Fix after rebase

* [Permissions] Update docs

* [Permissions] Publish dev home

* [Permissions] Add kotlin dependency to build.gradle

* [Permissions] Fix permissions in ContactsModule

* [Permissions] Set manifest in HomeActivity class

* [Permissions] Regenerate pods projects
prakashbask pushed a commit to prakashbask/expo that referenced this pull request Mar 16, 2022
* [Permissions] Extract base class for requester

* [Permissions] Refactor

* [Permissions] Make podspecs for each requester

* [Permissions] Add missing self ensurement to requesters

* [Permissions] Android fix

* [Permissions] Rewrite module to kotlin

* [Permissions] Move scoped ask to activity

* [Permissions] Remove permissions manager

* [Permissions] Remove PermissionsServiceBinding

* [Permissions] Make requesters

* [Permissions] Improve code styling

* [Permissions] Make SystemBrightnessRequester (expo#5147)

* Make SystemBrightnessRequester

* Make type enum

Co-Authored-By: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>

* [Permissions] Rewrite android native api (expo#5186)

* Move logic form module to service

* Remove static var from PermissionsService

* Make getPermission not throwable

* Store asked permissions

* [Permissions] Make requester registrable (expo#5187)

* Clean iOS

* Fix scoped permissions status (never undetermined)

* Requesters belong to EXPermission

* Remove permissions delegate

* Make requester registrable

* [Permissions] Small fixes

* [Permissions] Add app ownership check and fix code style

* [Permissions] Rework native api (expo#5418)

* [Permissions] Move requesters to modules on iOS

* [Permissions] Add bool granted

* [Permissions] Add to native modules, permissions related methods

* [Permissions] Repair CI

* [Permissions] Fix typo

* [Permissions] Reduce boilerplate code

* [Permissions] Fix error description

* [Permissions] Export constants for permissions status

* [Permissions] Rename methods wrapper

* [Permissions] Remove scoped permissions from standalone apps

* [Permissions] Fix lateinit and scoped permissions

Location module in OnHostResume calls getPermissions method before Activity Provider is available.

* [Permissions] Add `never ask again` support

* [Permissions] Scoping only dangerous permission

* [Permissions] Rename  `neverAskAgain` to `canAskAgain`

* [Permissions] Run pod install

* [Permissions] Update docs

* [Permissions] Fix CI

* [Permissions] Fix typo and imports after rebase

* [Permissions] Small improvements in Android

* [Permissions] Make test-suits pass

* [Permissions] Add requested changes

* [Permissions] Move ts types to unimodule

* [Permissions] Add missing requester

* [Permissions] Small fixes

* [Permissions] Fix after rebase

* [Permissions] Update docs

* [Permissions] Publish dev home

* [Permissions] Add kotlin dependency to build.gradle

* [Permissions] Fix permissions in ContactsModule

* [Permissions] Set manifest in HomeActivity class

* [Permissions] Regenerate pods projects
Eric-Tyrrell22 pushed a commit to Eric-Tyrrell22/expo that referenced this pull request Aug 14, 2025
* [Permissions] Extract base class for requester

* [Permissions] Refactor

* [Permissions] Make podspecs for each requester

* [Permissions] Add missing self ensurement to requesters

* [Permissions] Android fix

* [Permissions] Rewrite module to kotlin

* [Permissions] Move scoped ask to activity

* [Permissions] Remove permissions manager

* [Permissions] Remove PermissionsServiceBinding

* [Permissions] Make requesters

* [Permissions] Improve code styling

* [Permissions] Make SystemBrightnessRequester (expo#5147)

* Make SystemBrightnessRequester

* Make type enum

Co-Authored-By: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>

* [Permissions] Rewrite android native api (expo#5186)

* Move logic form module to service

* Remove static var from PermissionsService

* Make getPermission not throwable

* Store asked permissions

* [Permissions] Make requester registrable (expo#5187)

* Clean iOS

* Fix scoped permissions status (never undetermined)

* Requesters belong to EXPermission

* Remove permissions delegate

* Make requester registrable

* [Permissions] Small fixes

* [Permissions] Add app ownership check and fix code style

* [Permissions] Rework native api (expo#5418)

* [Permissions] Move requesters to modules on iOS

* [Permissions] Add bool granted

* [Permissions] Add to native modules, permissions related methods

* [Permissions] Repair CI

* [Permissions] Fix typo

* [Permissions] Reduce boilerplate code

* [Permissions] Fix error description

* [Permissions] Export constants for permissions status

* [Permissions] Rename methods wrapper

* [Permissions] Remove scoped permissions from standalone apps

* [Permissions] Fix lateinit and scoped permissions

Location module in OnHostResume calls getPermissions method before Activity Provider is available.

* [Permissions] Add `never ask again` support

* [Permissions] Scoping only dangerous permission

* [Permissions] Rename  `neverAskAgain` to `canAskAgain`

* [Permissions] Run pod install

* [Permissions] Update docs

* [Permissions] Fix CI

* [Permissions] Fix typo and imports after rebase

* [Permissions] Small improvements in Android

* [Permissions] Make test-suits pass

* [Permissions] Add requested changes

* [Permissions] Move ts types to unimodule

* [Permissions] Add missing requester

* [Permissions] Small fixes

* [Permissions] Fix after rebase

* [Permissions] Update docs

* [Permissions] Publish dev home

* [Permissions] Add kotlin dependency to build.gradle

* [Permissions] Fix permissions in ContactsModule

* [Permissions] Set manifest in HomeActivity class

* [Permissions] Regenerate pods projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants