Repository navigation
feat(permissions)!: add a Motion device permission - #1002
Merged
Merged
Conversation
Contributor
|
CI Status: 24 required jobs green, 21 passed and 3 skipped by path filter. All job results
Signing credentials: failure as of 2026-10-14, a release may fail Commit |
Contributor
iOS simulator previewBuilt from gh run download 36534625128 --name simulator-preview-6f62619ea
unzip polkadot-app-*.app.zip
xcrun simctl install booted polkadot-app.app
xcrun simctl launch booted io.parity.polkadotapp.developOr download it in a browser, which arrives as a zip wrapping An arm64 simulator slice, so it needs an Apple Silicon Mac and does not |
decrypto21
marked this pull request as ready for review
September 25, 2026 19:04
# Conflicts: # rust/crates/truapi-codegen/tests/golden/wire_table.rs
# Conflicts: # rust/crates/truapi-codegen/tests/golden/wire_table.rs
# Conflicts: # rust/crates/truapi/src/native.rs
# Conflicts: # rust/crates/truapi/src/native.rs
Contributor
|
This pull request touches an app, which is not built by default. Add a label for each build you want:
Each starts as soon as it is added and follows the branch from then on. |
Contributor
Bundle size reportCompared with
WebAssembly modules
Changed files (5)
Commit: 28f4620 |
# Conflicts: # hosts/ios/polkadot-app/Modules/Products/Chat/Rust/TrUAPIChatHandler.swift # rust/crates/truapi-codegen/tests/golden/wire_table.rs
# Conflicts: # rust/crates/truapi-codegen/tests/golden/wire_table.rs
# Conflicts: # rust/crates/truapi-codegen/tests/golden/wire_table.rs
# Conflicts: # rust/crates/truapi/src/native/runtime.rs # rust/crates/truapi/src/native/tests.rs # rust/crates/truapi/src/platform/mock.rs # rust/crates/truapi/src/v01/permissions.rs
pgherveou
approved these changes
Oct 14, 2026
decrypto21
enabled auto-merge
October 14, 2026 11:49
decrypto21
disabled auto-merge
October 14, 2026 11:51
# Conflicts: # rust/crates/truapi-codegen/tests/golden/wire_table.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #961
Adds
Motionto the device permissions. The user decides once per product (Allow Always, Allow Once, Don't Allow), and the host answers WebKit's motion request from that decision, so iOS no longer shows its own prompt on every launch.Products call the standard
DeviceMotionEvent.requestPermission()on iOS, orrequestDevicePermission("Motion")on any host. No platform-specific code.Motionis appended toHostDevicePermissionRequest, so existing SCALE indexes are unchanged.NativeProductExecution::authorize_device_permissionresolves a capability the web view gates itself through the product's saved, one-use, or prompted decision. The iOS and Android shells expose it asauthorizeDevicePermission.requestDeviceOrientationAndMotionPermissionFor. The Rust SPA and chat runtimes resolve it throughauthorizeDevicePermission(.motion); the native runtime uses the existing product permission flow. The prompt, Settings > Apps, and strings cover Motion.The decision is made in the WebKit delegate rather than a container gate because WebKit only consults its delegate during the product's user gesture, and a round trip to the core first would lose it.
Compatibility
Motionand answersrequestDevicePermission("Motion")with a malformed-frame error rather thangranted: false. Products should treat that error as motion being unsupported. The changeset says so.TrUAPIProductExecutionProtocolgainsauthorizeDevicePermission, so a conformer outside this repo must implement it. The release needs@parity/ios-hostin its title.Known limitation
WebKit caches the motion answer per origin in the web view's data store and has no API to clear it. Within one app launch, a product's first answer therefore applies to later requests: Allow Once lasts until the app is relaunched, and a changed decision takes effect on the next launch.
Testing
WKWebViewtest thatrequestPermission()resolves from the host's decision.adb emu sensor set acceleration, andrequestDevicePermission("Motion")is granted without a prompt, also after a force-stop.