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

Fix: don't ask for permission on startup #152

Merged
merged 5 commits into from
Feb 21, 2018

Conversation

macrozone
Copy link
Collaborator

solves #132

Camera access is asked as soon as ARKit is initialized.

This can be either if you mount it, or use any of the api methods (like ARKit.getCurrentLightEstimation()) or similar.

We always cleared the scene on startup to prevent inconsistancy when doing a "soft reload" of the app (e.g. if you do live-reload on development).

Now, we no longer clear the scene if it has not been initialized and so camera permission is not asked until you mount the ARView or use any of the api of ARKit.

We additionally provide a function that tells you whether arkit has been initialized. This is usuefull if you use the arkit api outside of a component (e.g. in a background process / saga) and want to prevent camera access until arkit has been initialized).

New API:

  • ARKit.isInitialized() returns a promise with a boolean whether arkit has been initialized
  • ARKit.isMounted() (experimental) returns a promise with a boolean whether arkit has been mounted (= is in view hierarchy)

@macrozone macrozone merged commit ee2ef12 into master Feb 21, 2018
bnjm added a commit to archilogic-com/react-native-arkit that referenced this pull request Feb 26, 2018
commit eec15f9
Merge: 6791c1f 3568fcd
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Mon Feb 26 10:59:55 2018 +0100

    Merge branch 'master' into fix-light-props

commit 3568fcd
Merge: c6231d8 d8a5475
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Mon Feb 26 10:59:26 2018 +0100

    Merge with upstream master

commit 6791c1f
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Mon Feb 26 10:56:19 2018 +0100

    Support node level color prop

commit c6231d8
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:16:27 2018 +0100

    update

commit 6346e09
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 15:05:55 2018 +0100

    Fix typos

commit bb57785
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:05:47 2018 +0100

    bump

commit 4a906d4
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:03:23 2018 +0100

    update

commit a0b53a3
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:02:21 2018 +0100

    update readme

commit 1495a06
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 17:39:56 2018 +0100

    Merge

commit df3badd
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 14:43:23 2018 +0100

    remove log

commit 652e5b4
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 14:40:58 2018 +0100

    implement isInitialized and isMounted

commit cb3b6e2
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 13:43:35 2018 +0100

    Clean up

commit 7832214
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 11:16:57 2018 +0100

    bump

commit 0d23357
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Tue Feb 20 19:42:26 2018 +0100

    Implement support for texture properties

commit 842407a
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Tue Feb 20 19:41:58 2018 +0100

    Add constants for texture wrapping

commit 493efd7
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Tue Feb 20 19:40:59 2018 +0100

    Add propTypes for UV properties

commit d8a5475
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:16:27 2018 +0100

    update

commit bd0283a
Merge: 6cebc9e d2ddd3d
Author: Marco Wettstein <macrozone@gmail.com>
Date:   Wed Feb 21 15:13:51 2018 +0100

    Merge pull request react-native-ar#151 from archilogic-com/uv-map-properties

    UV map properties

commit d2ddd3d
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 15:05:55 2018 +0100

    Fix typos

commit 6cebc9e
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:05:47 2018 +0100

    bump

commit ee2ef12
Merge: 33e788d ee60c88
Author: Marco Wettstein <macrozone@gmail.com>
Date:   Wed Feb 21 15:03:37 2018 +0100

    Merge pull request react-native-ar#152 from HippoAR/fix-dont-ask-for-permission-on-startup

    Fix: don't ask for permission on startup

commit ee60c88
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:03:23 2018 +0100

    update

commit 804c37a
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 15:02:21 2018 +0100

    update readme

commit f9c8565
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 14:58:08 2018 +0100

    Update README.md

commit 54b4d37
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 14:43:23 2018 +0100

    remove log

commit 6bd9467
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 14:40:58 2018 +0100

    implement isInitialized and isMounted

commit f0ede60
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 14:04:40 2018 +0100

    Update README.md

commit 320a7b1
Merge: f293838 33e788d
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 13:45:37 2018 +0100

    Merge branch 'master' into uv-map-properties

commit f293838
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Wed Feb 21 13:43:35 2018 +0100

    Clean up

commit 4480cc5
Author: Marco <macrozone@gmail.com>
Date:   Wed Feb 21 11:16:57 2018 +0100

    bump

commit 33e788d
Merge: ee8084b bbdc41e
Author: Marco Wettstein <macrozone@gmail.com>
Date:   Wed Feb 21 11:10:56 2018 +0100

    Merge pull request react-native-ar#150 from HippoAR/improve-animations

    support React-native Animated Library

commit bbdc41e
Author: Marco <macrozone@gmail.com>
Date:   Tue Feb 20 20:56:40 2018 +0100

    adjust proptypes

commit 88c2b8d
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Tue Feb 20 19:42:26 2018 +0100

    Implement support for texture properties

commit 8cc9790
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Tue Feb 20 19:41:58 2018 +0100

    Add constants for texture wrapping

commit 2ae4694
Author: Benjamin Devine <benjamin.devine@gmail.com>
Date:   Tue Feb 20 19:40:59 2018 +0100

    Add propTypes for UV properties

commit 1019c3e
Merge: e80c44f 324601d
Author: Marco <macrozone@gmail.com>
Date:   Tue Feb 20 18:36:27 2018 +0100

    Merge branch 'master' into improve-animations

commit e80c44f
Author: Marco <macrozone@gmail.com>
Date:   Tue Feb 20 17:59:35 2018 +0100

    wip
    t
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 this pull request may close these issues.

1 participant