mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
4.0 KiB
4.0 KiB
Testing iOS Spotlight Search Integration
Quick Test Guide
1. Build and Run the App
- Build the Heygo iOS app in Xcode
- Install it on a physical device or simulator (iOS 9.0+)
- Open the app and create a few test links if you don't have any
2. Test Basic Functionality
- Create a test link with alias "google" pointing to "https://google.com"
- Go to the debug tab (gear icon - only visible in debug builds)
- Tap "Refresh Spotlight Index"
- Wait for the success message
3. Test Spotlight Search
- Go to the iOS home screen
- Pull down from the top to open Spotlight search
- Type "heygo g"
- You should see your "google" link appear in the search results
- Tap on the result - it should open Google in Safari and increment the click counter
4. Verify Click Tracking
- After opening a link from Spotlight, return to the Heygo app
- Go to the Analytics tab
- Verify that the click count for the link has increased
- Check that a new click log entry was created
5. Test Different Link Types
Regular Links
- Create a link with alias "github" → "https://github.com"
- Search "heygo github" in Spotlight
- Should open GitHub in Safari
Custom Links
- Create a custom link with some markdown content
- Search for it in Spotlight
- Should open the app and show the content (placeholder for now)
Template Links
- Create a template link with URL containing parameters like "https://google.com/search?q={query}"
- Search for it in Spotlight
- Should open the app for parameter input (placeholder for now)
6. Advanced Testing
Prefix Search
- Create links: "gmail", "github", "google"
- Search "heygo g" - should show all three
- Search "heygo git" - should show only github
Tag-Based Search
- Create a link with tags "work", "social"
- Search "heygo work" - should find the tagged link
Ranking Test
- Create two similar links
- Click one multiple times through the app
- Search for both - the frequently clicked one should appear higher
Debugging Issues
Links Not Appearing in Search
- Check the debug tab - verify "Spotlight Available" shows ✅
- Verify "Indexed Items" count matches your link count
- Try refreshing the index
- Make sure you're using the "heygo" prefix in your search
Links Not Opening Correctly
- Check that the link exists in the app
- Verify the URL is properly formatted for regular links
- Check the debug console for error messages
Performance Issues
- The system rate-limits full re-indexing to every 5 minutes
- Individual link updates are indexed immediately
- Large link collections (100+) may take a few seconds to index
Technical Verification
Check Spotlight Index Status
- Use the debug tab to see indexed item count
- Compare with total link count in the app
- Use "Clear All Indexed Items" to reset if needed
Verify Core Data Integration
- Create a new link → should auto-index
- Edit an existing link → should re-index
- Delete a link → should remove from index
Test Error Handling
- Try searching when network is off (should still work - local index)
- Force-quit the app during indexing (should recover on next launch)
- Delete the app and reinstall (should rebuild index)
Expected Behavior Summary
| Action | Expected Result |
|---|---|
| Create link | Automatically indexed in Spotlight |
| Edit link | Re-indexed with updated information |
| Delete link | Removed from Spotlight index |
| Search "heygo [term]" | Shows matching links |
| Tap search result | Opens link and records click |
| Regular link | Opens in Safari |
| Custom link | Opens app (placeholder) |
| Template link | Opens app for parameters (placeholder) |
Known Limitations
- Custom and template link handling shows placeholders - UI implementation needed
- Template parameter input is not yet implemented - shows placeholder
- Search results limited by iOS Spotlight constraints
- Indexing happens on background thread - may have slight delay
- Rate limiting prevents excessive re-indexing