Files
daily-notification-plugin/docs/testing/IOS_TEST_APP_SETUP.md
Matthew Raymer c39bd7cec6 docs: Consolidate documentation structure (139 files, zero information loss)
Consolidate all markdown documentation into organized structure per
CONSOLIDATION_DIRECTIVE. All files preserved (canonical, merged, or archived).

- docs/integration/ - Integration documentation (7 files)
- docs/platform/ios/ - iOS platform docs (12 files)
- docs/platform/android/ - Android platform docs (9 files)
- docs/testing/ - Testing documentation (15 files)
- docs/design/ - Design & research (5 files)
- docs/ai/ - AI/ChatGPT artifacts (7 files)
- docs/archive/2025-legacy-doc/ - Historical docs (17 files)

- Integration: Root INTEGRATION_GUIDE.md → docs/integration/
- Platform: Separated iOS and Android into platform/ subdirectories
- Testing: Consolidated all testing docs to docs/testing/
- Legacy: Archived entire doc/ directory to archive/
- AI: Moved all ChatGPT artifacts to docs/ai/

- Added docs/00-INDEX.md - Central navigation hub
- Added docs/CONSOLIDATION_SOURCE_MAP.md - Complete audit trail
- Added docs/CONSOLIDATION_COMPLETE.md - Consolidation summary
- Updated README.md with links to documentation index

- All 139 files have destinations (see CONSOLIDATION_SOURCE_MAP.md)
- Zero information loss (all files preserved)
- Archive preserves original structure
- Index provides clear navigation

- 87 files moved/created/updated
- Root-level docs consolidated
- Legacy doc/ directory archived
- Test app docs remain with test apps (indexed)

Ref: CONSOLIDATION_DIRECTIVE
Author: Matthew Raymer
2025-12-18 09:13:18 +00:00

211 lines
4.2 KiB
Markdown

# iOS Test App Setup Guide
**Status:** 📋 **SETUP REQUIRED**
**Objective:** Create iOS test app for Phase 1 testing
---
## Problem
The iOS test app (`test-apps/ios-test-app/`) does not exist yet. This guide will help you create it.
---
## Quick Setup
### Option 1: Automated Setup (Recommended)
Run the setup script:
```bash
./scripts/setup-ios-test-app.sh
```
This will:
- Create basic directory structure
- Copy HTML from Android test app
- Create `capacitor.config.json` and `package.json`
- Set up basic files
### Option 2: Manual Setup
Follow the steps below to create the iOS test app manually.
---
## Manual Setup Steps
### Step 1: Create Directory Structure
```bash
cd test-apps
mkdir -p ios-test-app/App/App/Public
cd ios-test-app
```
### Step 2: Initialize Capacitor
```bash
# Create package.json
cat > package.json << 'EOF'
{
"name": "ios-test-app",
"version": "1.0.0",
"description": "iOS test app for DailyNotification plugin",
"scripts": {
"sync": "npx cap sync ios",
"open": "npx cap open ios"
},
"dependencies": {
"@capacitor/core": "^5.0.0",
"@capacitor/ios": "^5.0.0"
}
}
EOF
# Install dependencies
npm install
# Add iOS platform
npx cap add ios
```
### Step 3: Copy HTML from Android Test App
```bash
# Copy HTML file
cp ../android-test-app/app/src/main/assets/public/index.html App/App/Public/index.html
```
### Step 4: Configure Capacitor
Create `capacitor.config.json`:
```json
{
"appId": "com.timesafari.dailynotification.test",
"appName": "DailyNotification Test App",
"webDir": "App/App/Public",
"server": {
"iosScheme": "capacitor"
},
"plugins": {
"DailyNotification": {
"enabled": true
}
}
}
```
### Step 5: Configure Info.plist
Edit `App/App/Info.plist` and add:
```xml
<!-- Background Task Identifiers -->
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.timesafari.dailynotification.fetch</string>
<string>com.timesafari.dailynotification.notify</string>
</array>
<!-- Background Modes -->
<key>UIBackgroundModes</key>
<array>
<string>background-fetch</string>
<string>background-processing</string>
<string>remote-notification</string>
</array>
<!-- Notification Permissions -->
<key>NSUserNotificationsUsageDescription</key>
<string>This app uses notifications to deliver daily updates and reminders.</string>
```
### Step 6: Link Plugin
The plugin needs to be accessible. Options:
**Option A: Local Development (Recommended)**
- Ensure plugin is at `../../ios/Plugin/`
- Capacitor will auto-detect it during sync
**Option B: Via npm**
- Install plugin: `npm install ../../`
- Capacitor will link it automatically
### Step 7: Sync Capacitor
```bash
npx cap sync ios
```
### Step 8: Build and Run
```bash
# Use build script
../../scripts/build-ios-test-app.sh --simulator
# Or open in Xcode
npx cap open ios
# Then press Cmd+R in Xcode
```
---
## Troubleshooting
### Issue: "No Xcode workspace or project found"
**Solution:** Run `npx cap add ios` first to create the Xcode project.
### Issue: Plugin not found
**Solution:**
1. Ensure plugin exists at `../../ios/Plugin/`
2. Run `npx cap sync ios`
3. Check `App/App/capacitor.plugins.json` contains DailyNotification entry
### Issue: BGTask not running
**Solution:**
1. Verify Info.plist has `BGTaskSchedulerPermittedIdentifiers`
2. Check task registered in AppDelegate
3. Use simulator-only LLDB command to manually trigger (see testing guide)
### Issue: Build failures
**Solution:**
1. Run `pod install` in `App/` directory
2. Clean build folder in Xcode (Cmd+Shift+K)
3. Verify Capacitor plugin path
---
## Verification Checklist
After setup, verify:
- [ ] `test-apps/ios-test-app/` directory exists
- [ ] `App.xcworkspace` or `App.xcodeproj` exists
- [ ] `App/App/Public/index.html` exists
- [ ] `capacitor.config.json` exists
- [ ] `Info.plist` has BGTask identifiers
- [ ] Plugin loads in test app
- [ ] Build script works: `./scripts/build-ios-test-app.sh --simulator`
---
## References
- **Requirements:** `doc/test-app-ios/IOS_TEST_APP_REQUIREMENTS.md`
- **Testing Guide:** `doc/IOS_PHASE1_TESTING_GUIDE.md`
- **Build Script:** `scripts/build-ios-test-app.sh`
- **Setup Script:** `scripts/setup-ios-test-app.sh`
---
**Status:** 📋 **SETUP REQUIRED**
**Last Updated:** 2025-01-XX