Skip to content

Implemented deep link support#169

Open
Molizo wants to merge 1 commit intopretix:masterfrom
Molizo:master
Open

Implemented deep link support#169
Molizo wants to merge 1 commit intopretix:masterfrom
Molizo:master

Conversation

@Molizo
Copy link
Copy Markdown

@Molizo Molizo commented Apr 1, 2026

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_TOKEN

If 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.

Copilot AI review requested due to automatic review settings April 1, 2026 11:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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://setup intent filter for SetupActivity in the Android manifest.
  • Parse deep-link parameters (url, token) in SetupActivity and auto-run setup with improved error handling dialogs.
  • Document setup links in README.md and 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()
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
pdialog.dismiss()
if (!isFinishing && !isDestroyed && pdialog.isShowing) {
try {
pdialog.dismiss()
} catch (e: Exception) {
// Ignore exceptions when dismissing the dialog after lifecycle changes
}
}

Copilot uses AI. Check for mistakes.
Comment on lines 71 to +75
<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">
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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.

2 participants