@legendapp/spark 0.0.2 → 0.0.4
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/init-template.cjs +7 -1
- package/package.json +10 -5
- package/patches/dependencies.json +252 -0
- package/patches/expo-application@55.0.19.patch +54 -0
- package/patches/expo-blur@55.0.18.patch +130 -0
- package/patches/expo-device@55.0.21.patch +149 -0
- package/patches/expo-font@55.0.8.patch +55 -0
- package/patches/expo-glass-effect@55.0.11.patch +304 -0
- package/patches/expo-haptics@55.0.18.patch +54 -0
- package/patches/expo-image-manipulator@55.0.21.patch +312 -0
- package/patches/expo-image-picker@55.0.24.patch +327 -0
- package/patches/expo-image@55.0.11.patch +158 -0
- package/patches/expo-keep-awake@55.0.8.patch +41 -0
- package/patches/expo-localization@55.0.19.patch +32 -0
- package/patches/expo-location@55.1.15.patch +190 -0
- package/patches/expo-symbols@55.0.9.patch +286 -0
- package/patches/expo-system-ui@55.0.22.patch +61 -0
- package/patches/expo-web-browser@55.0.20.patch +13 -0
- package/patches/react-native-app-logs@0.3.1.patch +20 -0
- package/patches/react-native-blurhash@2.1.3.patch +318 -0
- package/patches/react-native-community-blur@4.4.1.patch +415 -0
- package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
- package/patches/react-native-fast-image@10.9.9.patch +131 -0
- package/patches/react-native-graph@1.4.0.patch +157 -0
- package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
- package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
- package/patches/react-native-mmkv@4.3.2.patch +40 -0
- package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
- package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
- package/patches/react-native-nitro-zxing@0.3.1.patch +22 -0
- package/patches/react-native-quick-base64@3.0.1.patch +13 -0
- package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
- package/patches/react-native-release-profiler@0.4.5.patch +37 -0
- package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
- package/patches/react-native-screens@4.23.0.patch +160 -0
- package/patches/react-native-svg@15.15.3.patch +31 -0
- package/patches/react-native-unistyles@3.6.0.patch +203 -0
- package/patches/react-native-worklets-core@1.6.3.patch +13 -0
- package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
- package/patches/registry.json +615 -0
- package/patches/sentry-react-native@8.32.0.patch +76 -0
- package/patches/workspace/expo-audio@55.0.18.patch +159 -0
- package/patches/workspace/op-engineering-op-sqlite@18.2.1.patch +796 -0
- package/patches/workspace/react-native-nitro-modules@0.37.0.patch +1348 -0
- package/patches/workspace/react-native-runtimes-core@0.1.0-alpha.2.patch +276 -0
- package/patches/workspace/react-native-webview@16.0.0.patch +208 -0
- package/postinstall.cjs +10 -1
- package/skills/spark/SKILL.md +37 -4
- package/skills/spark/UPGRADING.md +150 -1
- package/skills/spark/ai-customize.md +39 -0
- package/skills/spark/app-and-documents.md +56 -0
- package/skills/spark/external-libraries.md +87 -0
- package/skills/spark/files.md +64 -0
- package/skills/spark/integrations.md +69 -0
- package/skills/spark/keyboard.md +54 -0
- package/skills/spark/library-compat.md +76 -0
- package/skills/spark/menus-tray-dock.md +83 -0
- package/skills/spark/storage-settings.md +85 -0
- package/skills/spark/ui.md +57 -0
- package/skills/spark/windows.md +91 -0
- package/ui-popover.ts +1 -0
- package/ui-progress.ts +1 -0
- package/ui-sheet.ts +1 -0
- package/ui-split-view.ts +1 -0
- package/ui-table.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -13
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +5 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +139 -104
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +16 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +19 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +10 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +57 -9
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.cjs +12 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrate.js +65 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +4 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +15 -8
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +35 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/patch.js +92 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +20 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +20 -20
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/package.json +5 -4
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.mm +1 -1
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-clipboard/src/desktop.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-codex/package.json +3 -7
- package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +3 -1
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +51 -10
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.mm +82 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -8
- package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +3 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +6 -8
- package/vendor/node_modules/@legendapp/spark-desktop-config/identity.cjs +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +315 -68
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +7 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.cjs +318 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.d.cts +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/validation.cjs +66 -9
- package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.mm +7 -2
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +235 -240
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -11
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +9 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/types.ts +32 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/validation.ts +28 -11
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/createWindowsNavigator.tsx +15 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/primaryWindowLifecycle.ts +12 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/usePrimaryWindowLifecycle.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/useWindowFocusEffect.ts +4 -1
- package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
- package/vendor/node_modules/@legendapp/spark-drag-drop/macos/RNDesktopDragView.mm +77 -17
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -8
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/DesktopDragViewNativeComponent.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/contracts.ts +13 -4
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +5 -3
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.h +6 -1
- package/vendor/node_modules/@legendapp/spark-expo-compat/metro.cjs +44 -0
- package/vendor/node_modules/@legendapp/spark-expo-compat/package.json +20 -0
- package/vendor/node_modules/@legendapp/spark-expo-compat/src/clipboard.ts +40 -0
- package/vendor/node_modules/@legendapp/spark-expo-compat/src/document-picker.ts +52 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +5 -2
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/types.ts +3 -3
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +1 -1
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -11
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-message-dialog/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -9
- package/vendor/node_modules/@legendapp/spark-native-menu/src/hooks.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-system/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-tray/src/index.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.mm +82 -14
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.h +1 -1
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +94 -11
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +235 -18
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.h +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.mm +216 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.h +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.mm +212 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewUpdates.h +6 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +26 -13
- package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.mm +126 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.mm +66 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.mm +118 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.mm +4 -12
- package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.mm +109 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +418 -102
- package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.mm +179 -0
- package/vendor/node_modules/@legendapp/spark-ui/package.json +9 -8
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkButtonNativeComponent.ts +10 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitView.tsx +99 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitViewNativeComponent.ts +29 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +34 -17
- package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +5 -4
- package/vendor/node_modules/@legendapp/spark-ui/src/checkbox-unavailable.tsx +20 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +24 -3
- package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +63 -13
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +12 -7
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +12 -7
- package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +35 -13
- package/vendor/node_modules/@legendapp/spark-ui/src/mobile-input.tsx +2 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/src/popover/PopoverNativeComponent.ts +20 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/popover/index.tsx +45 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/progress/ProgressIndicatorNativeComponent.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/progress/index.tsx +32 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/radio-group/RadioGroupNativeComponent.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sheet/SheetNativeComponent.ts +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sheet/index.tsx +38 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarItemNativeComponent.ts +9 -1
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarNativeComponent.ts +17 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/index.tsx +106 -22
- package/vendor/node_modules/@legendapp/spark-ui/src/table/TableNativeComponent.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/table/index.tsx +118 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +39 -6
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.h +46 -15
- package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -9
- package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
diff --git a/src/ExpoImage.macos.tsx b/src/ExpoImage.macos.tsx
|
|
2
|
+
new file mode 100644
|
|
3
|
+
index 0000000..cd859ac
|
|
4
|
+
--- /dev/null
|
|
5
|
+
+++ b/src/ExpoImage.macos.tsx
|
|
6
|
+
@@ -0,0 +1,128 @@
|
|
7
|
+
+// expo-image on macOS: React Native's Image stands in for the native view, which is UIKit
|
|
8
|
+
+// only. Sources (uri, headers, require(); the largest of several sizes), placeholders while
|
|
9
|
+
+// loading, contentFit, tintColor, the load events and reloadAsync work. Its SDWebImage
|
|
10
|
+
+// caches, blurhash/thumbhash and SF Symbol sources, contentPosition, transitions and
|
|
11
|
+
+// ImageRef sources are not supported; such a source reports onError.
|
|
12
|
+
+import React from 'react';
|
|
13
|
+
+import { Image, StyleSheet, View, type ImageProps, type ImageResizeMode } from 'react-native';
|
|
14
|
+
+
|
|
15
|
+
+import type { ImageContentFit, ImageNativeProps, ImageSource } from './Image.types';
|
|
16
|
+
+
|
|
17
|
+
+const fits: Record<ImageContentFit, ImageResizeMode> = {
|
|
18
|
+
+ cover: 'cover',
|
|
19
|
+
+ contain: 'contain',
|
|
20
|
+
+ fill: 'stretch',
|
|
21
|
+
+ none: 'center',
|
|
22
|
+
+ 'scale-down': 'center',
|
|
23
|
+
+};
|
|
24
|
+
+
|
|
25
|
+
+function largest(sources: ImageNativeProps['source']): ImageSource | undefined {
|
|
26
|
+
+ if (!Array.isArray(sources)) return undefined;
|
|
27
|
+
+ const area = (source: ImageSource) => (source.width ?? 0) * (source.height ?? 0);
|
|
28
|
+
+ const drawable = sources.filter(source => source.uri && !/^(blurhash|thumbhash|sf):\//.test(source.uri));
|
|
29
|
+
+ return drawable.reduce<ImageSource | undefined>((best, next) => (best && area(best) >= area(next) ? best : next), undefined);
|
|
30
|
+
+}
|
|
31
|
+
+
|
|
32
|
+
+// RN Image copies source dimensions into its layout; let contentFit control the size.
|
|
33
|
+
+function ImageWithFit({ source, contentFit, style, ...props }: Omit<ImageProps, 'source'> & {
|
|
34
|
+
+ source: ImageSource & { scale?: number }; contentFit: ImageContentFit;
|
|
35
|
+
+}) {
|
|
36
|
+
+ const { uri, headers, scale = 1 } = source;
|
|
37
|
+
+ const [size, setSize] = React.useState<{ uri: string; width: number; height: number }>();
|
|
38
|
+
+ React.useEffect(() => {
|
|
39
|
+
+ if (contentFit !== 'none' || !uri) return;
|
|
40
|
+
+ let active = true;
|
|
41
|
+
+ Image.getSizeWithHeaders(uri, headers ?? {}).then(({ width, height }) => {
|
|
42
|
+
+ if (active) setSize({ uri, width, height });
|
|
43
|
+
+ }, () => {}); // The Image's onError reports load failures.
|
|
44
|
+
+ return () => { active = false; };
|
|
45
|
+
+ }, [uri, headers, contentFit]);
|
|
46
|
+
+ const width = size && size.uri === uri ? size.width / scale : (source.width ?? 0);
|
|
47
|
+
+ const height = size && size.uri === uri ? size.height / scale : (source.height ?? 0);
|
|
48
|
+
+ return <Image {...props} source={{ uri, headers, scale }} resizeMode={fits[contentFit]} style={[
|
|
49
|
+
+ StyleSheet.absoluteFill, style,
|
|
50
|
+
+ contentFit === 'none' && {
|
|
51
|
+
+ width, height, left: '50%', top: '50%', right: undefined, bottom: undefined,
|
|
52
|
+
+ transform: [{ translateX: -width / 2 }, { translateY: -height / 2 }],
|
|
53
|
+
+ },
|
|
54
|
+
+ ]} />;
|
|
55
|
+
+}
|
|
56
|
+
+
|
|
57
|
+
+class ExpoImage extends React.PureComponent<ImageNativeProps, { attempt: number; loaded: boolean }> {
|
|
58
|
+
+ state = { attempt: 0, loaded: false };
|
|
59
|
+
+
|
|
60
|
+
+ startAnimating = () => {};
|
|
61
|
+
+ stopAnimating = () => {};
|
|
62
|
+
+ lockResourceAsync = async () => {};
|
|
63
|
+
+ unlockResourceAsync = async () => {};
|
|
64
|
+
+ reloadAsync = async () => this.setState(({ attempt }) => ({ attempt: attempt + 1, loaded: false }));
|
|
65
|
+
+
|
|
66
|
+
+ unsupported?: string;
|
|
67
|
+
+
|
|
68
|
+
+ componentDidMount() {
|
|
69
|
+
+ // Image calls startAnimating and reloadAsync through this ref, which holds the native view on iOS.
|
|
70
|
+
+ const ref = this.props.nativeViewRef as React.MutableRefObject<unknown> | undefined;
|
|
71
|
+
+ if (ref) ref.current = this;
|
|
72
|
+
+ this.reportUnsupported();
|
|
73
|
+
+ }
|
|
74
|
+
+
|
|
75
|
+
+ componentDidUpdate() {
|
|
76
|
+
+ this.reportUnsupported();
|
|
77
|
+
+ }
|
|
78
|
+
+
|
|
79
|
+
+ // A source with nothing to draw still settles, once per source, so load and error handlers run.
|
|
80
|
+
+ reportUnsupported() {
|
|
81
|
+
+ const { source } = this.props;
|
|
82
|
+
+ const key = largest(source) || source == null || (Array.isArray(source) && !source.length) ? undefined : JSON.stringify(source);
|
|
83
|
+
+ if (key === this.unsupported) return;
|
|
84
|
+
+ this.unsupported = key;
|
|
85
|
+
+ if (key === undefined) return;
|
|
86
|
+
+ this.props.onLoadStart?.();
|
|
87
|
+
+ this.props.onError?.({ error: 'expo-image cannot draw blurhash, thumbhash, SF Symbol or ImageRef sources on macOS' });
|
|
88
|
+
+ this.props.onLoadEnd?.();
|
|
89
|
+
+ }
|
|
90
|
+
+
|
|
91
|
+
+ render() {
|
|
92
|
+
+ const { source, placeholder, contentFit = 'cover', placeholderContentFit = 'scale-down', tintColor, style, accessibilityLabel, alt,
|
|
93
|
+
+ onLoadStart, onProgress, onLoad, onError, onLoadEnd, onDisplay, containerViewRef, nativeViewRef, ...props } = this.props;
|
|
94
|
+
+ const image = largest(source);
|
|
95
|
+
+ const fallback = largest(placeholder);
|
|
96
|
+
+ const tint = tintColor == null ? null : { tintColor: tintColor as string };
|
|
97
|
+
+ return (
|
|
98
|
+
+ <View ref={containerViewRef as never} {...(props as object)} accessibilityLabel={accessibilityLabel ?? alt} style={[styles.container, style]}>
|
|
99
|
+
+ {!this.state.loaded && fallback && (
|
|
100
|
+
+ <ImageWithFit source={fallback} contentFit={placeholderContentFit} style={tint} />
|
|
101
|
+
+ )}
|
|
102
|
+
+ {image && (
|
|
103
|
+
+ <ImageWithFit
|
|
104
|
+
+ key={this.state.attempt}
|
|
105
|
+
+ source={image}
|
|
106
|
+
+ contentFit={contentFit}
|
|
107
|
+
+ style={tint}
|
|
108
|
+
+ onLoadStart={() => onLoadStart?.()}
|
|
109
|
+
+ onProgress={event => onProgress?.({ loaded: event.nativeEvent.loaded, total: event.nativeEvent.total })}
|
|
110
|
+
+ onLoad={event => {
|
|
111
|
+
+ const loaded = (width: number, height: number) => {
|
|
112
|
+
+ this.setState({ loaded: true });
|
|
113
|
+
+ onLoad?.({ cacheType: 'none', source: { url: image.uri!, width, height, mediaType: null } });
|
|
114
|
+
+ onLoadEnd?.();
|
|
115
|
+
+ onDisplay?.();
|
|
116
|
+
+ };
|
|
117
|
+
+ // React Native macOS scales a 1x image's size by the screen's; getSize reads its pixels.
|
|
118
|
+
+ const { width, height } = event.nativeEvent.source;
|
|
119
|
+
+ Image.getSize(image.uri!).then(size => loaded(size.width, size.height), () => loaded(width, height));
|
|
120
|
+
+ }}
|
|
121
|
+
+ onError={event => {
|
|
122
|
+
+ onError?.({ error: String(event.nativeEvent.error) });
|
|
123
|
+
+ onLoadEnd?.();
|
|
124
|
+
+ }}
|
|
125
|
+
+ />
|
|
126
|
+
+ )}
|
|
127
|
+
+ </View>
|
|
128
|
+
+ );
|
|
129
|
+
+ }
|
|
130
|
+
+}
|
|
131
|
+
+
|
|
132
|
+
+const styles = StyleSheet.create({ container: { overflow: 'hidden' } });
|
|
133
|
+
+
|
|
134
|
+
+export default ExpoImage;
|
|
135
|
+
diff --git a/src/ImageModule.macos.ts b/src/ImageModule.macos.ts
|
|
136
|
+
new file mode 100644
|
|
137
|
+
index 0000000..1ffc9e3
|
|
138
|
+
--- /dev/null
|
|
139
|
+
+++ b/src/ImageModule.macos.ts
|
|
140
|
+
@@ -0,0 +1,18 @@
|
|
141
|
+
+// expo-image on macOS has no native module; see ExpoImage.macos.tsx.
|
|
142
|
+
+import { Image } from 'react-native';
|
|
143
|
+
+
|
|
144
|
+
+import type { ImageNativeModule } from './Image.types';
|
|
145
|
+
+
|
|
146
|
+
+const unsupported = (name: string) => () => Promise.reject(new Error(`Image.${name} is not supported on macOS`));
|
|
147
|
+
+
|
|
148
|
+
+export default {
|
|
149
|
+
+ Image: class {},
|
|
150
|
+
+ prefetch: (urls: string[]) => Promise.all(urls.map(url => Image.prefetch(url))).then(() => true, () => false),
|
|
151
|
+
+ clearMemoryCache: async () => false,
|
|
152
|
+
+ clearDiskCache: async () => false,
|
|
153
|
+
+ configureCache: () => {},
|
|
154
|
+
+ getCachePathAsync: async () => null,
|
|
155
|
+
+ loadAsync: unsupported('loadAsync'),
|
|
156
|
+
+ generateBlurhashAsync: unsupported('generateBlurhashAsync'),
|
|
157
|
+
+ generateThumbhashAsync: unsupported('generateThumbhashAsync'),
|
|
158
|
+
+} as unknown as ImageNativeModule;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
diff --git a/ios/KeepAwakeModule.swift b/ios/KeepAwakeModule.swift
|
|
2
|
+
index 835b4f1..22aac25 100644
|
|
3
|
+
--- a/ios/KeepAwakeModule.swift
|
|
4
|
+
+++ b/ios/KeepAwakeModule.swift
|
|
5
|
+
@@ -30,7 +30,9 @@ public final class KeepAwakeModule: Module {
|
|
6
|
+
return UIApplication.shared.isIdleTimerDisabled
|
|
7
|
+
}
|
|
8
|
+
#elseif os(macOS)
|
|
9
|
+
- return false
|
|
10
|
+
+ return DispatchQueue.main.sync {
|
|
11
|
+
+ return displaySleepActivity != nil
|
|
12
|
+
+ }
|
|
13
|
+
#endif
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@@ -48,10 +50,25 @@ public final class KeepAwakeModule: Module {
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
+#if os(macOS)
|
|
21
|
+
+// macOS has no idle timer to disable; a process activity holds the display and system awake instead.
|
|
22
|
+
+private var displaySleepActivity: NSObjectProtocol?
|
|
23
|
+
+#endif
|
|
24
|
+
+
|
|
25
|
+
private func setActivated(_ activated: Bool) {
|
|
26
|
+
#if os(iOS) || os(tvOS)
|
|
27
|
+
DispatchQueue.main.async {
|
|
28
|
+
UIApplication.shared.isIdleTimerDisabled = activated
|
|
29
|
+
}
|
|
30
|
+
+ #elseif os(macOS)
|
|
31
|
+
+ DispatchQueue.main.async {
|
|
32
|
+
+ if activated, displaySleepActivity == nil {
|
|
33
|
+
+ displaySleepActivity = ProcessInfo.processInfo.beginActivity(
|
|
34
|
+
+ options: [.idleDisplaySleepDisabled, .idleSystemSleepDisabled], reason: "expo-keep-awake")
|
|
35
|
+
+ } else if !activated, let activity = displaySleepActivity {
|
|
36
|
+
+ ProcessInfo.processInfo.endActivity(activity)
|
|
37
|
+
+ displaySleepActivity = nil
|
|
38
|
+
+ }
|
|
39
|
+
+ }
|
|
40
|
+
#endif
|
|
41
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
diff --git a/ios/ExpoLocalization.podspec b/ios/ExpoLocalization.podspec
|
|
2
|
+
index 29b720d..117b6a0 100644
|
|
3
|
+
--- a/ios/ExpoLocalization.podspec
|
|
4
|
+
+++ b/ios/ExpoLocalization.podspec
|
|
5
|
+
@@ -12,6 +12,7 @@ Pod::Spec.new do |s|
|
|
6
|
+
s.homepage = package['homepage']
|
|
7
|
+
s.platforms = {
|
|
8
|
+
:ios => '15.1',
|
|
9
|
+
+ :osx => '14.0',
|
|
10
|
+
:tvos => '15.1'
|
|
11
|
+
}
|
|
12
|
+
s.swift_version = '5.9'
|
|
13
|
+
diff --git a/ios/LocalizationModule.swift b/ios/LocalizationModule.swift
|
|
14
|
+
index ffc4593..df54b76 100644
|
|
15
|
+
--- a/ios/LocalizationModule.swift
|
|
16
|
+
+++ b/ios/LocalizationModule.swift
|
|
17
|
+
@@ -8,7 +8,14 @@ let CALENDAR_SETTINGS_CHANGED = "onCalendarSettingsChanged"
|
|
18
|
+
|
|
19
|
+
let OBSERVED_EVENTS: Set<Notification.Name> = [
|
|
20
|
+
// swiftlint:disable legacy_objc_type
|
|
21
|
+
- UIApplication.significantTimeChangeNotification,
|
|
22
|
+
+ // macOS has no significant-time-change notification; a time zone change is the closest.
|
|
23
|
+
+ {
|
|
24
|
+
+ #if os(macOS)
|
|
25
|
+
+ return Notification.Name.NSSystemTimeZoneDidChange
|
|
26
|
+
+ #else
|
|
27
|
+
+ return UIApplication.significantTimeChangeNotification
|
|
28
|
+
+ #endif
|
|
29
|
+
+ }(),
|
|
30
|
+
NSLocale.currentLocaleDidChangeNotification
|
|
31
|
+
// swiftlint:enable legacy_objc_type
|
|
32
|
+
]
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
diff --git a/ios/EXLocation.h b/ios/EXLocation.h
|
|
2
|
+
index 6e6c661..4954506 100644
|
|
3
|
+
--- a/ios/EXLocation.h
|
|
4
|
+
+++ b/ios/EXLocation.h
|
|
5
|
+
@@ -17,6 +17,8 @@ typedef NS_ENUM(NSUInteger, EXLocationAccuracy) {
|
|
6
|
+
|
|
7
|
+
+ (NSDictionary *)exportLocation:(CLLocation *)location;
|
|
8
|
+
+ (CLLocationAccuracy)CLLocationAccuracyFromOption:(EXLocationAccuracy)accuracy;
|
|
9
|
+
+#if !TARGET_OS_OSX
|
|
10
|
+
+ (CLActivityType)CLActivityTypeFromOption:(NSInteger)activityType;
|
|
11
|
+
+#endif
|
|
12
|
+
|
|
13
|
+
@end
|
|
14
|
+
diff --git a/ios/EXLocation.m b/ios/EXLocation.m
|
|
15
|
+
index 0442c37..ac375c6 100644
|
|
16
|
+
--- a/ios/EXLocation.m
|
|
17
|
+
+++ b/ios/EXLocation.m
|
|
18
|
+
@@ -42,6 +42,7 @@ + (CLLocationAccuracy)CLLocationAccuracyFromOption:(EXLocationAccuracy)accuracy
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
+#if !TARGET_OS_OSX
|
|
23
|
+
+ (CLActivityType)CLActivityTypeFromOption:(NSInteger)activityType
|
|
24
|
+
{
|
|
25
|
+
if (activityType >= CLActivityTypeOther && activityType <= CLActivityTypeOtherNavigation) {
|
|
26
|
+
@@ -52,6 +53,7 @@ + (CLActivityType)CLActivityTypeFromOption:(NSInteger)activityType
|
|
27
|
+
}
|
|
28
|
+
return CLActivityTypeOther;
|
|
29
|
+
}
|
|
30
|
+
+#endif
|
|
31
|
+
|
|
32
|
+
@end
|
|
33
|
+
|
|
34
|
+
diff --git a/ios/ExpoLocation.podspec b/ios/ExpoLocation.podspec
|
|
35
|
+
index df166fe..2214d91 100644
|
|
36
|
+
--- a/ios/ExpoLocation.podspec
|
|
37
|
+
+++ b/ios/ExpoLocation.podspec
|
|
38
|
+
@@ -11,7 +11,8 @@ Pod::Spec.new do |s|
|
|
39
|
+
s.author = package['author']
|
|
40
|
+
s.homepage = package['homepage']
|
|
41
|
+
s.platforms = {
|
|
42
|
+
- :ios => '15.1'
|
|
43
|
+
+ :ios => '15.1',
|
|
44
|
+
+ :osx => '14.0'
|
|
45
|
+
}
|
|
46
|
+
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
47
|
+
s.static_framework = true
|
|
48
|
+
diff --git a/ios/Providers/BaseLocationProvider.swift b/ios/Providers/BaseLocationProvider.swift
|
|
49
|
+
index ae9135a..98dcce1 100644
|
|
50
|
+
--- a/ios/Providers/BaseLocationProvider.swift
|
|
51
|
+
+++ b/ios/Providers/BaseLocationProvider.swift
|
|
52
|
+
@@ -9,7 +9,9 @@ internal class BaseLocationProvider: NSObject, CLLocationManagerDelegate {
|
|
53
|
+
@MainActor
|
|
54
|
+
init(options: LocationOptions) {
|
|
55
|
+
super.init()
|
|
56
|
+
+ #if !os(macOS)
|
|
57
|
+
manager.allowsBackgroundLocationUpdates = false
|
|
58
|
+
+ #endif
|
|
59
|
+
manager.distanceFilter = options.distanceInterval
|
|
60
|
+
manager.desiredAccuracy = options.accuracy.toCLLocationAccuracy()
|
|
61
|
+
manager.delegate = self
|
|
62
|
+
diff --git a/ios/Providers/DeviceHeadingStreamer.swift b/ios/Providers/DeviceHeadingStreamer.swift
|
|
63
|
+
index 802bf57..47d89a3 100644
|
|
64
|
+
--- a/ios/Providers/DeviceHeadingStreamer.swift
|
|
65
|
+
+++ b/ios/Providers/DeviceHeadingStreamer.swift
|
|
66
|
+
@@ -25,14 +25,19 @@ internal class DeviceHeadingStreamer: BaseStreamer {
|
|
67
|
+
}
|
|
68
|
+
let stream = DeviceHeadingStream { continuation in
|
|
69
|
+
self.continuation = continuation
|
|
70
|
+
+ // Macs have no compass; headingAvailable() is false there, so this is never reached.
|
|
71
|
+
+ #if !os(macOS)
|
|
72
|
+
manager.startUpdatingHeading()
|
|
73
|
+
+ #endif
|
|
74
|
+
}
|
|
75
|
+
headingStream = stream
|
|
76
|
+
return stream
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
override func stopStreaming() {
|
|
80
|
+
+ #if !os(macOS)
|
|
81
|
+
manager.stopUpdatingHeading()
|
|
82
|
+
+ #endif
|
|
83
|
+
continuation?.finish()
|
|
84
|
+
|
|
85
|
+
headingStream = nil
|
|
86
|
+
diff --git a/ios/Requesters/EXBackgroundLocationPermissionRequester.m b/ios/Requesters/EXBackgroundLocationPermissionRequester.m
|
|
87
|
+
index aa54f8c..a2e4918 100644
|
|
88
|
+
--- a/ios/Requesters/EXBackgroundLocationPermissionRequester.m
|
|
89
|
+
+++ b/ios/Requesters/EXBackgroundLocationPermissionRequester.m
|
|
90
|
+
@@ -14,6 +14,12 @@ @interface EXBackgroundLocationPermissionRequester ()
|
|
91
|
+
|
|
92
|
+
@end
|
|
93
|
+
|
|
94
|
+
+#if TARGET_OS_OSX
|
|
95
|
+
+#import <AppKit/AppKit.h>
|
|
96
|
+
+#define UIApplicationWillResignActiveNotification NSApplicationWillResignActiveNotification
|
|
97
|
+
+#define UIApplicationDidBecomeActiveNotification NSApplicationDidBecomeActiveNotification
|
|
98
|
+
+#endif
|
|
99
|
+
+
|
|
100
|
+
@implementation EXBackgroundLocationPermissionRequester
|
|
101
|
+
|
|
102
|
+
- (instancetype)init
|
|
103
|
+
diff --git a/ios/Requesters/EXBaseLocationRequester.h b/ios/Requesters/EXBaseLocationRequester.h
|
|
104
|
+
index ae63560..d29a8be 100644
|
|
105
|
+
--- a/ios/Requesters/EXBaseLocationRequester.h
|
|
106
|
+
+++ b/ios/Requesters/EXBaseLocationRequester.h
|
|
107
|
+
@@ -5,6 +5,11 @@
|
|
108
|
+
#import <ExpoModulesCore/EXPermissionsInterface.h>
|
|
109
|
+
#import <CoreLocation/CLLocationManagerDelegate.h>
|
|
110
|
+
|
|
111
|
+
+#if TARGET_OS_OSX
|
|
112
|
+
+// macOS has no when-in-use authorization and never reports it; keep the shared status switches compiling.
|
|
113
|
+
+#define kCLAuthorizationStatusAuthorizedWhenInUse ((CLAuthorizationStatus)4)
|
|
114
|
+
+#endif
|
|
115
|
+
+
|
|
116
|
+
@interface EXBaseLocationRequester : NSObject<EXPermissionsRequester, CLLocationManagerDelegate>
|
|
117
|
+
|
|
118
|
+
@property (nonatomic, strong) CLLocationManager *locationManager;
|
|
119
|
+
diff --git a/ios/Requesters/EXBaseLocationRequester.m b/ios/Requesters/EXBaseLocationRequester.m
|
|
120
|
+
index 350eb5f..c8f6d82 100644
|
|
121
|
+
--- a/ios/Requesters/EXBaseLocationRequester.m
|
|
122
|
+
+++ b/ios/Requesters/EXBaseLocationRequester.m
|
|
123
|
+
@@ -37,7 +37,12 @@ - (NSDictionary *)getPermissions {
|
|
124
|
+
|
|
125
|
+
CLAuthorizationStatus systemStatus;
|
|
126
|
+
if (![EXBaseLocationRequester isConfiguredForAlwaysAuthorization] && ![EXBaseLocationRequester isConfiguredForWhenInUseAuthorization]) {
|
|
127
|
+
+#if TARGET_OS_OSX
|
|
128
|
+
+ // RCTFatal throws in Release; on macOS the missing key reports denied, as it does in Debug.
|
|
129
|
+
+ RCTLogError(@"This app is missing NSLocationWhenInUseUsageDescription in its macOS Info.plist, so location services will fail.");
|
|
130
|
+
+#else
|
|
131
|
+
RCTFatal(RCTErrorWithMessage(@"This app is missing usage descriptions, so location services will fail. Add one of the `NSLocation*UsageDescription` keys to your bundle's Info.plist. See https://bit.ly/3iLqy6S (https://docs.expo.dev/distribution/app-stores/#system-permissions-dialogs-on-ios) for more information."));
|
|
132
|
+
+#endif
|
|
133
|
+
systemStatus = kCLAuthorizationStatusDenied;
|
|
134
|
+
} else {
|
|
135
|
+
systemStatus = [CLLocationManager authorizationStatus];
|
|
136
|
+
diff --git a/ios/TaskConsumers/EXGeofencingTaskConsumer.m b/ios/TaskConsumers/EXGeofencingTaskConsumer.m
|
|
137
|
+
index 7e6482e..c94f09e 100644
|
|
138
|
+
--- a/ios/TaskConsumers/EXGeofencingTaskConsumer.m
|
|
139
|
+
+++ b/ios/TaskConsumers/EXGeofencingTaskConsumer.m
|
|
140
|
+
@@ -71,8 +71,10 @@ - (void)startMonitoringRegionsForTask:(id<EXTaskInterface>)task
|
|
141
|
+
self->_regionStates = regionStates;
|
|
142
|
+
|
|
143
|
+
locationManager.delegate = self;
|
|
144
|
+
+#if !TARGET_OS_OSX
|
|
145
|
+
locationManager.allowsBackgroundLocationUpdates = YES;
|
|
146
|
+
locationManager.pausesLocationUpdatesAutomatically = NO;
|
|
147
|
+
+#endif
|
|
148
|
+
|
|
149
|
+
for (NSDictionary *regionDict in regions) {
|
|
150
|
+
NSString *identifier = regionDict[@"identifier"] ?: [[NSUUID UUID] UUIDString];
|
|
151
|
+
diff --git a/ios/TaskConsumers/EXLocationTaskConsumer.m b/ios/TaskConsumers/EXLocationTaskConsumer.m
|
|
152
|
+
index fe1d9dd..75df305 100644
|
|
153
|
+
--- a/ios/TaskConsumers/EXLocationTaskConsumer.m
|
|
154
|
+
+++ b/ios/TaskConsumers/EXLocationTaskConsumer.m
|
|
155
|
+
@@ -49,7 +49,9 @@ - (void)didRegisterTask:(id<EXTaskInterface>)task
|
|
156
|
+
self->_locationManager = locationManager;
|
|
157
|
+
|
|
158
|
+
locationManager.delegate = self;
|
|
159
|
+
+#if !TARGET_OS_OSX
|
|
160
|
+
locationManager.allowsBackgroundLocationUpdates = YES;
|
|
161
|
+
+#endif
|
|
162
|
+
|
|
163
|
+
// Set options-specific things in location manager.
|
|
164
|
+
[self setOptions:task.options];
|
|
165
|
+
@@ -69,9 +71,11 @@ - (void)setOptions:(NSDictionary *)options
|
|
166
|
+
|
|
167
|
+
locationManager.desiredAccuracy = [EXLocation CLLocationAccuracyFromOption:accuracy];
|
|
168
|
+
locationManager.distanceFilter = [self numberToDouble:options[@"distanceInterval"] defaultValue:kCLDistanceFilterNone];
|
|
169
|
+
+#if !TARGET_OS_OSX
|
|
170
|
+
locationManager.activityType = [EXLocation CLActivityTypeFromOption:[self numberToInteger:options[@"activityType"] defaultValue:CLActivityTypeOther]];
|
|
171
|
+
locationManager.pausesLocationUpdatesAutomatically = [self numberToBool:options[@"pausesUpdatesAutomatically"] defaultValue:true];
|
|
172
|
+
locationManager.showsBackgroundLocationIndicator = [self numberToBool:options[@"showsBackgroundLocationIndicator"] defaultValue:false];
|
|
173
|
+
+#endif
|
|
174
|
+
|
|
175
|
+
[locationManager startUpdatingLocation];
|
|
176
|
+
[locationManager startMonitoringSignificantLocationChanges];
|
|
177
|
+
@@ -145,9 +149,13 @@ - (BOOL)shouldReportDeferredLocations
|
|
178
|
+
if (_deferredLocations.count <= 0) {
|
|
179
|
+
return NO;
|
|
180
|
+
}
|
|
181
|
+
+#if TARGET_OS_OSX
|
|
182
|
+
+ if (NSApp.isActive) {
|
|
183
|
+
+#else
|
|
184
|
+
UIApplicationState appState = [[UIApplication sharedApplication] applicationState];
|
|
185
|
+
|
|
186
|
+
if (appState == UIApplicationStateActive) {
|
|
187
|
+
+#endif
|
|
188
|
+
// Don't defer location updates when app is in foreground state.
|
|
189
|
+
return YES;
|
|
190
|
+
}
|