ns-ios-widgets
Installation
SKILL.md
Apple widgets: Home Screen, lock screen, Dynamic Island
Widgets and Live Activities run in a separate extension process with no JS runtime — everything is SwiftUI on the native side, fed by your NativeScript app through an App Group. Official guide: https://docs.nativescript.org/guide/widgets-ios.md
1. Scaffold — ns widget ios
NativeScript CLI 8.9+ generates the whole stack with one command (prompts for a name and a type: Live Activity, Home Screen Widget, or both): ns widget ios.
| Path | Role |
|---|---|
App_Resources/iOS/extensions/<name>/ |
The widget extension target: <Name>Bundle.swift (@main WidgetBundle), the SwiftUI files, Info.plist (NSExtensionPointIdentifier: com.apple.widgetkit-extension), <name>.entitlements, extension.json, PrivacyInfo.xcprivacy |
App_Resources/iOS/extensions/provisioning.json |
Maps the extension bundle id (<appId>.<name>) → provisioning profile UUID |
App_Resources/iOS/src/AppleWidgetUtils.swift |
The JS ↔ native bridge (§3) |
Shared_Resources/iOS/SharedWidget/ |
Local Swift package shared by app + extension — holds the ActivityAttributes model (the data contract) |
App_Resources/iOS/app.entitlements |
App Groups capability (created if missing) |
Non-negotiable prerequisites (each fails silently or with a misleading error when missing):