Conversation
There was a problem hiding this comment.
Pull request overview
Adds pretixscan://setup deep-link handling to streamline initial device onboarding, allowing setup to be initiated from an “Open in pretixSCAN” link/QR instead of only in-app QR scanning or manual token entry.
Changes:
- Register
pretixscan://setupintent filter forSetupActivityin the Android manifest. - Parse deep-link parameters (
url,token) inSetupActivityand auto-run setup with improved error handling dialogs. - Document setup links in
README.mdand add user-facing error strings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Documents the new deep-link format for initial setup. |
| pretixscan/app/src/main/res/values/strings.xml | Adds error strings for invalid links / already-configured devices. |
| pretixscan/app/src/main/java/eu/pretix/pretixscan/droid/ui/SetupActivity.kt | Implements deep-link parsing and setup execution with dialogs. |
| pretixscan/app/src/main/AndroidManifest.xml | Registers the pretixscan://setup deep link and exports SetupActivity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } catch (e: Exception) { | ||
| handleSetupException(e) | ||
| } finally { | ||
| pdialog.dismiss() |
There was a problem hiding this comment.
ProgressDialog is dismissed unconditionally in finally. If the activity is destroyed while setup is running (rotation/background), dismiss() can throw and crash. Please guard the dismissal (e.g., if (!isFinishing && !isDestroyed && pdialog.isShowing)) or wrap it in a safe try/catch, similar to other activities’ pdialog?.dismiss() patterns.
| pdialog.dismiss() | |
| if (!isFinishing && !isDestroyed && pdialog.isShowing) { | |
| try { | |
| pdialog.dismiss() | |
| } catch (e: Exception) { | |
| // Ignore exceptions when dismissing the dialog after lifecycle changes | |
| } | |
| } |
| <activity | ||
| android:name=".ui.SetupActivity" | ||
| android:exported="true" | ||
| android:label="@string/headline_setup" | ||
| android:theme="@style/AppTheme.NoActionBar.Dark" /> | ||
| android:theme="@style/AppTheme.NoActionBar.Dark"> |
There was a problem hiding this comment.
SetupActivity is now exported and becomes a BROWSABLE deep-link entry point, which lets users bypass the Welcome screen’s consent/disclaimer checkbox by opening pretixscan://setup… directly. Consider moving the intent-filter to WelcomeActivity (then forwarding after acceptance) or adding an explicit consent/onboarding guard in SetupActivity before importing the link.
Added pretixscan://setup deep-link support so device setup can start from an “Open in pretixSCAN” link (or deeplink-enabled QR) instead of only QR scanning or manual token entry. This is potentially useful for events with 20+ volunteers scanning tickets at once during rush hour, focusing on easy onboarding.
Registered URL scheme:
pretixscan://setup?url=https%3A%2F%2Fpretix.eu&token=DEVICE_TOKENIf the device has already been set up then the app displays an error instructing the user to reset their settings first before attempting to tap on the link again.