Overview
Native shortcuts in Despia allow users to access critical application functionalities directly from outside the application. Users can long-press the app icon to reveal custom shortcuts that navigate to specific pages and execute custom JavaScript code.
Key Features
-
Quick Access: Users can long-press the app icon to access shortcuts
-
Custom Navigation: Each shortcut can redirect to a specific page within your application
-
JavaScript Injection: Automatically execute custom JavaScript when the shortcut opens a page
-
Workflow Automation: Trigger actions like opening modals or executing workflows without manual navigation
Setup Process
1. Access the Add-on Section
Navigate to the Despia editor and go to the add-on section. You'll find two categories:
-
Hard-coded: Features that require app republishing when changed (includes shortcuts)
-
Dynamic: SDK features that can be updated without republishing
Important: Shortcuts are hard-coded features. Any changes require republishing your application to the app store.
2. Create a New Quick Action
-
Navigate to the quick actions/shortcuts section
-
Click to create a new shortcut
-
You'll see a code editor (code is optional)
3. Configure the Shortcut
Required Fields:
Redirect Link
-
Enter the URL of the page where the shortcut should navigate
-
Example:
https://yourapp.com/invoice
orhttps://yourapp.com/contacts
-
Important: Use links from your live branch if using branching to avoid production issues
Name
-
Assign a descriptive name for your shortcut
-
Example: "Create Invoice", "New Contact", "Despia Shortcut"
Icon
- Select an appropriate icon from the available options
Optional: Custom JavaScript Code
Add JavaScript code that will execute when the shortcut page loads. This enables automation beyond simple navigation.
Code Structure:
(function() {
// Your custom code here
// Example: Open a modal automatically
// Example: Trigger a workflow
// Example: Call an API
})();
The code runs in a self-invoking function for the best experience.
4. JavaScript Capabilities
The JavaScript runs within your web application context, allowing you to:
-
Open Modals/Popups: Automatically display creation forms
-
Trigger Global Functions: Call global window functions like:
window.openModal("example data")
-
Trigger Workflows: Execute WeWeb workflows using:
wwLib.wwWorkflow.executeGlobal('YOUR WEWEB WORKFLOW ID', "example data")
-
Call APIs: Make API calls that wouldn't normally occur during navigation
-
Click Elements: Programmatically click buttons to open popups
-
Create Global Functions: Set up window functions to trigger specific actions
Example Use Case: Contact Creation Instead of navigating users to the contacts page where they must click "Create Contact", the shortcut can:
-
Navigate to the contacts page
-
Automatically open the "Create Contact" popup
-
Provide a seamless, automated experience
5. Testing and Deployment
-
Save your shortcut configuration
-
Publish your application (required for hard-coded features)
-
Build Time: Approximately 20 minutes
-
Testing: Available on TestFlight after build completion
Best Practices
-
Live Branch URLs: Always use URLs from your production/live branch
-
User Experience: Design shortcuts for frequently used actions
-
Automation: Use JavaScript to eliminate extra clicks
-
Testing: Test shortcuts thoroughly on TestFlight before production release
Common Use Cases
-
Quick Invoice Creation: Navigate directly to invoice creation with pre-opened form
-
New Contact: Open contacts page with "Add Contact" modal automatically displayed
-
Dashboard Access: Quick navigation to specific dashboard views
-
Workflow Triggers: Execute complex workflows with a single shortcut tap
For additional support or questions, please contact our support team at support@despia.com