Intelligence, Advanced Charting & Trading Platform
feature/chartnova-ios-widget
ChartNova iOS + real WidgetKit extension
This folder contains the native iPhone companion app and Home Screen widget source, not a web shortcut. Unlike a PWA, the WidgetKit target appears in the iOS Add Widget picker after the containing app has been built, signed and installed.
Features
- One widget with the standard iOS small, medium and large families, showing 2 / 4 / 6 user-selected instruments respectively.
- App screen to select up to six market symbols from ChartNova's live 58-symbol watchlist, favorite/unfavorite, reorder and choose Nova Glass, dark or light appearance.
- Shared App Group
group.ir.chartnova.widgetspersists preferences between app and widget. - HTTPS
GET https://app.chartnova.ir/api/widget?symbols=...with the selected ordered symbols. Zero API keys in the binary; request is served by Cloudflare KV and does not consume 250-per-day upstream requests per widget view. - WidgetKit timeline asks for a refresh after 15 minutes; iOS may defer updates depending on power, budget, connectivity and system policy.
- When offline, last valid response is used and prominently marked as cached / stale. Placeholder does not invent prices.
- Tapping widget opens the companion app through
chartnova://widget.
Building on macOS (required)
- Use a Mac with an Xcode version that supports iOS 17 or later.
- Install XcodeGen (e.g.
brew install xcodegen). - Run
cd ios/ChartNova && xcodegen generate, then openChartNova.xcodeprojin Xcode. - Select your Apple development team under Signing & Capabilities for both
ChartNovaandChartNovaWidgets. - Register and enable the same App Groups capability,
group.ir.chartnova.widgets, for both bundle IDs. Change the sample bundle IDs and group ID if your team's identifiers are different; update bothproject.ymlandShared/WidgetSettings.swift. - Build and run the ChartNova scheme on your physical iPhone; trust the developer identity if prompted.
- Open ChartNova once, select favorites and rearrange the widget list. On the iPhone Home Screen, long-press empty space → Edit → Add Widget → search ChartNova → choose a size → Add Widget.
- For iOS unit tests run
xcodebuild test -project ChartNova.xcodeproj -scheme ChartNova -destination 'platform=iOS Simulator,name=iPhone 16'; choose an available simulator name if different.
The App Group and development provisioning are Apple-controlled; without them the widget cannot securely share app preferences. A paid Apple Developer membership may be required for distribution and/or capabilities. Nothing has been published to the App Store or installed on an actual iPhone by this repository change.
Security & correctness
- Uses HTTPS-only ChartNova backend. No credentials, bearer tokens or API secret keys in the app.
- All selected symbols are allowlisted to uppercase
BASE-QUOTEpairs with a six-symbol cap. - Network data is decoded and validated before being cached, with explicit provider timestamps / stale indicators.
- Price values are provider sell quotes, not necessarily executable exchange prices, and are not guaranteed to update in real time.
- The iOS application and widget targets share code from
Shared/. Native widget settings are separate from the browser's localStorage-based preview; automatic cross-device/browser sync requires account support and has not been built.
Validation evidence
Automated tests against the real live ChartNova widget API and static project validation are possible from Windows/Linux. Xcode compilation, simulator WidgetKit integration and physical iPhone installation require macOS/Xcode and must not be claimed passed until run.