@use-voltra/ios-client 1.4.0 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -0
- package/Voltra.podspec +28 -0
- package/build/commonjs/VoltraModule.js +13 -0
- package/build/commonjs/VoltraModule.js.map +1 -0
- package/build/commonjs/components/VoltraLiveActivityPreview.js +30 -0
- package/build/commonjs/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/commonjs/components/VoltraView.js +50 -0
- package/build/commonjs/components/VoltraView.js.map +1 -0
- package/build/commonjs/components/VoltraWidgetPreview.js +58 -0
- package/build/commonjs/components/VoltraWidgetPreview.js.map +1 -0
- package/build/commonjs/events.js +32 -0
- package/build/commonjs/events.js.map +1 -0
- package/build/commonjs/helpers.js +26 -0
- package/build/commonjs/helpers.js.map +1 -0
- package/build/commonjs/index.js +226 -0
- package/build/commonjs/index.js.map +1 -0
- package/build/commonjs/live-activity/api.js +168 -0
- package/build/commonjs/live-activity/api.js.map +1 -0
- package/build/commonjs/logger.js +39 -0
- package/build/commonjs/logger.js.map +1 -0
- package/build/commonjs/native/NativeVoltra.js +15 -0
- package/build/commonjs/native/NativeVoltra.js.map +1 -0
- package/build/commonjs/native/VoltraRNNativeComponent.ts +9 -0
- package/build/commonjs/package.json +1 -0
- package/build/commonjs/preload.js +54 -0
- package/build/commonjs/preload.js.map +1 -0
- package/build/commonjs/types.js +2 -0
- package/build/commonjs/types.js.map +1 -0
- package/build/commonjs/utils/assertRunningOnApple.js +16 -0
- package/build/commonjs/utils/assertRunningOnApple.js.map +1 -0
- package/build/commonjs/utils/helpers.js +19 -0
- package/build/commonjs/utils/helpers.js.map +1 -0
- package/build/commonjs/utils/index.js +28 -0
- package/build/commonjs/utils/index.js.map +1 -0
- package/build/commonjs/utils/useUpdateOnHMR.js +25 -0
- package/build/commonjs/utils/useUpdateOnHMR.js.map +1 -0
- package/build/commonjs/widgets/server-credentials.js +18 -0
- package/build/commonjs/widgets/server-credentials.js.map +1 -0
- package/build/commonjs/widgets/widget-api.js +55 -0
- package/build/commonjs/widgets/widget-api.js.map +1 -0
- package/build/module/VoltraModule.js +4 -0
- package/build/module/VoltraModule.js.map +1 -0
- package/build/module/components/VoltraLiveActivityPreview.js +25 -0
- package/build/module/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/module/components/VoltraView.js +44 -0
- package/build/module/components/VoltraView.js.map +1 -0
- package/build/module/components/VoltraWidgetPreview.js +53 -0
- package/build/module/components/VoltraWidgetPreview.js.map +1 -0
- package/build/module/events.js +28 -0
- package/build/module/events.js.map +1 -0
- package/build/module/helpers.js +21 -0
- package/build/module/helpers.js.map +1 -0
- package/build/module/index.js +17 -0
- package/build/module/index.js.map +1 -0
- package/build/module/live-activity/api.js +158 -0
- package/build/module/live-activity/api.js.map +1 -0
- package/build/module/logger.js +35 -0
- package/build/module/logger.js.map +1 -0
- package/build/module/native/NativeVoltra.js +11 -0
- package/build/module/native/NativeVoltra.js.map +1 -0
- package/build/module/native/VoltraRNNativeComponent.ts +9 -0
- package/build/module/package.json +1 -0
- package/build/module/preload.js +48 -0
- package/build/module/preload.js.map +1 -0
- package/build/module/types.js +2 -0
- package/build/module/types.js.map +1 -0
- package/build/module/utils/assertRunningOnApple.js +11 -0
- package/build/module/utils/assertRunningOnApple.js.map +1 -0
- package/build/module/utils/helpers.js +4 -0
- package/build/module/utils/helpers.js.map +1 -0
- package/build/module/utils/index.js +5 -0
- package/build/module/utils/index.js.map +1 -0
- package/build/module/utils/useUpdateOnHMR.js +20 -0
- package/build/module/utils/useUpdateOnHMR.js.map +1 -0
- package/build/module/widgets/server-credentials.js +13 -0
- package/build/module/widgets/server-credentials.js.map +1 -0
- package/build/module/widgets/widget-api.js +45 -0
- package/build/module/widgets/widget-api.js.map +1 -0
- package/build/typescript/commonjs/VoltraModule.d.ts +3 -0
- package/build/typescript/commonjs/VoltraModule.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraView.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/typescript/commonjs/events.d.ts.map +1 -0
- package/build/typescript/commonjs/helpers.d.ts.map +1 -0
- package/build/{types → typescript/commonjs}/index.d.ts +5 -0
- package/build/typescript/commonjs/index.d.ts.map +1 -0
- package/build/typescript/commonjs/live-activity/api.d.ts.map +1 -0
- package/build/typescript/commonjs/logger.d.ts.map +1 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts +100 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts.map +1 -0
- package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts +8 -0
- package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts.map +1 -0
- package/build/typescript/commonjs/package.json +1 -0
- package/build/typescript/commonjs/preload.d.ts.map +1 -0
- package/build/typescript/commonjs/types.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/helpers.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/index.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/typescript/commonjs/widgets/server-credentials.d.ts.map +1 -0
- package/build/typescript/commonjs/widgets/widget-api.d.ts.map +1 -0
- package/build/typescript/module/VoltraModule.d.ts +3 -0
- package/build/typescript/module/VoltraModule.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts +7 -0
- package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraView.d.ts +12 -0
- package/build/typescript/module/components/VoltraView.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraWidgetPreview.d.ts +9 -0
- package/build/typescript/module/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/typescript/module/events.d.ts +33 -0
- package/build/typescript/module/events.d.ts.map +1 -0
- package/build/typescript/module/helpers.d.ts +3 -0
- package/build/typescript/module/helpers.d.ts.map +1 -0
- package/build/typescript/module/index.d.ts +18 -0
- package/build/typescript/module/index.d.ts.map +1 -0
- package/build/typescript/module/live-activity/api.d.ts +35 -0
- package/build/typescript/module/live-activity/api.d.ts.map +1 -0
- package/build/typescript/module/logger.d.ts +16 -0
- package/build/typescript/module/logger.d.ts.map +1 -0
- package/build/typescript/module/native/NativeVoltra.d.ts +100 -0
- package/build/typescript/module/native/NativeVoltra.d.ts.map +1 -0
- package/build/typescript/module/native/VoltraRNNativeComponent.d.ts +8 -0
- package/build/typescript/module/native/VoltraRNNativeComponent.d.ts.map +1 -0
- package/build/typescript/module/package.json +1 -0
- package/build/typescript/module/preload.d.ts +6 -0
- package/build/typescript/module/preload.d.ts.map +1 -0
- package/build/typescript/module/types.d.ts +2 -0
- package/build/typescript/module/types.d.ts.map +1 -0
- package/build/typescript/module/utils/assertRunningOnApple.d.ts +2 -0
- package/build/typescript/module/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/{esm/utils/helpers.js → typescript/module/utils/helpers.d.ts} +1 -1
- package/build/typescript/module/utils/helpers.d.ts.map +1 -0
- package/build/{esm/utils/index.js → typescript/module/utils/index.d.ts} +1 -1
- package/build/typescript/module/utils/index.d.ts.map +1 -0
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts +5 -0
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/typescript/module/widgets/server-credentials.d.ts +5 -0
- package/build/typescript/module/widgets/server-credentials.d.ts.map +1 -0
- package/build/typescript/module/widgets/widget-api.d.ts +11 -0
- package/build/typescript/module/widgets/widget-api.d.ts.map +1 -0
- package/expo-plugin/app.plugin.js +3 -0
- package/expo-plugin/build/cjs/constants.js +23 -0
- package/expo-plugin/build/cjs/constants.js.map +1 -0
- package/expo-plugin/build/cjs/index.js +51 -0
- package/expo-plugin/build/cjs/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios/eas.js +28 -0
- package/expo-plugin/build/cjs/ios/eas.js.map +1 -0
- package/expo-plugin/build/cjs/ios/entitlements.js +46 -0
- package/expo-plugin/build/cjs/ios/entitlements.js.map +1 -0
- package/expo-plugin/build/cjs/ios/index.js +39 -0
- package/expo-plugin/build/cjs/ios/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios/infoPlist.js +51 -0
- package/expo-plugin/build/cjs/ios/infoPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios/pushNotifications.js +22 -0
- package/expo-plugin/build/cjs/ios/pushNotifications.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/eas.js +66 -0
- package/expo-plugin/build/cjs/ios-widget/eas.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/assets.js +199 -0
- package/expo-plugin/build/cjs/ios-widget/files/assets.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/entitlements.js +77 -0
- package/expo-plugin/build/cjs/ios-widget/files/entitlements.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js +92 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js +91 -0
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js +443 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/fonts.js +151 -0
- package/expo-plugin/build/cjs/ios-widget/fonts.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/index.js +46 -0
- package/expo-plugin/build/cjs/ios-widget/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/podfile.js +41 -0
- package/expo-plugin/build/cjs/ios-widget/podfile.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js +99 -0
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js +247 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js +91 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js +79 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js +155 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js +71 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js +74 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js +113 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js.map +1 -0
- package/expo-plugin/build/cjs/utils/fileDiscovery.js +120 -0
- package/expo-plugin/build/cjs/utils/fileDiscovery.js.map +1 -0
- package/expo-plugin/build/cjs/utils/urlScheme.js +40 -0
- package/expo-plugin/build/cjs/utils/urlScheme.js.map +1 -0
- package/expo-plugin/build/cjs/validation.js +55 -0
- package/expo-plugin/build/cjs/validation.js.map +1 -0
- package/expo-plugin/build/esm/constants.js +20 -0
- package/expo-plugin/build/esm/constants.js.map +1 -0
- package/expo-plugin/build/esm/index.js +49 -0
- package/expo-plugin/build/esm/index.js.map +1 -0
- package/expo-plugin/build/esm/ios/eas.js +24 -0
- package/expo-plugin/build/esm/ios/eas.js.map +1 -0
- package/expo-plugin/build/esm/ios/entitlements.js +42 -0
- package/expo-plugin/build/esm/ios/entitlements.js.map +1 -0
- package/expo-plugin/build/esm/ios/index.js +34 -0
- package/expo-plugin/build/esm/ios/index.js.map +1 -0
- package/expo-plugin/build/esm/ios/infoPlist.js +47 -0
- package/expo-plugin/build/esm/ios/infoPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios/pushNotifications.js +18 -0
- package/expo-plugin/build/esm/ios/pushNotifications.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/eas.js +62 -0
- package/expo-plugin/build/esm/ios-widget/eas.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/assets.js +163 -0
- package/expo-plugin/build/esm/ios-widget/files/assets.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/entitlements.js +37 -0
- package/expo-plugin/build/esm/ios-widget/files/entitlements.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js +55 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js +55 -0
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js +403 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/fonts.js +111 -0
- package/expo-plugin/build/esm/ios-widget/fonts.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/index.js +42 -0
- package/expo-plugin/build/esm/ios-widget/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/podfile.js +37 -0
- package/expo-plugin/build/esm/ios-widget/podfile.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js +92 -0
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js +210 -0
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js +87 -0
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js +75 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/index.js +118 -0
- package/expo-plugin/build/esm/ios-widget/xcode/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js +68 -0
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js +70 -0
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/target.js +108 -0
- package/expo-plugin/build/esm/ios-widget/xcode/target.js.map +1 -0
- package/expo-plugin/build/esm/utils/fileDiscovery.js +83 -0
- package/expo-plugin/build/esm/utils/fileDiscovery.js.map +1 -0
- package/expo-plugin/build/esm/utils/urlScheme.js +37 -0
- package/expo-plugin/build/esm/utils/urlScheme.js.map +1 -0
- package/expo-plugin/build/esm/validation.js +51 -0
- package/expo-plugin/build/esm/validation.js.map +1 -0
- package/expo-plugin/build/types/constants.d.ts +13 -0
- package/expo-plugin/build/types/constants.d.ts.map +1 -0
- package/expo-plugin/build/types/index.d.ts +10 -0
- package/expo-plugin/build/types/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/eas.d.ts +12 -0
- package/expo-plugin/build/types/ios/eas.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/entitlements.d.ts +14 -0
- package/expo-plugin/build/types/ios/entitlements.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/index.d.ts +19 -0
- package/expo-plugin/build/types/ios/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts +21 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/pushNotifications.d.ts +10 -0
- package/expo-plugin/build/types/ios/pushNotifications.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/eas.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/eas.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/assets.d.ts +13 -0
- package/expo-plugin/build/types/ios-widget/files/assets.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts +17 -0
- package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts +24 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts +10 -0
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts +24 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/fonts.d.ts +22 -0
- package/expo-plugin/build/types/ios-widget/fonts.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/index.d.ts +31 -0
- package/expo-plugin/build/types/ios-widget/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/podfile.d.ts +9 -0
- package/expo-plugin/build/types/ios-widget/podfile.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts +25 -0
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts +14 -0
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts +42 -0
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts.map +1 -0
- package/expo-plugin/build/types/types.d.ts +74 -0
- package/expo-plugin/build/types/types.d.ts.map +1 -0
- package/expo-plugin/build/types/utils/fileDiscovery.d.ts +15 -0
- package/expo-plugin/build/types/utils/fileDiscovery.d.ts.map +1 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts +10 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts.map +1 -0
- package/expo-plugin/build/types/validation.d.ts +4 -0
- package/expo-plugin/build/types/validation.d.ts.map +1 -0
- package/expo-plugin/jest.config.js +18 -0
- package/expo-plugin/src/constants.ts +25 -0
- package/expo-plugin/src/index.ts +72 -0
- package/expo-plugin/src/ios/eas.ts +33 -0
- package/expo-plugin/src/ios/entitlements.ts +59 -0
- package/expo-plugin/src/ios/index.ts +47 -0
- package/expo-plugin/src/ios/infoPlist.ts +63 -0
- package/expo-plugin/src/ios/pushNotifications.ts +22 -0
- package/expo-plugin/src/ios-widget/eas.ts +79 -0
- package/expo-plugin/src/ios-widget/files/assets.ts +201 -0
- package/expo-plugin/src/ios-widget/files/entitlements.ts +48 -0
- package/expo-plugin/src/ios-widget/files/index.ts +74 -0
- package/expo-plugin/src/ios-widget/files/infoPlist.ts +57 -0
- package/expo-plugin/src/ios-widget/files/swift.node.test.ts +22 -0
- package/expo-plugin/src/ios-widget/files/swift.ts +476 -0
- package/expo-plugin/src/ios-widget/fonts.ts +132 -0
- package/expo-plugin/src/ios-widget/index.ts +73 -0
- package/expo-plugin/src/ios-widget/podfile.ts +44 -0
- package/expo-plugin/src/ios-widget/widgetPlist.ts +115 -0
- package/expo-plugin/src/ios-widget/xcode/buildPhases.ts +301 -0
- package/expo-plugin/src/ios-widget/xcode/configurationList.ts +127 -0
- package/expo-plugin/src/ios-widget/xcode/groups.ts +101 -0
- package/expo-plugin/src/ios-widget/xcode/index.ts +149 -0
- package/expo-plugin/src/ios-widget/xcode/mainAppSettings.ts +95 -0
- package/expo-plugin/src/ios-widget/xcode/productFile.ts +91 -0
- package/expo-plugin/src/ios-widget/xcode/target.ts +148 -0
- package/expo-plugin/src/types.ts +89 -0
- package/expo-plugin/src/utils/fileDiscovery.ts +96 -0
- package/expo-plugin/src/utils/urlScheme.ts +45 -0
- package/expo-plugin/src/validation.node.test.ts +19 -0
- package/expo-plugin/src/validation.ts +63 -0
- package/expo-plugin/tsconfig.base.json +17 -0
- package/expo-plugin/tsconfig.cjs.json +9 -0
- package/expo-plugin/tsconfig.esm.json +9 -0
- package/expo-plugin/tsconfig.jest.json +8 -0
- package/expo-plugin/tsconfig.typecheck.json +12 -0
- package/expo-plugin/tsconfig.types.json +10 -0
- package/ios/Package.swift +68 -0
- package/ios/Tests/JSGradientParserTests.swift +201 -0
- package/ios/Tests/VoltraSharedTests/SmokeTests.swift +8 -0
- package/ios/VoltraWidget.podspec +30 -0
- package/ios/app/NativeVoltra.h +5 -0
- package/ios/app/NativeVoltra.mm +211 -0
- package/ios/app/VoltraActivity.swift +5 -0
- package/ios/app/VoltraImagePreload.swift +154 -0
- package/ios/app/VoltraLiveActivityManager.swift +228 -0
- package/ios/app/VoltraLiveActivityService.swift +306 -0
- package/ios/app/VoltraModule.swift +215 -0
- package/ios/app/VoltraModuleImpl.swift +331 -0
- package/ios/app/VoltraOptions.swift +27 -0
- package/ios/app/VoltraViewComponentView.h +10 -0
- package/ios/app/VoltraViewComponentView.mm +67 -0
- package/ios/app/VoltraViewRoot.swift +63 -0
- package/ios/app/VoltraWidgetService.swift +154 -0
- package/ios/shared/BrotliCompression.swift +81 -0
- package/ios/shared/ComponentTypeID.swift +117 -0
- package/ios/shared/Data+hexString.swift +8 -0
- package/ios/shared/Date+toTimerInterval.swift +25 -0
- package/ios/shared/JSONValue.swift +128 -0
- package/ios/shared/ShortNames.swift +180 -0
- package/ios/shared/VoltraAttributes.swift +58 -0
- package/ios/shared/VoltraConfig.swift +18 -0
- package/ios/shared/VoltraConstants.swift +45 -0
- package/ios/shared/VoltraElement.swift +153 -0
- package/ios/shared/VoltraEvent.swift +72 -0
- package/ios/shared/VoltraEventBus.swift +80 -0
- package/ios/shared/VoltraImageStore.swift +119 -0
- package/ios/shared/VoltraInitialStateLocale.swift +54 -0
- package/ios/shared/VoltraInteractionIntent.swift +39 -0
- package/ios/shared/VoltraKeychainHelper.swift +178 -0
- package/ios/shared/VoltraLiveActivityPayload.swift +113 -0
- package/ios/shared/VoltraLogger.swift +30 -0
- package/ios/shared/VoltraNode.swift +194 -0
- package/ios/shared/VoltraPayloadMigrator.swift +63 -0
- package/ios/shared/VoltraPersistentEventQueue.swift +67 -0
- package/ios/shared/VoltraRefreshIntent.swift +29 -0
- package/ios/shared/VoltraRegion.swift +37 -0
- package/ios/shared/VoltraWidgetDefaults.swift +114 -0
- package/ios/shared/VoltraWidgetServerFetcher.swift +166 -0
- package/ios/target/VoltraHomeWidget.swift +508 -0
- package/ios/target/VoltraWidget.swift +158 -0
- package/ios/ui/Extensions/View.modifiers.swift +28 -0
- package/ios/ui/Extensions/VoltraNode+Parameters.swift +18 -0
- package/ios/ui/Generated/Parameters/.generated +8 -0
- package/ios/ui/Generated/Parameters/ButtonParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/ChartParameters.swift +33 -0
- package/ios/ui/Generated/Parameters/CircularProgressViewParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/ComponentParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/DividerParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/GaugeParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/GlassContainerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/GroupBoxParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/HStackParameters.swift +34 -0
- package/ios/ui/Generated/Parameters/ImageParameters.swift +29 -0
- package/ios/ui/Generated/Parameters/LabelParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/LinearGradientParameters.swift +27 -0
- package/ios/ui/Generated/Parameters/LinearProgressViewParameters.swift +64 -0
- package/ios/ui/Generated/Parameters/LinkParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/MaskParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/SpacerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/SymbolParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/TextParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/TimerParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/ToggleParameters.swift +24 -0
- package/ios/ui/Generated/Parameters/VStackParameters.swift +34 -0
- package/ios/ui/Generated/Parameters/ViewParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/ZStackParameters.swift +15 -0
- package/ios/ui/Helpers/VoltraDeepLinkResolver.swift +43 -0
- package/ios/ui/Helpers/VoltraProgressDriver.swift +52 -0
- package/ios/ui/Layout/FlexContainerHelper.swift +114 -0
- package/ios/ui/Layout/VoltraFlexStackLayout.swift +417 -0
- package/ios/ui/Protocols/VoltraView.swift +29 -0
- package/ios/ui/Style/BackgroundValue.swift +27 -0
- package/ios/ui/Style/CompositeStyle.swift +81 -0
- package/ios/ui/Style/DecorationStyle.swift +207 -0
- package/ios/ui/Style/FlexEnvironment.swift +35 -0
- package/ios/ui/Style/FontVariant.swift +4 -0
- package/ios/ui/Style/GlassEffect.swift +6 -0
- package/ios/ui/Style/JSColorParser.swift +517 -0
- package/ios/ui/Style/JSGradientParser.swift +674 -0
- package/ios/ui/Style/JSStyleParser.swift +223 -0
- package/ios/ui/Style/LayoutStyle.swift +184 -0
- package/ios/ui/Style/Overflow.swift +4 -0
- package/ios/ui/Style/RenderingStyle.swift +33 -0
- package/ios/ui/Style/StyleConverter.swift +202 -0
- package/ios/ui/Style/TextDecoration.swift +6 -0
- package/ios/ui/Style/TextStyle.swift +50 -0
- package/ios/ui/Style/View+applyStyle.swift +38 -0
- package/ios/ui/Views/VoltraButton.swift +57 -0
- package/ios/ui/Views/VoltraChart.swift +840 -0
- package/ios/ui/Views/VoltraCircularProgressView.swift +103 -0
- package/ios/ui/Views/VoltraDivider.swift +16 -0
- package/ios/ui/Views/VoltraFlexView.swift +33 -0
- package/ios/ui/Views/VoltraGauge.swift +65 -0
- package/ios/ui/Views/VoltraGlassContainer.swift +29 -0
- package/ios/ui/Views/VoltraGroupBox.swift +26 -0
- package/ios/ui/Views/VoltraHStack.swift +70 -0
- package/ios/ui/Views/VoltraImage.swift +109 -0
- package/ios/ui/Views/VoltraLabel.swift +24 -0
- package/ios/ui/Views/VoltraLinearGradient.swift +115 -0
- package/ios/ui/Views/VoltraLinearProgressView.swift +118 -0
- package/ios/ui/Views/VoltraLink.swift +25 -0
- package/ios/ui/Views/VoltraMask.swift +23 -0
- package/ios/ui/Views/VoltraSpacer.swift +16 -0
- package/ios/ui/Views/VoltraSymbol.swift +160 -0
- package/ios/ui/Views/VoltraText.swift +87 -0
- package/ios/ui/Views/VoltraTimer.swift +131 -0
- package/ios/ui/Views/VoltraToggle.swift +39 -0
- package/ios/ui/Views/VoltraVStack.swift +68 -0
- package/ios/ui/Views/VoltraZStack.swift +33 -0
- package/ios/ui/Voltra.swift +86 -0
- package/package.json +91 -18
- package/build/cjs/VoltraModule.js +0 -6
- package/build/cjs/VoltraModule.js.map +0 -1
- package/build/cjs/components/VoltraLiveActivityPreview.js +0 -20
- package/build/cjs/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/cjs/components/VoltraView.js +0 -37
- package/build/cjs/components/VoltraView.js.map +0 -1
- package/build/cjs/components/VoltraWidgetPreview.js +0 -26
- package/build/cjs/components/VoltraWidgetPreview.js.map +0 -1
- package/build/cjs/events.js +0 -19
- package/build/cjs/events.js.map +0 -1
- package/build/cjs/helpers.js +0 -30
- package/build/cjs/helpers.js.map +0 -1
- package/build/cjs/index.js +0 -49
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/live-activity/api.js +0 -158
- package/build/cjs/live-activity/api.js.map +0 -1
- package/build/cjs/logger.js +0 -36
- package/build/cjs/logger.js.map +0 -1
- package/build/cjs/preload.js +0 -54
- package/build/cjs/preload.js.map +0 -1
- package/build/cjs/utils/assertRunningOnApple.js +0 -13
- package/build/cjs/utils/assertRunningOnApple.js.map +0 -1
- package/build/cjs/utils/helpers.js +0 -7
- package/build/cjs/utils/helpers.js.map +0 -1
- package/build/cjs/utils/index.js +0 -19
- package/build/cjs/utils/index.js.map +0 -1
- package/build/cjs/utils/useUpdateOnHMR.js +0 -22
- package/build/cjs/utils/useUpdateOnHMR.js.map +0 -1
- package/build/cjs/widgets/server-credentials.js +0 -18
- package/build/cjs/widgets/server-credentials.js.map +0 -1
- package/build/cjs/widgets/widget-api.js +0 -59
- package/build/cjs/widgets/widget-api.js.map +0 -1
- package/build/esm/VoltraModule.js +0 -4
- package/build/esm/VoltraModule.js.map +0 -1
- package/build/esm/components/VoltraLiveActivityPreview.js +0 -17
- package/build/esm/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/esm/components/VoltraView.js +0 -34
- package/build/esm/components/VoltraView.js.map +0 -1
- package/build/esm/components/VoltraWidgetPreview.js +0 -23
- package/build/esm/components/VoltraWidgetPreview.js.map +0 -1
- package/build/esm/events.js +0 -13
- package/build/esm/events.js.map +0 -1
- package/build/esm/helpers.js +0 -23
- package/build/esm/helpers.js.map +0 -1
- package/build/esm/index.js +0 -10
- package/build/esm/index.js.map +0 -1
- package/build/esm/live-activity/api.js +0 -146
- package/build/esm/live-activity/api.js.map +0 -1
- package/build/esm/logger.js +0 -33
- package/build/esm/logger.js.map +0 -1
- package/build/esm/preload.js +0 -46
- package/build/esm/preload.js.map +0 -1
- package/build/esm/utils/assertRunningOnApple.js +0 -9
- package/build/esm/utils/assertRunningOnApple.js.map +0 -1
- package/build/esm/utils/helpers.js.map +0 -1
- package/build/esm/utils/index.js.map +0 -1
- package/build/esm/utils/useUpdateOnHMR.js +0 -18
- package/build/esm/utils/useUpdateOnHMR.js.map +0 -1
- package/build/esm/widgets/server-credentials.js +0 -11
- package/build/esm/widgets/server-credentials.js.map +0 -1
- package/build/esm/widgets/widget-api.js +0 -47
- package/build/esm/widgets/widget-api.js.map +0 -1
- package/build/types/VoltraModule.d.ts +0 -44
- package/build/types/VoltraModule.d.ts.map +0 -1
- package/build/types/components/VoltraLiveActivityPreview.d.ts.map +0 -1
- package/build/types/components/VoltraView.d.ts.map +0 -1
- package/build/types/components/VoltraWidgetPreview.d.ts.map +0 -1
- package/build/types/events.d.ts.map +0 -1
- package/build/types/helpers.d.ts.map +0 -1
- package/build/types/index.d.ts.map +0 -1
- package/build/types/live-activity/api.d.ts.map +0 -1
- package/build/types/logger.d.ts.map +0 -1
- package/build/types/preload.d.ts.map +0 -1
- package/build/types/types.d.ts.map +0 -1
- package/build/types/utils/assertRunningOnApple.d.ts.map +0 -1
- package/build/types/utils/helpers.d.ts.map +0 -1
- package/build/types/utils/index.d.ts.map +0 -1
- package/build/types/utils/useUpdateOnHMR.d.ts.map +0 -1
- package/build/types/widgets/server-credentials.d.ts.map +0 -1
- package/build/types/widgets/widget-api.d.ts.map +0 -1
- /package/build/{types → typescript/commonjs}/components/VoltraLiveActivityPreview.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/components/VoltraView.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/components/VoltraWidgetPreview.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/events.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/helpers.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/live-activity/api.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/logger.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/preload.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/types.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/assertRunningOnApple.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/helpers.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/index.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/useUpdateOnHMR.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/widgets/server-credentials.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/widgets/widget-api.d.ts +0 -0
- /package/{build → expo-plugin/build}/cjs/package.json +0 -0
- /package/{build → expo-plugin/build}/cjs/types.js +0 -0
- /package/{build → expo-plugin/build}/cjs/types.js.map +0 -0
- /package/{build → expo-plugin/build}/esm/package.json +0 -0
- /package/{build → expo-plugin/build}/esm/types.js +0 -0
- /package/{build → expo-plugin/build}/esm/types.js.map +0 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import ActivityKit
|
|
2
|
+
import Compression
|
|
3
|
+
import Foundation
|
|
4
|
+
import os
|
|
5
|
+
import UIKit
|
|
6
|
+
|
|
7
|
+
/// Implementation details for VoltraModule to keep the main module file clean
|
|
8
|
+
public class VoltraModuleImpl {
|
|
9
|
+
private let liveActivityService = VoltraLiveActivityService()
|
|
10
|
+
|
|
11
|
+
public init() {
|
|
12
|
+
// Clean up data for widgets that are no longer installed
|
|
13
|
+
VoltraWidgetService.cleanupOrphanedData()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
func isHeadless() -> Bool {
|
|
17
|
+
if Thread.isMainThread {
|
|
18
|
+
return UIApplication.shared.applicationState == .background
|
|
19
|
+
}
|
|
20
|
+
return DispatchQueue.main.sync {
|
|
21
|
+
UIApplication.shared.applicationState == .background
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var pushNotificationsEnabled: Bool {
|
|
26
|
+
// Support both keys for compatibility with older plugin and new Voltra naming
|
|
27
|
+
let main = Bundle.main
|
|
28
|
+
return main.object(forInfoDictionaryKey: VoltraStorageKeys.enablePushNotifications) as? Bool ?? false
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// MARK: - Lifecycle & Monitoring
|
|
32
|
+
|
|
33
|
+
func startMonitoring(handler: @escaping (String, [String: Any]) -> Void) {
|
|
34
|
+
VoltraEventBus.shared.subscribe(handler: handler)
|
|
35
|
+
liveActivityService.startMonitoring(enablePush: pushNotificationsEnabled)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
func stopMonitoring() {
|
|
39
|
+
VoltraEventBus.shared.unsubscribe()
|
|
40
|
+
liveActivityService.stopMonitoring()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// MARK: - Live Activities
|
|
44
|
+
|
|
45
|
+
func startLiveActivity(jsonString: String, options: StartVoltraOptions?) async throws -> String {
|
|
46
|
+
guard #available(iOS 16.2, *) else { throw VoltraErrors.unsupportedOS }
|
|
47
|
+
guard VoltraLiveActivityService.areActivitiesEnabled() else {
|
|
48
|
+
throw VoltraErrors.liveActivitiesNotEnabled
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
do {
|
|
52
|
+
// Compress JSON using brotli level 2
|
|
53
|
+
let compressedJson = try BrotliCompression.compress(jsonString: jsonString)
|
|
54
|
+
try validatePayloadSize(compressedJson, operation: "start")
|
|
55
|
+
|
|
56
|
+
let activityName = options?.activityName?.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
57
|
+
|
|
58
|
+
// Extract staleDate and relevanceScore from options
|
|
59
|
+
let staleDate: Date? = {
|
|
60
|
+
if let staleDateMs = options?.staleDate?.doubleValue {
|
|
61
|
+
return Date(timeIntervalSince1970: staleDateMs / 1000.0)
|
|
62
|
+
}
|
|
63
|
+
return nil
|
|
64
|
+
}()
|
|
65
|
+
let relevanceScore: Double = options?.relevanceScore?.doubleValue ?? 0.0
|
|
66
|
+
|
|
67
|
+
let pushType = try resolvePushType(channelId: options?.channelId)
|
|
68
|
+
|
|
69
|
+
// Create request struct with compressed JSON
|
|
70
|
+
let createRequest = CreateActivityRequest(
|
|
71
|
+
activityId: activityName,
|
|
72
|
+
deepLinkUrl: options?.deepLinkUrl,
|
|
73
|
+
jsonString: compressedJson,
|
|
74
|
+
staleDate: staleDate,
|
|
75
|
+
relevanceScore: relevanceScore,
|
|
76
|
+
pushType: pushType,
|
|
77
|
+
endExistingWithSameName: true
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
// Create activity using service
|
|
81
|
+
return try await liveActivityService.createActivity(createRequest)
|
|
82
|
+
} catch {
|
|
83
|
+
VoltraLogger.module.error("startLiveActivity failed: \(error)")
|
|
84
|
+
throw mapError(error)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
func updateLiveActivity(activityId: String, jsonString: String, options: UpdateVoltraOptions?) async throws {
|
|
89
|
+
guard #available(iOS 16.2, *) else { throw VoltraErrors.unsupportedOS }
|
|
90
|
+
|
|
91
|
+
// Compress JSON using brotli level 2
|
|
92
|
+
let compressedJson = try BrotliCompression.compress(jsonString: jsonString)
|
|
93
|
+
try validatePayloadSize(compressedJson, operation: "update")
|
|
94
|
+
|
|
95
|
+
// Extract staleDate and relevanceScore from options
|
|
96
|
+
let staleDate: Date? = {
|
|
97
|
+
if let staleDateMs = options?.staleDate?.doubleValue {
|
|
98
|
+
return Date(timeIntervalSince1970: staleDateMs / 1000.0)
|
|
99
|
+
}
|
|
100
|
+
return nil
|
|
101
|
+
}()
|
|
102
|
+
let relevanceScore: Double = options?.relevanceScore?.doubleValue ?? 0.0
|
|
103
|
+
|
|
104
|
+
// Create update request struct with compressed JSON
|
|
105
|
+
let updateRequest = UpdateActivityRequest(
|
|
106
|
+
jsonString: compressedJson,
|
|
107
|
+
staleDate: staleDate,
|
|
108
|
+
relevanceScore: relevanceScore
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
do {
|
|
112
|
+
try await liveActivityService.updateActivity(byName: activityId, request: updateRequest)
|
|
113
|
+
} catch {
|
|
114
|
+
throw mapError(error)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
func endLiveActivity(activityId: String, options: EndVoltraOptions?) async throws {
|
|
119
|
+
guard #available(iOS 16.2, *) else { throw VoltraErrors.unsupportedOS }
|
|
120
|
+
|
|
121
|
+
// Convert dismissal policy options to ActivityKit type
|
|
122
|
+
let dismissalPolicy = convertToActivityKitDismissalPolicy(options?.dismissalPolicy)
|
|
123
|
+
|
|
124
|
+
do {
|
|
125
|
+
try await liveActivityService.endActivity(byName: activityId, dismissalPolicy: dismissalPolicy)
|
|
126
|
+
} catch {
|
|
127
|
+
throw mapError(error)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
func endAllLiveActivities() async throws {
|
|
132
|
+
guard #available(iOS 16.2, *) else { throw VoltraErrors.unsupportedOS }
|
|
133
|
+
await liveActivityService.endAllActivities()
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
func getLatestVoltraActivityId() -> String? {
|
|
137
|
+
guard #available(iOS 16.2, *) else { return nil }
|
|
138
|
+
return liveActivityService.getLatestActivity()?.id
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
func listVoltraActivityIds() -> [String] {
|
|
142
|
+
guard #available(iOS 16.2, *) else { return [] }
|
|
143
|
+
return liveActivityService.getAllActivities().map(\.id)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
func isLiveActivityActive(name: String) -> Bool {
|
|
147
|
+
guard #available(iOS 16.2, *) else { return false }
|
|
148
|
+
return liveActivityService.isActivityActive(name: name)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
func reloadLiveActivities(activityNames: [String]?) async throws {
|
|
152
|
+
guard #available(iOS 16.2, *) else { throw VoltraErrors.unsupportedOS }
|
|
153
|
+
|
|
154
|
+
let activities = liveActivityService.getAllActivities()
|
|
155
|
+
|
|
156
|
+
for activity in activities {
|
|
157
|
+
// If activityNames is provided, only reload those specific activities
|
|
158
|
+
if let names = activityNames, !names.isEmpty {
|
|
159
|
+
guard names.contains(activity.attributes.name) else { continue }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
do {
|
|
163
|
+
let newState = try VoltraAttributes.ContentState(
|
|
164
|
+
uiJsonData: activity.content.state.uiJsonData
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
await activity.update(
|
|
168
|
+
ActivityContent(
|
|
169
|
+
state: newState,
|
|
170
|
+
staleDate: nil,
|
|
171
|
+
relevanceScore: 0.0
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
VoltraLogger.activity.info("Reloaded Live Activity '\(activity.attributes.name)'")
|
|
175
|
+
} catch {
|
|
176
|
+
VoltraLogger.activity.error("Failed to reload Live Activity '\(activity.attributes.name)': \(error)")
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// MARK: - Image Preloading
|
|
182
|
+
|
|
183
|
+
func preloadImages(images: [PreloadImageOptions]) async throws -> PreloadImagesResult {
|
|
184
|
+
try await VoltraImagePreload.preloadImages(images: images)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
func clearPreloadedImages(keys: [String]?) async {
|
|
188
|
+
await VoltraImagePreload.clearPreloadedImages(keys: keys)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// MARK: - Widgets
|
|
192
|
+
|
|
193
|
+
func updateWidget(widgetId: String, jsonString: String, options: UpdateWidgetOptions?) async throws {
|
|
194
|
+
try VoltraWidgetService.setWidgetData(widgetId: widgetId, jsonString: jsonString, deepLinkUrl: options?.deepLinkUrl)
|
|
195
|
+
|
|
196
|
+
// Clear any scheduled timeline so single-entry data takes effect
|
|
197
|
+
VoltraWidgetService.removeTimeline(for: widgetId)
|
|
198
|
+
|
|
199
|
+
// Reload the widget timeline
|
|
200
|
+
VoltraWidgetService.reloadTimeline(for: widgetId)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
func scheduleWidget(widgetId: String, timelineJson: String) async throws {
|
|
204
|
+
try VoltraWidgetService.setTimeline(widgetId: widgetId, timelineJson: timelineJson)
|
|
205
|
+
|
|
206
|
+
// Reload the widget timeline to pick up scheduled entries
|
|
207
|
+
VoltraWidgetService.reloadTimeline(for: widgetId)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
func reloadWidgets(widgetIds: [String]?) async {
|
|
211
|
+
if let ids = widgetIds, !ids.isEmpty {
|
|
212
|
+
for widgetId in ids {
|
|
213
|
+
VoltraWidgetService.reloadTimeline(for: widgetId)
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
VoltraWidgetService.reloadAllTimelines()
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
func clearWidget(widgetId: String) async {
|
|
221
|
+
VoltraWidgetService.removeAllData(for: widgetId)
|
|
222
|
+
VoltraWidgetService.reloadTimeline(for: widgetId)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
func clearAllWidgets() async {
|
|
226
|
+
VoltraWidgetService.removeAllWidgets()
|
|
227
|
+
VoltraWidgetService.reloadAllTimelines()
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
func getActiveWidgets() async throws -> [[String: String]] {
|
|
231
|
+
try await VoltraWidgetService.getActiveWidgets()
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
func setWidgetServerCredentials(token: String, headers: [String: String]?) {
|
|
235
|
+
VoltraWidgetService.setWidgetServerCredentials(token: token, headers: headers)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
func clearWidgetServerCredentials() {
|
|
239
|
+
VoltraWidgetService.clearWidgetServerCredentials()
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// MARK: - Private Helpers
|
|
243
|
+
|
|
244
|
+
private func mapError(_ error: Error) -> Error {
|
|
245
|
+
if let moduleError = error as? VoltraErrors {
|
|
246
|
+
return moduleError
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if let serviceError = error as? VoltraLiveActivityError {
|
|
250
|
+
switch serviceError {
|
|
251
|
+
case .unsupportedOS:
|
|
252
|
+
return VoltraErrors.unsupportedOS
|
|
253
|
+
case .liveActivitiesNotEnabled:
|
|
254
|
+
return VoltraErrors.liveActivitiesNotEnabled
|
|
255
|
+
case .notFound:
|
|
256
|
+
return VoltraErrors.notFound
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return VoltraErrors.unexpectedError(error)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
private func resolvePushType(channelId rawChannelId: String?) throws -> PushType? {
|
|
263
|
+
guard let rawChannelId else {
|
|
264
|
+
return pushNotificationsEnabled ? .token : nil
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
let channelId = rawChannelId.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
268
|
+
guard !channelId.isEmpty else {
|
|
269
|
+
throw VoltraErrors.unexpectedError(
|
|
270
|
+
NSError(
|
|
271
|
+
domain: "VoltraModule",
|
|
272
|
+
code: -20,
|
|
273
|
+
userInfo: [NSLocalizedDescriptionKey: "channelId must be a non-empty string."]
|
|
274
|
+
)
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
guard pushNotificationsEnabled else {
|
|
279
|
+
throw VoltraErrors.unexpectedError(
|
|
280
|
+
NSError(
|
|
281
|
+
domain: "VoltraModule",
|
|
282
|
+
code: -21,
|
|
283
|
+
userInfo: [NSLocalizedDescriptionKey: "channelId requires enablePushNotifications: true in the Voltra plugin config."]
|
|
284
|
+
)
|
|
285
|
+
)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if #available(iOS 18.0, *) {
|
|
289
|
+
return .channel(channelId)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// On iOS <18, broadcast channels are unavailable, so fall back to token-based updates.
|
|
293
|
+
return .token
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
private func validatePayloadSize(_ compressedPayload: String, operation: String) throws {
|
|
297
|
+
let dataSize = compressedPayload.utf8.count
|
|
298
|
+
let safeBudget = VoltraConstants.compressedPayloadSafeBudget
|
|
299
|
+
let hardCap = VoltraConstants.maxPayloadSizeBytes
|
|
300
|
+
VoltraLogger.module.debug("Compressed payload: \(dataSize)B (budget \(safeBudget)B, hard cap \(hardCap)B)")
|
|
301
|
+
|
|
302
|
+
if dataSize > safeBudget {
|
|
303
|
+
throw VoltraErrors.unexpectedError(
|
|
304
|
+
NSError(
|
|
305
|
+
domain: "VoltraModule",
|
|
306
|
+
code: operation == "start" ? -10 : -11,
|
|
307
|
+
userInfo: [NSLocalizedDescriptionKey: "Compressed payload too large: \(dataSize)B (safe budget \(safeBudget)B, hard cap \(hardCap)B). Reduce the UI before \(operation == "start" ? "starting" : "updating") the Live Activity."]
|
|
308
|
+
)
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private func convertToActivityKitDismissalPolicy(_ options: DismissalPolicyOptions?) -> ActivityUIDismissalPolicy {
|
|
314
|
+
guard let options = options else {
|
|
315
|
+
return .immediate
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
switch options.type {
|
|
319
|
+
case "immediate":
|
|
320
|
+
return .immediate
|
|
321
|
+
case "after":
|
|
322
|
+
if let timestamp = options.date?.doubleValue {
|
|
323
|
+
let date = Date(timeIntervalSince1970: timestamp / 1000.0)
|
|
324
|
+
return .after(date)
|
|
325
|
+
}
|
|
326
|
+
return .immediate
|
|
327
|
+
default:
|
|
328
|
+
return .immediate
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
@objc public final class StartVoltraOptions: NSObject {
|
|
4
|
+
@objc public var activityName: String?
|
|
5
|
+
@objc public var deepLinkUrl: String?
|
|
6
|
+
@objc public var staleDate: NSNumber?
|
|
7
|
+
@objc public var relevanceScore: NSNumber?
|
|
8
|
+
@objc public var channelId: String?
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@objc public final class UpdateVoltraOptions: NSObject {
|
|
12
|
+
@objc public var staleDate: NSNumber?
|
|
13
|
+
@objc public var relevanceScore: NSNumber?
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@objc public final class DismissalPolicyOptions: NSObject {
|
|
17
|
+
@objc public var type: String = "immediate"
|
|
18
|
+
@objc public var date: NSNumber?
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@objc public final class EndVoltraOptions: NSObject {
|
|
22
|
+
@objc public var dismissalPolicy: DismissalPolicyOptions?
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@objc public final class UpdateWidgetOptions: NSObject {
|
|
26
|
+
@objc public var deepLinkUrl: String?
|
|
27
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#import "VoltraViewComponentView.h"
|
|
2
|
+
|
|
3
|
+
#if __has_include("Voltra/Voltra-Swift.h")
|
|
4
|
+
#import "Voltra/Voltra-Swift.h"
|
|
5
|
+
#else
|
|
6
|
+
#import "Voltra-Swift.h"
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#import <react/renderer/components/VoltraSpec/ComponentDescriptors.h>
|
|
10
|
+
#import <react/renderer/components/VoltraSpec/Props.h>
|
|
11
|
+
#import <react/renderer/components/VoltraSpec/RCTComponentViewHelpers.h>
|
|
12
|
+
|
|
13
|
+
using namespace facebook::react;
|
|
14
|
+
|
|
15
|
+
@interface VoltraViewComponentView () <RCTVoltraViewViewProtocol>
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation VoltraViewComponentView {
|
|
19
|
+
VoltraViewRoot *_contentView;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
23
|
+
if (self = [super initWithFrame:frame]) {
|
|
24
|
+
_contentView = [[VoltraViewRoot alloc] initWithFrame:CGRectZero];
|
|
25
|
+
[self addSubview:_contentView];
|
|
26
|
+
}
|
|
27
|
+
return self;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
- (instancetype)init {
|
|
31
|
+
return [self initWithFrame:CGRectZero];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
- (void)updateProps:(Props::Shared const &)props
|
|
35
|
+
oldProps:(Props::Shared const &)oldProps {
|
|
36
|
+
const auto &oldViewProps =
|
|
37
|
+
*std::static_pointer_cast<const VoltraViewProps>(_props);
|
|
38
|
+
const auto &newViewProps =
|
|
39
|
+
*std::static_pointer_cast<const VoltraViewProps>(props);
|
|
40
|
+
|
|
41
|
+
if (oldViewProps.viewId != newViewProps.viewId) {
|
|
42
|
+
NSString *viewId =
|
|
43
|
+
[[NSString alloc] initWithUTF8String:newViewProps.viewId.c_str()]
|
|
44
|
+
?: @"";
|
|
45
|
+
[_contentView setViewId:viewId];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (oldViewProps.payload != newViewProps.payload) {
|
|
49
|
+
NSString *payload =
|
|
50
|
+
[[NSString alloc] initWithUTF8String:newViewProps.payload.c_str()]
|
|
51
|
+
?: @"";
|
|
52
|
+
[_contentView setPayload:payload];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[super updateProps:props oldProps:oldProps];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void)layoutSubviews {
|
|
59
|
+
[super layoutSubviews];
|
|
60
|
+
_contentView.frame = self.bounds;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
64
|
+
return concreteComponentDescriptorProvider<VoltraViewComponentDescriptor>();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import SwiftUI
|
|
3
|
+
import UIKit
|
|
4
|
+
|
|
5
|
+
@objc public class VoltraViewRoot: UIView {
|
|
6
|
+
private var hostingController: UIHostingController<AnyView>?
|
|
7
|
+
private var root: VoltraNode = .empty
|
|
8
|
+
private var viewId: String = UUID().uuidString
|
|
9
|
+
|
|
10
|
+
override public init(frame: CGRect) {
|
|
11
|
+
super.init(frame: frame)
|
|
12
|
+
clipsToBounds = true
|
|
13
|
+
setupHostingController()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public required init?(coder: NSCoder) {
|
|
17
|
+
super.init(coder: coder)
|
|
18
|
+
clipsToBounds = true
|
|
19
|
+
setupHostingController()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private func setupHostingController() {
|
|
23
|
+
let view = Voltra(root: .empty, activityId: viewId)
|
|
24
|
+
let hostingController = UIHostingController(rootView: AnyView(view))
|
|
25
|
+
hostingController.view.backgroundColor = .clear
|
|
26
|
+
addSubview(hostingController.view)
|
|
27
|
+
self.hostingController = hostingController
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override public func layoutSubviews() {
|
|
31
|
+
super.layoutSubviews()
|
|
32
|
+
hostingController?.view.frame = bounds
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@objc public func setViewId(_ id: String) {
|
|
36
|
+
guard !id.isEmpty else { return }
|
|
37
|
+
viewId = id
|
|
38
|
+
updateView()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@objc public func setPayload(_ jsonString: String) {
|
|
42
|
+
do {
|
|
43
|
+
let json = try JSONValue.parse(from: jsonString)
|
|
44
|
+
root = VoltraNode.parse(from: json)
|
|
45
|
+
} catch {
|
|
46
|
+
VoltraLogger.module.error("Failed to parse payload in VoltraView: \(error)")
|
|
47
|
+
root = .empty
|
|
48
|
+
}
|
|
49
|
+
updateView()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private func updateView() {
|
|
53
|
+
hostingController?.view.removeFromSuperview()
|
|
54
|
+
|
|
55
|
+
let newView = Voltra(root: root, activityId: viewId)
|
|
56
|
+
let newHostingController = UIHostingController(rootView: AnyView(newView))
|
|
57
|
+
newHostingController.view.backgroundColor = .clear
|
|
58
|
+
newHostingController.view.frame = bounds
|
|
59
|
+
addSubview(newHostingController.view)
|
|
60
|
+
|
|
61
|
+
hostingController = newHostingController
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import os
|
|
3
|
+
import WidgetKit
|
|
4
|
+
|
|
5
|
+
/// App-side facade for all widget operations.
|
|
6
|
+
///
|
|
7
|
+
/// Delegates persistence to `VoltraWidgetDefaults` and system reload notifications
|
|
8
|
+
/// to `WidgetCenter`, so callers have a single collaborator and the storage layer
|
|
9
|
+
/// can be swapped without touching orchestration code.
|
|
10
|
+
///
|
|
11
|
+
/// Note: `VoltraWidgetDefaults` intentionally remains in `ios/shared/` because the
|
|
12
|
+
/// widget extension target reads from it directly — this service is app-target only.
|
|
13
|
+
enum VoltraWidgetService {
|
|
14
|
+
// MARK: - Storage (write)
|
|
15
|
+
|
|
16
|
+
static func setWidgetData(widgetId: String, jsonString: String, deepLinkUrl: String?) throws {
|
|
17
|
+
try VoltraWidgetDefaults.setWidgetJson(jsonString, for: widgetId, deepLinkUrl: deepLinkUrl)
|
|
18
|
+
VoltraLogger.widget.info("Widget data stored for '\(widgetId)'")
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static func setTimeline(widgetId: String, timelineJson: String) throws {
|
|
22
|
+
try VoltraWidgetDefaults.setTimeline(timelineJson, for: widgetId)
|
|
23
|
+
VoltraLogger.widget.info("Timeline stored for '\(widgetId)'")
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// MARK: - Storage (remove)
|
|
27
|
+
|
|
28
|
+
static func removeAllData(for widgetId: String) {
|
|
29
|
+
VoltraWidgetDefaults.removeAllData(for: widgetId)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static func removeTimeline(for widgetId: String) {
|
|
33
|
+
VoltraWidgetDefaults.removeTimeline(for: widgetId)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static func removeAllWidgets() {
|
|
37
|
+
VoltraWidgetDefaults.removeAllWidgets()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// MARK: - Reload
|
|
41
|
+
|
|
42
|
+
static func reloadTimeline(for widgetId: String) {
|
|
43
|
+
WidgetCenter.shared.reloadTimelines(ofKind: "\(VoltraStorageKeys.widgetKindPrefix)\(widgetId)")
|
|
44
|
+
VoltraLogger.widget.info("Reloaded timeline for '\(widgetId)'")
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static func reloadAllTimelines() {
|
|
48
|
+
WidgetCenter.shared.reloadAllTimelines()
|
|
49
|
+
VoltraLogger.widget.info("Reloaded all timelines")
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// MARK: - Server credentials
|
|
53
|
+
|
|
54
|
+
/// Saves widget server credentials to the Keychain and reloads all widget timelines
|
|
55
|
+
/// so extensions can use them on the next fetch.
|
|
56
|
+
static func setWidgetServerCredentials(token: String, headers: [String: String]?) {
|
|
57
|
+
VoltraKeychainHelper.saveToken(token)
|
|
58
|
+
if let headers = headers {
|
|
59
|
+
VoltraKeychainHelper.saveHeaders(headers)
|
|
60
|
+
} else {
|
|
61
|
+
VoltraKeychainHelper.deleteHeaders()
|
|
62
|
+
}
|
|
63
|
+
VoltraLogger.widget.info("Server credentials saved")
|
|
64
|
+
reloadAllTimelines()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// Clears widget server credentials from the Keychain and reloads all widget timelines.
|
|
68
|
+
static func clearWidgetServerCredentials() {
|
|
69
|
+
VoltraKeychainHelper.clearAll()
|
|
70
|
+
VoltraLogger.widget.info("Server credentials cleared")
|
|
71
|
+
reloadAllTimelines()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// MARK: - Query
|
|
75
|
+
|
|
76
|
+
/// Returns active widgets as dictionaries with `name`, `kind`, and `family` keys.
|
|
77
|
+
static func getActiveWidgets() async throws -> [[String: String]] {
|
|
78
|
+
try await withCheckedThrowingContinuation { continuation in
|
|
79
|
+
WidgetCenter.shared.getCurrentConfigurations { result in
|
|
80
|
+
switch result {
|
|
81
|
+
case let .success(widgetInfos):
|
|
82
|
+
let mapped = widgetInfos.map { widget -> [String: String] in
|
|
83
|
+
let prefix = VoltraStorageKeys.widgetKindPrefix
|
|
84
|
+
let name = widget.kind.hasPrefix(prefix)
|
|
85
|
+
? String(widget.kind.dropFirst(prefix.count))
|
|
86
|
+
: widget.kind
|
|
87
|
+
|
|
88
|
+
return [
|
|
89
|
+
"name": name,
|
|
90
|
+
"kind": widget.kind,
|
|
91
|
+
"family": mapWidgetFamily(widget.family),
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
continuation.resume(returning: mapped)
|
|
95
|
+
case let .failure(error):
|
|
96
|
+
continuation.resume(throwing: error)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/// Returns the set of widget IDs currently installed on the device.
|
|
103
|
+
/// Only IDs whose kind carries the Voltra prefix are included.
|
|
104
|
+
static func getInstalledWidgetIds() async throws -> Set<String> {
|
|
105
|
+
try await withCheckedThrowingContinuation { continuation in
|
|
106
|
+
WidgetCenter.shared.getCurrentConfigurations { result in
|
|
107
|
+
switch result {
|
|
108
|
+
case let .success(configs):
|
|
109
|
+
let ids = Set(configs.compactMap { config -> String? in
|
|
110
|
+
let prefix = VoltraStorageKeys.widgetKindPrefix
|
|
111
|
+
guard config.kind.hasPrefix(prefix) else { return nil }
|
|
112
|
+
return String(config.kind.dropFirst(prefix.count))
|
|
113
|
+
})
|
|
114
|
+
continuation.resume(returning: ids)
|
|
115
|
+
case let .failure(error):
|
|
116
|
+
continuation.resume(throwing: error)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// MARK: - Maintenance
|
|
123
|
+
|
|
124
|
+
/// Removes persisted data for any widget that is known to the app but no longer
|
|
125
|
+
/// installed on the device. Safe to call fire-and-forget from app startup.
|
|
126
|
+
static func cleanupOrphanedData() {
|
|
127
|
+
let knownWidgetIds = Bundle.main.object(forInfoDictionaryKey: VoltraStorageKeys.widgetIds) as? [String] ?? []
|
|
128
|
+
guard !knownWidgetIds.isEmpty else { return }
|
|
129
|
+
|
|
130
|
+
Task {
|
|
131
|
+
guard let installedIds = try? await getInstalledWidgetIds() else { return }
|
|
132
|
+
|
|
133
|
+
for widgetId in knownWidgetIds where !installedIds.contains(widgetId) {
|
|
134
|
+
VoltraWidgetDefaults.removeAllData(for: widgetId)
|
|
135
|
+
VoltraLogger.widget.info("Cleaned up orphaned data for '\(widgetId)'")
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// MARK: - Private helpers
|
|
141
|
+
|
|
142
|
+
private static func mapWidgetFamily(_ family: WidgetFamily) -> String {
|
|
143
|
+
switch family {
|
|
144
|
+
case .systemSmall: return "systemSmall"
|
|
145
|
+
case .systemMedium: return "systemMedium"
|
|
146
|
+
case .systemLarge: return "systemLarge"
|
|
147
|
+
case .systemExtraLarge: return "systemExtraLarge"
|
|
148
|
+
case .accessoryCircular: return "accessoryCircular"
|
|
149
|
+
case .accessoryRectangular: return "accessoryRectangular"
|
|
150
|
+
case .accessoryInline: return "accessoryInline"
|
|
151
|
+
@unknown default: return "unknown"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|