Files
ipx/ios/project.yml
Ray Slakinski bd535851b0 The iOS app's icon count, pushed by ipx (#433)
Background refresh runs when iOS chooses, and for this app that has
been rarely, so the icon's unread count lagged until the app was
opened (#421). Now ipx sends the count:
- ipx: a push_devices table and POST/DELETE /api/push/devices. With
  [push] set to an APNs key, a task compares each phone's All
  Subscriptions unread count with the last sent, once a minute, and
  sends a changed one to Apple as a badge-only push: no alert, no
  sound. A token Apple says is gone is forgotten. The signing token is
  ES256 over the team and time, made again every forty minutes, inside
  Apple's limits.
- iOS: the aps-environment entitlement. The app registers for push
  once badge permission is given, each launch, and hands its token to
  the page.
- Page: registers the token with ipx as the person signed in, since
  the player's address (ipxapi) lets through only the player's paths,
  and removes it on signing out.

jsonwebtoken here is built without PEM support, so the .p8 key's
base64 is decoded in push.rs rather than turning on a feature and
changing Cargo.lock for one file.

cargo test -p ipx on macOS: 182 pass; the 3 that fail read /proc and
fail there without this change too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:47:28 -05:00

103 lines
3.7 KiB
YAML

# XcodeGen makes the .xcodeproj from this, so the project is something a diff can show rather
# than a pbxproj nobody reviews. On a Mac:
#
# brew install xcodegen && cd ios && xcodegen generate && open iPX.xcodeproj
name: iPX
options:
bundleIdPrefix: net.sdf1
deploymentTarget:
iOS: "17.0"
createIntermediateGroups: true
settings:
base:
SWIFT_VERSION: "5.9"
TARGETED_DEVICE_FAMILY: "1,2"
CODE_SIGN_STYLE: Automatic
targets:
iPX:
type: application
platform: iOS
sources:
- Sources
- Resources/Assets.xcassets
info:
path: Resources/Info.plist
properties:
CFBundleDisplayName: iPX
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: "11"
# Playing on with the screen locked. A plist key, not a signed entitlement, so it works on
# a free personal team; CarPlay's own dashboard app is an entitlement Apple has to grant.
UIBackgroundModes: [audio, fetch]
# The unread badge's refresh while the app is closed (#421).
BGTaskSchedulerPermittedIdentifiers: [net.sdf1.ipx.refresh]
# HTTPS only, so TestFlight need not ask the export-compliance question on every build.
ITSAppUsesNonExemptEncryption: false
UILaunchScreen: {}
UIApplicationSceneManifest:
UIApplicationSupportsMultipleScenes: false
UISceneConfigurations:
UIWindowSceneSessionRoleApplication:
- UISceneConfigurationName: Default Configuration
UISceneDelegateClassName: $(PRODUCT_MODULE_NAME).SceneDelegate
UISupportedInterfaceOrientations:
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
# Plain HTTP only for a server on your own network (192.168.1.130:8099); the tunnel is HTTPS.
NSAppTransportSecurity:
NSAllowsLocalNetworking: true
# The page's service worker runs only for these, so iPX opens offline only at them
# (#435): the server, and Cloudflare Access and Authentik, where its sign-in goes. Ten at
# most, and a server not here loses the bridge (WebViewController.makeWebView).
WKAppBoundDomains:
- ipodderx.sdf1.net
- rays-sdf1.cloudflareaccess.com
- authentik.sdf1.net
# The icon's count pushed by ipx (#433). Development here; Xcode makes it production when it
# exports for TestFlight.
entitlements:
path: Resources/iPX.entitlements
properties:
aps-environment: development
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: net.sdf1.ipx
MARKETING_VERSION: "0.1.0"
DEVELOPMENT_TEAM: 8743L8D729
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
# The script below writes into the built Info.plist, which the sandbox would refuse.
ENABLE_USER_SCRIPT_SANDBOXING: NO
postBuildScripts:
# A debug build is app-bound to localhost too, so the simulator can test the service
# worker against a page served on the Mac (#435). Never in a release.
- name: App-bound localhost (debug)
basedOnDependencyAnalysis: false
script: |
if [ "$CONFIGURATION" = Debug ]; then
/usr/libexec/PlistBuddy -c "Add :WKAppBoundDomains: string localhost" "$TARGET_BUILD_DIR/$INFOPLIST_PATH"
fi
iPXTests:
type: bundle.unit-test
platform: iOS
sources:
- Tests
dependencies:
- target: iPX
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: net.sdf1.ipx.tests
GENERATE_INFOPLIST_FILE: YES
schemes:
iPX:
build:
targets:
iPX: all
iPXTests: [test]
test:
targets:
- iPXTests