expo-targets 0.2.9 → 0.3.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 +9 -10
- package/android/build.gradle +4 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsActivityHolder.kt +37 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsExtensionModule.kt +59 -8
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsHarnessActivity.kt +28 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsReactTargetActivity.kt +123 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsSharedIntent.kt +89 -0
- package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsTargetActivity.kt +363 -0
- package/android/src/main/java/expo/modules/targets/liveActivity/ExpoTargetsLiveActivityModule.kt +153 -0
- package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationModule.kt +134 -0
- package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationRouter.kt +192 -0
- package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationService.kt +92 -0
- package/android/src/main/java/expo/modules/targets/storage/ExpoTargetsStorageModule.kt +127 -42
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsAutofillService.kt +28 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsCallScreeningService.kt +47 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsDocumentsProvider.kt +148 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsFileProviderUiActivity.kt +47 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsInputMethodService.kt +41 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsPrintService.kt +34 -0
- package/android/src/main/java/expo/modules/targets/system/ExpoTargetsVpnService.kt +32 -0
- package/android/src/main/res/layout/expo_targets_notification_content.xml +29 -0
- package/android/src/main/res/xml/expo_targets_autofill_service.xml +3 -0
- package/android/src/main/res/xml/expo_targets_method.xml +9 -0
- package/android/src/main/res/xml/expo_targets_print_service.xml +4 -0
- package/bin/expo-targets.js +2 -0
- package/bin/export-safari-bundle.js +2 -0
- package/build/metro/src/index.d.ts +1 -1
- package/build/metro/src/index.d.ts.map +1 -1
- package/build/metro/src/index.js +5 -4
- package/build/metro/src/index.js.map +1 -1
- package/build/metro/src/{withTargetsMetro.d.ts → withTargets.d.ts} +6 -1
- package/build/metro/src/withTargets.d.ts.map +1 -0
- package/{metro/build/withTargetsMetro.js → build/metro/src/withTargets.js} +50 -14
- package/build/metro/src/withTargets.js.map +1 -0
- package/build/plugin/src/android/activationMime.d.ts +12 -0
- package/build/plugin/src/android/activationMime.d.ts.map +1 -0
- package/build/plugin/src/android/activationMime.js +47 -0
- package/build/plugin/src/android/activationMime.js.map +1 -0
- package/build/plugin/src/android/resolveUserClass.d.ts +14 -0
- package/build/plugin/src/android/resolveUserClass.d.ts.map +1 -0
- package/build/plugin/src/android/resolveUserClass.js +48 -0
- package/build/plugin/src/android/resolveUserClass.js.map +1 -0
- package/build/plugin/src/android/targetSourceSets.d.ts +9 -0
- package/build/plugin/src/android/targetSourceSets.d.ts.map +1 -0
- package/build/plugin/src/android/targetSourceSets.js +90 -0
- package/build/plugin/src/android/targetSourceSets.js.map +1 -0
- package/build/plugin/src/android/withAndroidNotification.d.ts +12 -0
- package/build/plugin/src/android/withAndroidNotification.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidNotification.js +192 -0
- package/build/plugin/src/android/withAndroidNotification.js.map +1 -0
- package/build/plugin/src/android/withAndroidShareAction.d.ts +11 -0
- package/build/plugin/src/android/withAndroidShareAction.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidShareAction.js +172 -0
- package/build/plugin/src/android/withAndroidShareAction.js.map +1 -0
- package/build/plugin/src/android/withAndroidSystemService.d.ts +12 -0
- package/build/plugin/src/android/withAndroidSystemService.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidSystemService.js +332 -0
- package/build/plugin/src/android/withAndroidSystemService.js.map +1 -0
- package/build/plugin/src/android/withAndroidTarget.d.ts +2 -1
- package/build/plugin/src/android/withAndroidTarget.d.ts.map +1 -1
- package/build/plugin/src/android/withAndroidTarget.js +25 -3
- package/build/plugin/src/android/withAndroidTarget.js.map +1 -1
- package/build/plugin/src/android/withAndroidTargetsConfig.d.ts +9 -0
- package/build/plugin/src/android/withAndroidTargetsConfig.d.ts.map +1 -0
- package/build/plugin/src/android/withAndroidTargetsConfig.js +52 -0
- package/build/plugin/src/android/withAndroidTargetsConfig.js.map +1 -0
- package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts +34 -0
- package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts.map +1 -0
- package/build/plugin/src/codegen/collectRuntimeConfigs.js +57 -0
- package/build/plugin/src/codegen/collectRuntimeConfigs.js.map +1 -0
- package/build/plugin/src/codegen/index.d.ts +7 -0
- package/build/plugin/src/codegen/index.d.ts.map +1 -0
- package/build/plugin/src/codegen/index.js +14 -0
- package/build/plugin/src/codegen/index.js.map +1 -0
- package/build/plugin/src/codegen/typedTargets.d.ts +20 -0
- package/build/plugin/src/codegen/typedTargets.d.ts.map +1 -0
- package/build/plugin/src/codegen/typedTargets.js +131 -0
- package/build/plugin/src/codegen/typedTargets.js.map +1 -0
- package/build/plugin/src/codegen/warnIfSealedHandEdited.d.ts +12 -0
- package/build/plugin/src/codegen/warnIfSealedHandEdited.d.ts.map +1 -0
- package/build/plugin/src/codegen/warnIfSealedHandEdited.js +32 -0
- package/build/plugin/src/codegen/warnIfSealedHandEdited.js.map +1 -0
- package/build/plugin/src/config.d.ts +37 -6
- package/build/plugin/src/config.d.ts.map +1 -1
- package/build/plugin/src/config.js.map +1 -1
- package/build/plugin/src/domain/characteristics.d.ts +8 -0
- package/build/plugin/src/domain/characteristics.d.ts.map +1 -1
- package/build/plugin/src/domain/characteristics.js +81 -10
- package/build/plugin/src/domain/characteristics.js.map +1 -1
- package/build/plugin/src/domain/index.d.ts +1 -1
- package/build/plugin/src/domain/index.d.ts.map +1 -1
- package/build/plugin/src/domain/index.js.map +1 -1
- package/build/plugin/src/ensureHostAppGroups.d.ts +16 -0
- package/build/plugin/src/ensureHostAppGroups.d.ts.map +1 -0
- package/build/plugin/src/ensureHostAppGroups.js +95 -0
- package/build/plugin/src/ensureHostAppGroups.js.map +1 -0
- package/build/plugin/src/ios/apply/fs/applyTargetPlan.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/fs/applyTargetPlan.js +3 -1
- package/build/plugin/src/ios/apply/fs/applyTargetPlan.js.map +1 -1
- package/build/plugin/src/ios/apply/fs/entitlements.d.ts +5 -1
- package/build/plugin/src/ios/apply/fs/entitlements.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/fs/entitlements.js +13 -1
- package/build/plugin/src/ios/apply/fs/entitlements.js.map +1 -1
- package/build/plugin/src/ios/apply/fs/safari.d.ts +4 -1
- package/build/plugin/src/ios/apply/fs/safari.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/fs/safari.js +19 -1
- package/build/plugin/src/ios/apply/fs/safari.js.map +1 -1
- package/build/plugin/src/ios/apply/fs/swift.d.ts +4 -1
- package/build/plugin/src/ios/apply/fs/swift.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/fs/swift.js +11 -2
- package/build/plugin/src/ios/apply/fs/swift.js.map +1 -1
- package/build/plugin/src/ios/apply/pbx/applyTargetPlan.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/pbx/applyTargetPlan.js +9 -0
- package/build/plugin/src/ios/apply/pbx/applyTargetPlan.js.map +1 -1
- package/build/plugin/src/ios/apply/pbx/index.d.ts +1 -0
- package/build/plugin/src/ios/apply/pbx/index.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/pbx/index.js +4 -1
- package/build/plugin/src/ios/apply/pbx/index.js.map +1 -1
- package/build/plugin/src/ios/apply/pbx/safariWebBundle.d.ts +15 -0
- package/build/plugin/src/ios/apply/pbx/safariWebBundle.d.ts.map +1 -0
- package/build/plugin/src/ios/apply/pbx/safariWebBundle.js +99 -0
- package/build/plugin/src/ios/apply/pbx/safariWebBundle.js.map +1 -0
- package/build/plugin/src/ios/apply/podfile/podfile.d.ts +0 -2
- package/build/plugin/src/ios/apply/podfile/podfile.d.ts.map +1 -1
- package/build/plugin/src/ios/apply/podfile/podfile.js +21 -6
- package/build/plugin/src/ios/apply/podfile/podfile.js.map +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.d.ts +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.d.ts.map +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.js +1 -1
- package/build/plugin/src/ios/cng/appShortcutsCodegen.js.map +1 -1
- package/build/plugin/src/ios/config-plugins/withEntitlements.d.ts.map +1 -1
- package/build/plugin/src/ios/config-plugins/withEntitlements.js +4 -1
- package/build/plugin/src/ios/config-plugins/withEntitlements.js.map +1 -1
- package/build/plugin/src/ios/observe/podsRb.d.ts +2 -1
- package/build/plugin/src/ios/observe/podsRb.d.ts.map +1 -1
- package/build/plugin/src/ios/observe/podsRb.js +2 -1
- package/build/plugin/src/ios/observe/podsRb.js.map +1 -1
- package/build/plugin/src/ios/plan/buildInfoPlist.js +1 -1
- package/build/plugin/src/ios/plan/buildInfoPlist.js.map +1 -1
- package/build/plugin/src/ios/plan/compose.d.ts.map +1 -1
- package/build/plugin/src/ios/plan/compose.js +3 -0
- package/build/plugin/src/ios/plan/compose.js.map +1 -1
- package/build/plugin/src/ios/plan/index.d.ts +2 -1
- package/build/plugin/src/ios/plan/index.d.ts.map +1 -1
- package/build/plugin/src/ios/plan/index.js +3 -1
- package/build/plugin/src/ios/plan/index.js.map +1 -1
- package/build/plugin/src/ios/plan/safari.d.ts.map +1 -1
- package/build/plugin/src/ios/plan/safari.js +1 -0
- package/build/plugin/src/ios/plan/safari.js.map +1 -1
- package/build/plugin/src/ios/plan/safariWebBundle.d.ts +7 -0
- package/build/plugin/src/ios/plan/safariWebBundle.d.ts.map +1 -0
- package/build/plugin/src/ios/plan/safariWebBundle.js +53 -0
- package/build/plugin/src/ios/plan/safariWebBundle.js.map +1 -0
- package/build/plugin/src/ios/plan/swiftSources.d.ts.map +1 -1
- package/build/plugin/src/ios/plan/swiftSources.js +10 -0
- package/build/plugin/src/ios/plan/swiftSources.js.map +1 -1
- package/build/plugin/src/ios/plan/types.d.ts +18 -0
- package/build/plugin/src/ios/plan/types.d.ts.map +1 -1
- package/build/plugin/src/ios/safari/exportSafariWebBundle.d.ts +20 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundle.d.ts.map +1 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundle.js +119 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundle.js.map +1 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundleCli.d.ts +2 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundleCli.d.ts.map +1 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundleCli.js +75 -0
- package/build/plugin/src/ios/safari/exportSafariWebBundleCli.js.map +1 -0
- package/build/plugin/src/ios/utils/paths.d.ts +2 -0
- package/build/plugin/src/ios/utils/paths.d.ts.map +1 -1
- package/build/plugin/src/ios/utils/paths.js +6 -1
- package/build/plugin/src/ios/utils/paths.js.map +1 -1
- package/build/plugin/src/ios/utils/reactNativeSwift.d.ts +3 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.d.ts.map +1 -1
- package/build/plugin/src/ios/utils/reactNativeSwift.js +3 -0
- package/build/plugin/src/ios/utils/reactNativeSwift.js.map +1 -1
- package/build/plugin/src/ios/utils/safari.d.ts +11 -4
- package/build/plugin/src/ios/utils/safari.d.ts.map +1 -1
- package/build/plugin/src/ios/utils/safari.js +57 -21
- package/build/plugin/src/ios/utils/safari.js.map +1 -1
- package/build/plugin/src/resolveExcludedPackages.d.ts +15 -0
- package/build/plugin/src/resolveExcludedPackages.d.ts.map +1 -0
- package/build/plugin/src/resolveExcludedPackages.js +30 -0
- package/build/plugin/src/resolveExcludedPackages.js.map +1 -0
- package/build/plugin/src/withTargetsDir.d.ts +5 -0
- package/build/plugin/src/withTargetsDir.d.ts.map +1 -1
- package/build/plugin/src/withTargetsDir.js +120 -37
- package/build/plugin/src/withTargetsDir.js.map +1 -1
- package/build/src/Target.d.ts +11 -6
- package/build/src/Target.d.ts.map +1 -1
- package/build/src/Target.js +4 -1
- package/build/src/Target.js.map +1 -1
- package/build/src/generatedNames.d.ts +23 -0
- package/build/src/generatedNames.d.ts.map +1 -0
- package/build/src/generatedNames.js +3 -0
- package/build/src/generatedNames.js.map +1 -0
- package/build/src/index.d.ts +8 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +43 -17
- package/build/src/index.js.map +1 -1
- package/build/src/modules/extension/index.d.ts +1 -0
- package/build/src/modules/extension/index.d.ts.map +1 -1
- package/build/src/modules/extension/index.js +9 -5
- package/build/src/modules/extension/index.js.map +1 -1
- package/build/src/modules/extensionBundle/ExtensionUpdates.d.ts +72 -0
- package/build/src/modules/extensionBundle/ExtensionUpdates.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/ExtensionUpdates.js +165 -0
- package/build/src/modules/extensionBundle/ExtensionUpdates.js.map +1 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.d.ts +33 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.js +87 -0
- package/build/src/modules/extensionBundle/ExtensionUpdatesApi.js.map +1 -0
- package/build/src/modules/extensionBundle/constants.d.ts +21 -0
- package/build/src/modules/extensionBundle/constants.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/constants.js +30 -0
- package/build/src/modules/extensionBundle/constants.js.map +1 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.d.ts +42 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.js +114 -0
- package/build/src/modules/extensionBundle/enableExtensionUpdates.js.map +1 -0
- package/build/src/modules/extensionBundle/fsInstall.d.ts +50 -0
- package/build/src/modules/extensionBundle/fsInstall.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/fsInstall.js +180 -0
- package/build/src/modules/extensionBundle/fsInstall.js.map +1 -0
- package/build/src/modules/extensionBundle/nativeInstall.d.ts +12 -0
- package/build/src/modules/extensionBundle/nativeInstall.d.ts.map +1 -0
- package/build/src/modules/extensionBundle/nativeInstall.js +33 -0
- package/build/src/modules/extensionBundle/nativeInstall.js.map +1 -0
- package/build/src/modules/liveActivity/index.d.ts +13 -6
- package/build/src/modules/liveActivity/index.d.ts.map +1 -1
- package/build/src/modules/liveActivity/index.js +2 -2
- package/build/src/modules/liveActivity/index.js.map +1 -1
- package/build/src/modules/notification/index.d.ts +21 -0
- package/build/src/modules/notification/index.d.ts.map +1 -0
- package/build/src/modules/notification/index.js +32 -0
- package/build/src/modules/notification/index.js.map +1 -0
- package/build/src/modules/storage/index.d.ts +2 -0
- package/build/src/modules/storage/index.d.ts.map +1 -1
- package/build/src/modules/storage/index.js +11 -1
- package/build/src/modules/storage/index.js.map +1 -1
- package/cli/build/checks/appGroups.d.ts +3 -0
- package/cli/build/checks/appGroups.d.ts.map +1 -0
- package/cli/build/checks/appGroups.js +56 -0
- package/cli/build/checks/appGroups.js.map +1 -0
- package/cli/build/checks/dualWidgets.d.ts +3 -0
- package/cli/build/checks/dualWidgets.d.ts.map +1 -0
- package/cli/build/checks/dualWidgets.js +31 -0
- package/cli/build/checks/dualWidgets.js.map +1 -0
- package/cli/build/checks/easCredentials.d.ts +5 -0
- package/cli/build/checks/easCredentials.d.ts.map +1 -0
- package/cli/build/checks/easCredentials.js +150 -0
- package/cli/build/checks/easCredentials.js.map +1 -0
- package/cli/build/checks/entries.d.ts +3 -0
- package/cli/build/checks/entries.d.ts.map +1 -0
- package/cli/build/checks/entries.js +52 -0
- package/cli/build/checks/entries.js.map +1 -0
- package/cli/build/checks/heavyExclusions.d.ts +5 -0
- package/cli/build/checks/heavyExclusions.d.ts.map +1 -0
- package/cli/build/checks/heavyExclusions.js +186 -0
- package/cli/build/checks/heavyExclusions.js.map +1 -0
- package/cli/build/checks/metro.d.ts +3 -0
- package/cli/build/checks/metro.d.ts.map +1 -0
- package/cli/build/checks/metro.js +67 -0
- package/cli/build/checks/metro.js.map +1 -0
- package/cli/build/checks/nameSync.d.ts +3 -0
- package/cli/build/checks/nameSync.d.ts.map +1 -0
- package/cli/build/checks/nameSync.js +136 -0
- package/cli/build/checks/nameSync.js.map +1 -0
- package/cli/build/checks/plugin.d.ts +3 -0
- package/cli/build/checks/plugin.d.ts.map +1 -0
- package/cli/build/checks/plugin.js +27 -0
- package/cli/build/checks/plugin.js.map +1 -0
- package/cli/build/checks/sealedZone.d.ts +3 -0
- package/cli/build/checks/sealedZone.d.ts.map +1 -0
- package/cli/build/checks/sealedZone.js +101 -0
- package/cli/build/checks/sealedZone.js.map +1 -0
- package/cli/build/checks/updateScript.d.ts +7 -0
- package/cli/build/checks/updateScript.d.ts.map +1 -0
- package/cli/build/checks/updateScript.js +91 -0
- package/cli/build/checks/updateScript.js.map +1 -0
- package/cli/build/doctor.d.ts +9 -0
- package/cli/build/doctor.d.ts.map +1 -0
- package/cli/build/doctor.js +111 -0
- package/cli/build/doctor.js.map +1 -0
- package/cli/build/exportExtensionBundles.d.ts +21 -0
- package/cli/build/exportExtensionBundles.d.ts.map +1 -0
- package/cli/build/exportExtensionBundles.js +193 -0
- package/cli/build/exportExtensionBundles.js.map +1 -0
- package/cli/build/exportSafari.d.ts +2 -0
- package/cli/build/exportSafari.d.ts.map +1 -0
- package/cli/build/exportSafari.js +42 -0
- package/cli/build/exportSafari.js.map +1 -0
- package/cli/build/extensionBundle/constants.d.ts +21 -0
- package/cli/build/extensionBundle/constants.d.ts.map +1 -0
- package/cli/build/extensionBundle/constants.js +30 -0
- package/cli/build/extensionBundle/constants.js.map +1 -0
- package/cli/build/extensionBundle/fsInstall.d.ts +50 -0
- package/cli/build/extensionBundle/fsInstall.d.ts.map +1 -0
- package/cli/build/extensionBundle/fsInstall.js +180 -0
- package/cli/build/extensionBundle/fsInstall.js.map +1 -0
- package/cli/build/extensionBundle/hermesExport.d.ts +37 -0
- package/cli/build/extensionBundle/hermesExport.d.ts.map +1 -0
- package/cli/build/extensionBundle/hermesExport.js +112 -0
- package/cli/build/extensionBundle/hermesExport.js.map +1 -0
- package/cli/build/generate.d.ts +2 -0
- package/cli/build/generate.d.ts.map +1 -0
- package/cli/build/generate.js +33 -0
- package/cli/build/generate.js.map +1 -0
- package/cli/build/index.d.ts +3 -0
- package/cli/build/index.d.ts.map +1 -0
- package/cli/build/index.js +129 -0
- package/cli/build/index.js.map +1 -0
- package/cli/build/orphans.d.ts +14 -0
- package/cli/build/orphans.d.ts.map +1 -0
- package/cli/build/orphans.js +184 -0
- package/cli/build/orphans.js.map +1 -0
- package/cli/build/project.d.ts +3 -0
- package/cli/build/project.d.ts.map +1 -0
- package/cli/build/project.js +114 -0
- package/cli/build/project.js.map +1 -0
- package/cli/build/scaffold/copyTemplate.d.ts +15 -0
- package/cli/build/scaffold/copyTemplate.d.ts.map +1 -0
- package/cli/build/scaffold/copyTemplate.js +109 -0
- package/cli/build/scaffold/copyTemplate.js.map +1 -0
- package/cli/build/scaffold/expoConfigIO.d.ts +15 -0
- package/cli/build/scaffold/expoConfigIO.d.ts.map +1 -0
- package/cli/build/scaffold/expoConfigIO.js +104 -0
- package/cli/build/scaffold/expoConfigIO.js.map +1 -0
- package/cli/build/scaffold/generateConfig.d.ts +13 -0
- package/cli/build/scaffold/generateConfig.d.ts.map +1 -0
- package/cli/build/scaffold/generateConfig.js +169 -0
- package/cli/build/scaffold/generateConfig.js.map +1 -0
- package/cli/build/scaffold/index.d.ts +3 -0
- package/cli/build/scaffold/index.d.ts.map +1 -0
- package/cli/build/scaffold/index.js +8 -0
- package/cli/build/scaffold/index.js.map +1 -0
- package/cli/build/scaffold/prompts.d.ts +3 -0
- package/cli/build/scaffold/prompts.d.ts.map +1 -0
- package/cli/build/scaffold/prompts.js +92 -0
- package/cli/build/scaffold/prompts.js.map +1 -0
- package/cli/build/scaffold/reactNativeTemplate.d.ts +3 -0
- package/cli/build/scaffold/reactNativeTemplate.d.ts.map +1 -0
- package/cli/build/scaffold/reactNativeTemplate.js +56 -0
- package/cli/build/scaffold/reactNativeTemplate.js.map +1 -0
- package/cli/build/scaffold/resolveAndroidPackage.d.ts +5 -0
- package/cli/build/scaffold/resolveAndroidPackage.d.ts.map +1 -0
- package/cli/build/scaffold/resolveAndroidPackage.js +42 -0
- package/cli/build/scaffold/resolveAndroidPackage.js.map +1 -0
- package/cli/build/scaffold/resolveAppGroup.d.ts +6 -0
- package/cli/build/scaffold/resolveAppGroup.d.ts.map +1 -0
- package/cli/build/scaffold/resolveAppGroup.js +68 -0
- package/cli/build/scaffold/resolveAppGroup.js.map +1 -0
- package/cli/build/scaffold/scaffoldTarget.d.ts +14 -0
- package/cli/build/scaffold/scaffoldTarget.d.ts.map +1 -0
- package/cli/build/scaffold/scaffoldTarget.js +267 -0
- package/cli/build/scaffold/scaffoldTarget.js.map +1 -0
- package/cli/build/scaffold/templates/android.d.ts +33 -0
- package/cli/build/scaffold/templates/android.d.ts.map +1 -0
- package/cli/build/scaffold/templates/android.js +117 -0
- package/cli/build/scaffold/templates/android.js.map +1 -0
- package/cli/build/scaffold/templates/ios.d.ts +20 -0
- package/cli/build/scaffold/templates/ios.d.ts.map +1 -0
- package/cli/build/scaffold/templates/ios.js +505 -0
- package/cli/build/scaffold/templates/ios.js.map +1 -0
- package/cli/build/scaffold/templates/liveActivity.d.ts +11 -0
- package/cli/build/scaffold/templates/liveActivity.d.ts.map +1 -0
- package/cli/build/scaffold/templates/liveActivity.js +71 -0
- package/cli/build/scaffold/templates/liveActivity.js.map +1 -0
- package/cli/build/scaffold/utils.d.ts +3 -0
- package/cli/build/scaffold/utils.d.ts.map +1 -0
- package/cli/build/scaffold/utils.js +15 -0
- package/cli/build/scaffold/utils.js.map +1 -0
- package/cli/build/scaffold/wireExpoConfig.d.ts +12 -0
- package/cli/build/scaffold/wireExpoConfig.d.ts.map +1 -0
- package/cli/build/scaffold/wireExpoConfig.js +49 -0
- package/cli/build/scaffold/wireExpoConfig.js.map +1 -0
- package/cli/build/scaffold/wireHost.d.ts +21 -0
- package/cli/build/scaffold/wireHost.d.ts.map +1 -0
- package/cli/build/scaffold/wireHost.js +89 -0
- package/cli/build/scaffold/wireHost.js.map +1 -0
- package/cli/build/scaffold/wireMetro.d.ts +11 -0
- package/cli/build/scaffold/wireMetro.d.ts.map +1 -0
- package/cli/build/scaffold/wireMetro.js +64 -0
- package/cli/build/scaffold/wireMetro.js.map +1 -0
- package/cli/build/scaffold/wirePackageJson.d.ts +2 -0
- package/cli/build/scaffold/wirePackageJson.d.ts.map +1 -0
- package/cli/build/scaffold/wirePackageJson.js +24 -0
- package/cli/build/scaffold/wirePackageJson.js.map +1 -0
- package/cli/build/sync.d.ts +8 -0
- package/cli/build/sync.d.ts.map +1 -0
- package/cli/build/sync.js +154 -0
- package/cli/build/sync.js.map +1 -0
- package/cli/build/types.d.ts +45 -0
- package/cli/build/types.d.ts.map +1 -0
- package/cli/build/types.js +3 -0
- package/cli/build/types.js.map +1 -0
- package/expo-module.config.json +4 -1
- package/ios/ExpoTargetsExtensionBundleModule.swift +172 -0
- package/ios/ExpoTargetsMessagesModule.swift +4 -3
- package/ios/ExpoTargetsStorage.podspec +1 -0
- package/ios/ExpoTargetsStorageModule.swift +13 -0
- package/metro/build/index.d.ts +1 -1
- package/metro/build/index.d.ts.map +1 -1
- package/metro/build/index.js +5 -4
- package/metro/build/index.js.map +1 -1
- package/metro/build/{withTargetsMetro.d.ts → withTargets.d.ts} +6 -1
- package/metro/build/withTargets.d.ts.map +1 -0
- package/{build/metro/src/withTargetsMetro.js → metro/build/withTargets.js} +50 -14
- package/metro/build/withTargets.js.map +1 -0
- package/package.json +25 -2
- package/plugin/build/android/activationMime.d.ts +12 -0
- package/plugin/build/android/activationMime.d.ts.map +1 -0
- package/plugin/build/android/activationMime.js +47 -0
- package/plugin/build/android/activationMime.js.map +1 -0
- package/plugin/build/android/resolveUserClass.d.ts +14 -0
- package/plugin/build/android/resolveUserClass.d.ts.map +1 -0
- package/plugin/build/android/resolveUserClass.js +48 -0
- package/plugin/build/android/resolveUserClass.js.map +1 -0
- package/plugin/build/android/targetSourceSets.d.ts +9 -0
- package/plugin/build/android/targetSourceSets.d.ts.map +1 -0
- package/plugin/build/android/targetSourceSets.js +90 -0
- package/plugin/build/android/targetSourceSets.js.map +1 -0
- package/plugin/build/android/withAndroidNotification.d.ts +12 -0
- package/plugin/build/android/withAndroidNotification.d.ts.map +1 -0
- package/plugin/build/android/withAndroidNotification.js +192 -0
- package/plugin/build/android/withAndroidNotification.js.map +1 -0
- package/plugin/build/android/withAndroidShareAction.d.ts +11 -0
- package/plugin/build/android/withAndroidShareAction.d.ts.map +1 -0
- package/plugin/build/android/withAndroidShareAction.js +172 -0
- package/plugin/build/android/withAndroidShareAction.js.map +1 -0
- package/plugin/build/android/withAndroidSystemService.d.ts +12 -0
- package/plugin/build/android/withAndroidSystemService.d.ts.map +1 -0
- package/plugin/build/android/withAndroidSystemService.js +332 -0
- package/plugin/build/android/withAndroidSystemService.js.map +1 -0
- package/plugin/build/android/withAndroidTarget.d.ts +2 -1
- package/plugin/build/android/withAndroidTarget.d.ts.map +1 -1
- package/plugin/build/android/withAndroidTarget.js +25 -3
- package/plugin/build/android/withAndroidTarget.js.map +1 -1
- package/plugin/build/android/withAndroidTargetsConfig.d.ts +9 -0
- package/plugin/build/android/withAndroidTargetsConfig.d.ts.map +1 -0
- package/plugin/build/android/withAndroidTargetsConfig.js +52 -0
- package/plugin/build/android/withAndroidTargetsConfig.js.map +1 -0
- package/plugin/build/codegen/collectRuntimeConfigs.d.ts +34 -0
- package/plugin/build/codegen/collectRuntimeConfigs.d.ts.map +1 -0
- package/plugin/build/codegen/collectRuntimeConfigs.js +57 -0
- package/plugin/build/codegen/collectRuntimeConfigs.js.map +1 -0
- package/plugin/build/codegen/index.d.ts +7 -0
- package/plugin/build/codegen/index.d.ts.map +1 -0
- package/plugin/build/codegen/index.js +14 -0
- package/plugin/build/codegen/index.js.map +1 -0
- package/plugin/build/codegen/typedTargets.d.ts +20 -0
- package/plugin/build/codegen/typedTargets.d.ts.map +1 -0
- package/plugin/build/codegen/typedTargets.js +131 -0
- package/plugin/build/codegen/typedTargets.js.map +1 -0
- package/plugin/build/codegen/warnIfSealedHandEdited.d.ts +12 -0
- package/plugin/build/codegen/warnIfSealedHandEdited.d.ts.map +1 -0
- package/plugin/build/codegen/warnIfSealedHandEdited.js +32 -0
- package/plugin/build/codegen/warnIfSealedHandEdited.js.map +1 -0
- package/plugin/build/config.d.ts +37 -6
- package/plugin/build/config.d.ts.map +1 -1
- package/plugin/build/config.js.map +1 -1
- package/plugin/build/domain/characteristics.d.ts +8 -0
- package/plugin/build/domain/characteristics.d.ts.map +1 -1
- package/plugin/build/domain/characteristics.js +81 -10
- package/plugin/build/domain/characteristics.js.map +1 -1
- package/plugin/build/domain/index.d.ts +1 -1
- package/plugin/build/domain/index.d.ts.map +1 -1
- package/plugin/build/domain/index.js.map +1 -1
- package/plugin/build/ensureHostAppGroups.d.ts +16 -0
- package/plugin/build/ensureHostAppGroups.d.ts.map +1 -0
- package/plugin/build/ensureHostAppGroups.js +95 -0
- package/plugin/build/ensureHostAppGroups.js.map +1 -0
- package/plugin/build/ios/apply/fs/applyTargetPlan.d.ts.map +1 -1
- package/plugin/build/ios/apply/fs/applyTargetPlan.js +3 -1
- package/plugin/build/ios/apply/fs/applyTargetPlan.js.map +1 -1
- package/plugin/build/ios/apply/fs/entitlements.d.ts +5 -1
- package/plugin/build/ios/apply/fs/entitlements.d.ts.map +1 -1
- package/plugin/build/ios/apply/fs/entitlements.js +13 -1
- package/plugin/build/ios/apply/fs/entitlements.js.map +1 -1
- package/plugin/build/ios/apply/fs/safari.d.ts +4 -1
- package/plugin/build/ios/apply/fs/safari.d.ts.map +1 -1
- package/plugin/build/ios/apply/fs/safari.js +19 -1
- package/plugin/build/ios/apply/fs/safari.js.map +1 -1
- package/plugin/build/ios/apply/fs/swift.d.ts +4 -1
- package/plugin/build/ios/apply/fs/swift.d.ts.map +1 -1
- package/plugin/build/ios/apply/fs/swift.js +11 -2
- package/plugin/build/ios/apply/fs/swift.js.map +1 -1
- package/plugin/build/ios/apply/pbx/applyTargetPlan.d.ts.map +1 -1
- package/plugin/build/ios/apply/pbx/applyTargetPlan.js +9 -0
- package/plugin/build/ios/apply/pbx/applyTargetPlan.js.map +1 -1
- package/plugin/build/ios/apply/pbx/index.d.ts +1 -0
- package/plugin/build/ios/apply/pbx/index.d.ts.map +1 -1
- package/plugin/build/ios/apply/pbx/index.js +4 -1
- package/plugin/build/ios/apply/pbx/index.js.map +1 -1
- package/plugin/build/ios/apply/pbx/safariWebBundle.d.ts +15 -0
- package/plugin/build/ios/apply/pbx/safariWebBundle.d.ts.map +1 -0
- package/plugin/build/ios/apply/pbx/safariWebBundle.js +99 -0
- package/plugin/build/ios/apply/pbx/safariWebBundle.js.map +1 -0
- package/plugin/build/ios/apply/podfile/podfile.d.ts +0 -2
- package/plugin/build/ios/apply/podfile/podfile.d.ts.map +1 -1
- package/plugin/build/ios/apply/podfile/podfile.js +21 -6
- package/plugin/build/ios/apply/podfile/podfile.js.map +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.d.ts +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.d.ts.map +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.js +1 -1
- package/plugin/build/ios/cng/appShortcutsCodegen.js.map +1 -1
- package/plugin/build/ios/config-plugins/withEntitlements.d.ts.map +1 -1
- package/plugin/build/ios/config-plugins/withEntitlements.js +4 -1
- package/plugin/build/ios/config-plugins/withEntitlements.js.map +1 -1
- package/plugin/build/ios/observe/podsRb.d.ts +2 -1
- package/plugin/build/ios/observe/podsRb.d.ts.map +1 -1
- package/plugin/build/ios/observe/podsRb.js +2 -1
- package/plugin/build/ios/observe/podsRb.js.map +1 -1
- package/plugin/build/ios/plan/buildInfoPlist.js +1 -1
- package/plugin/build/ios/plan/buildInfoPlist.js.map +1 -1
- package/plugin/build/ios/plan/compose.d.ts.map +1 -1
- package/plugin/build/ios/plan/compose.js +3 -0
- package/plugin/build/ios/plan/compose.js.map +1 -1
- package/plugin/build/ios/plan/index.d.ts +2 -1
- package/plugin/build/ios/plan/index.d.ts.map +1 -1
- package/plugin/build/ios/plan/index.js +3 -1
- package/plugin/build/ios/plan/index.js.map +1 -1
- package/plugin/build/ios/plan/safari.d.ts.map +1 -1
- package/plugin/build/ios/plan/safari.js +1 -0
- package/plugin/build/ios/plan/safari.js.map +1 -1
- package/plugin/build/ios/plan/safariWebBundle.d.ts +7 -0
- package/plugin/build/ios/plan/safariWebBundle.d.ts.map +1 -0
- package/plugin/build/ios/plan/safariWebBundle.js +53 -0
- package/plugin/build/ios/plan/safariWebBundle.js.map +1 -0
- package/plugin/build/ios/plan/swiftSources.d.ts.map +1 -1
- package/plugin/build/ios/plan/swiftSources.js +10 -0
- package/plugin/build/ios/plan/swiftSources.js.map +1 -1
- package/plugin/build/ios/plan/types.d.ts +18 -0
- package/plugin/build/ios/plan/types.d.ts.map +1 -1
- package/plugin/build/ios/safari/exportSafariWebBundle.d.ts +20 -0
- package/plugin/build/ios/safari/exportSafariWebBundle.d.ts.map +1 -0
- package/plugin/build/ios/safari/exportSafariWebBundle.js +119 -0
- package/plugin/build/ios/safari/exportSafariWebBundle.js.map +1 -0
- package/plugin/build/ios/safari/exportSafariWebBundleCli.d.ts +2 -0
- package/plugin/build/ios/safari/exportSafariWebBundleCli.d.ts.map +1 -0
- package/plugin/build/ios/safari/exportSafariWebBundleCli.js +75 -0
- package/plugin/build/ios/safari/exportSafariWebBundleCli.js.map +1 -0
- package/plugin/build/ios/templates/ReactNativeViewController.swift +102 -25
- package/plugin/build/ios/utils/paths.d.ts +2 -0
- package/plugin/build/ios/utils/paths.d.ts.map +1 -1
- package/plugin/build/ios/utils/paths.js +6 -1
- package/plugin/build/ios/utils/paths.js.map +1 -1
- package/plugin/build/ios/utils/reactNativeSwift.d.ts +3 -0
- package/plugin/build/ios/utils/reactNativeSwift.d.ts.map +1 -1
- package/plugin/build/ios/utils/reactNativeSwift.js +3 -0
- package/plugin/build/ios/utils/reactNativeSwift.js.map +1 -1
- package/plugin/build/ios/utils/safari.d.ts +11 -4
- package/plugin/build/ios/utils/safari.d.ts.map +1 -1
- package/plugin/build/ios/utils/safari.js +57 -21
- package/plugin/build/ios/utils/safari.js.map +1 -1
- package/plugin/build/resolveExcludedPackages.d.ts +15 -0
- package/plugin/build/resolveExcludedPackages.d.ts.map +1 -0
- package/plugin/build/resolveExcludedPackages.js +30 -0
- package/plugin/build/resolveExcludedPackages.js.map +1 -0
- package/plugin/build/withTargetsDir.d.ts +5 -0
- package/plugin/build/withTargetsDir.d.ts.map +1 -1
- package/plugin/build/withTargetsDir.js +120 -37
- package/plugin/build/withTargetsDir.js.map +1 -1
- package/build/metro/src/withTargetsMetro.d.ts.map +0 -1
- package/build/metro/src/withTargetsMetro.js.map +0 -1
- package/metro/build/withTargetsMetro.d.ts.map +0 -1
- package/metro/build/withTargetsMetro.js.map +0 -1
package/README.md
CHANGED
|
@@ -12,25 +12,23 @@ Expo config plugin and runtime for Apple app extensions Expo does not ship — s
|
|
|
12
12
|
>
|
|
13
13
|
> **Widgets:** Native WidgetKit + Live Activities are first-class. See [widgets](https://github.com/csark0812/expo-targets/blob/main/docs/widgets.md). Android widgets are bridge-grade.
|
|
14
14
|
>
|
|
15
|
-
> **Bare RN:** `expo-targets sync`
|
|
15
|
+
> **Bare RN:** use `npx expo-targets sync` against an existing `ios/` tree, then `pod install`. Prefer managed Expo + `npx expo prebuild` for new projects.
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install expo-targets
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npx create-expo-target
|
|
21
|
+
npx expo-targets add
|
|
26
22
|
# Share Extension → my-share → Use React Native: Yes
|
|
27
23
|
```
|
|
28
24
|
|
|
25
|
+
`expo-targets add` wires the host by default. Install dependencies if wiring added `expo-targets` to `package.json`.
|
|
26
|
+
|
|
29
27
|
```js
|
|
30
28
|
// metro.config.js
|
|
31
29
|
const { getDefaultConfig } = require("expo/metro-config");
|
|
32
|
-
const {
|
|
33
|
-
module.exports =
|
|
30
|
+
const { withTargets } = require("expo-targets/metro");
|
|
31
|
+
module.exports = withTargets(getDefaultConfig(__dirname));
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
```typescript
|
|
@@ -38,7 +36,7 @@ module.exports = withTargetsMetro(getDefaultConfig(__dirname));
|
|
|
38
36
|
import { createTarget } from "expo-targets";
|
|
39
37
|
import ShareExtension from "./ShareExtension";
|
|
40
38
|
|
|
41
|
-
export const myShare = createTarget
|
|
39
|
+
export const myShare = createTarget("MyShare", ShareExtension);
|
|
42
40
|
```
|
|
43
41
|
|
|
44
42
|
## Storage
|
|
@@ -54,7 +52,8 @@ target.refresh();
|
|
|
54
52
|
|
|
55
53
|
- [Getting started](https://github.com/csark0812/expo-targets/blob/main/docs/getting-started.md)
|
|
56
54
|
- [Configuration](https://github.com/csark0812/expo-targets/blob/main/docs/configuration.md)
|
|
57
|
-
- [API](https://github.com/csark0812/expo-targets/blob/main/docs/api.md)
|
|
55
|
+
- [API](https://github.com/csark0812/expo-targets/blob/main/docs/api.md) (includes [`ExtensionUpdates`](https://github.com/csark0812/expo-targets/blob/main/docs/api.md#extensionupdates))
|
|
56
|
+
- [React Native extensions](https://github.com/csark0812/expo-targets/blob/main/docs/react-native-extensions.md) — [App Group OTA / eas update](https://github.com/csark0812/expo-targets/blob/main/docs/react-native-extensions.md#extension-bundle-sideload-with-expo-updates)
|
|
58
57
|
- [Widgets](https://github.com/csark0812/expo-targets/blob/main/docs/widgets.md)
|
|
59
58
|
- [Contributing](https://github.com/csark0812/expo-targets/blob/main/CONTRIBUTING.md)
|
|
60
59
|
|
package/android/build.gradle
CHANGED
|
@@ -18,5 +18,9 @@ dependencies {
|
|
|
18
18
|
// Glance dependencies for widget sync utilities
|
|
19
19
|
implementation "androidx.glance:glance-appwidget:1.1.1"
|
|
20
20
|
implementation "androidx.datastore:datastore-preferences:1.1.1"
|
|
21
|
+
// Wave 2 notification / LiveActivity ongoing-notif helper
|
|
22
|
+
implementation "androidx.core:core-ktx:1.15.0"
|
|
23
|
+
// RN Share/Action host (ReactActivity) — resolved from the app's RN classpath
|
|
24
|
+
compileOnly 'com.facebook.react:react-android'
|
|
21
25
|
}
|
|
22
26
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<!-- Live Activity dual (ongoing NotificationCompat) + NSE/NCE routing on API 33+. -->
|
|
3
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
4
|
+
<application>
|
|
5
|
+
<!-- Wave 0 harness: synthetic Intent surface for extension JS APIs (not a product ShareActivity). -->
|
|
6
|
+
<activity
|
|
7
|
+
android:name="expo.modules.targets.extension.ExpoTargetsHarnessActivity"
|
|
8
|
+
android:exported="false"
|
|
9
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
|
10
|
+
</application>
|
|
11
|
+
</manifest>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
package expo.modules.targets.extension
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import java.lang.ref.WeakReference
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Holds the current target Activity (harness, share, or action) so
|
|
9
|
+
* [ExpoTargetsExtensionModule] can finish it and read Intent extras.
|
|
10
|
+
*/
|
|
11
|
+
object ExpoTargetsActivityHolder {
|
|
12
|
+
@Volatile
|
|
13
|
+
private var activityRef: WeakReference<Activity>? = null
|
|
14
|
+
|
|
15
|
+
@Volatile
|
|
16
|
+
var lastIntent: Intent? = null
|
|
17
|
+
private set
|
|
18
|
+
|
|
19
|
+
fun attach(activity: Activity) {
|
|
20
|
+
activityRef = WeakReference(activity)
|
|
21
|
+
lastIntent = activity.intent
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
fun detach(activity: Activity) {
|
|
25
|
+
if (activityRef?.get() === activity) {
|
|
26
|
+
activityRef = null
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fun currentActivity(): Activity? = activityRef?.get()
|
|
31
|
+
|
|
32
|
+
fun updateIntent(intent: Intent?) {
|
|
33
|
+
if (intent != null) {
|
|
34
|
+
lastIntent = intent
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,27 +1,78 @@
|
|
|
1
1
|
package expo.modules.targets.extension
|
|
2
2
|
|
|
3
|
+
import android.content.Intent
|
|
4
|
+
import android.net.Uri
|
|
3
5
|
import expo.modules.kotlin.modules.Module
|
|
4
6
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
7
|
+
import expo.modules.targets.ExpoTargetsLogger
|
|
5
8
|
|
|
6
9
|
class ExpoTargetsExtensionModule : Module() {
|
|
10
|
+
companion object {
|
|
11
|
+
private const val TAG = "Extension"
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
override fun definition() = ModuleDefinition {
|
|
8
15
|
Name("ExpoTargetsExtension")
|
|
9
16
|
|
|
10
17
|
Function("closeExtension") {
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
val activity = ExpoTargetsActivityHolder.currentActivity()
|
|
19
|
+
if (activity != null) {
|
|
20
|
+
activity.runOnUiThread { activity.finish() }
|
|
21
|
+
} else {
|
|
22
|
+
ExpoTargetsLogger.w(TAG, "closeExtension: no current target Activity")
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
25
|
|
|
15
26
|
Function("openHostApp") { path: String ->
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
val activity = ExpoTargetsActivityHolder.currentActivity()
|
|
28
|
+
val context =
|
|
29
|
+
appContext.reactContext
|
|
30
|
+
?: activity
|
|
31
|
+
if (context == null) {
|
|
32
|
+
ExpoTargetsLogger.w(TAG, "openHostApp: no context")
|
|
33
|
+
} else {
|
|
34
|
+
val packageName = context.packageName
|
|
35
|
+
val launch =
|
|
36
|
+
context.packageManager.getLaunchIntentForPackage(packageName)
|
|
37
|
+
?: Intent(Intent.ACTION_MAIN).apply {
|
|
38
|
+
addCategory(Intent.CATEGORY_LAUNCHER)
|
|
39
|
+
setPackage(packageName)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
|
43
|
+
|
|
44
|
+
val trimmed = path.trim()
|
|
45
|
+
if (trimmed.isNotEmpty()) {
|
|
46
|
+
val deepLink =
|
|
47
|
+
when {
|
|
48
|
+
trimmed.contains("://") -> Uri.parse(trimmed)
|
|
49
|
+
trimmed.startsWith("/") ->
|
|
50
|
+
Uri.Builder()
|
|
51
|
+
.scheme("expotargets")
|
|
52
|
+
.authority(packageName)
|
|
53
|
+
.path(trimmed.removePrefix("/"))
|
|
54
|
+
.build()
|
|
55
|
+
else -> Uri.parse("expotargets://$packageName/$trimmed")
|
|
56
|
+
}
|
|
57
|
+
launch.data = deepLink
|
|
58
|
+
launch.putExtra("expo_targets_path", trimmed)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
context.startActivity(launch)
|
|
62
|
+
// Match native Activity.openHost: dismiss the Share/Action surface.
|
|
63
|
+
activity?.runOnUiThread { activity.finish() }
|
|
64
|
+
}
|
|
18
65
|
}
|
|
19
66
|
|
|
20
67
|
Function("getSharedData") {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
68
|
+
val intent =
|
|
69
|
+
ExpoTargetsActivityHolder.currentActivity()?.intent
|
|
70
|
+
?: ExpoTargetsActivityHolder.lastIntent
|
|
71
|
+
if (intent == null) {
|
|
72
|
+
ExpoTargetsLogger.d(TAG, "getSharedData: no intent")
|
|
73
|
+
return@Function null
|
|
74
|
+
}
|
|
75
|
+
return@Function ExpoTargetsSharedIntent.extract(intent)
|
|
24
76
|
}
|
|
25
77
|
}
|
|
26
78
|
}
|
|
27
|
-
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package expo.modules.targets.extension
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Throwaway Activity for Wave 0 DoD of getSharedData / openHostApp / close.
|
|
9
|
+
* Launch with ACTION_SEND (or custom extras) for synthetic share payloads.
|
|
10
|
+
* Product share/action Activities replace this path in Wave 1.
|
|
11
|
+
*/
|
|
12
|
+
class ExpoTargetsHarnessActivity : Activity() {
|
|
13
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
14
|
+
super.onCreate(savedInstanceState)
|
|
15
|
+
ExpoTargetsActivityHolder.attach(this)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
override fun onNewIntent(intent: Intent) {
|
|
19
|
+
super.onNewIntent(intent)
|
|
20
|
+
setIntent(intent)
|
|
21
|
+
ExpoTargetsActivityHolder.updateIntent(intent)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
override fun onDestroy() {
|
|
25
|
+
ExpoTargetsActivityHolder.detach(this)
|
|
26
|
+
super.onDestroy()
|
|
27
|
+
}
|
|
28
|
+
}
|
package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsReactTargetActivity.kt
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
package expo.modules.targets.extension
|
|
2
|
+
|
|
3
|
+
import android.content.ComponentName
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.content.pm.PackageManager
|
|
6
|
+
import android.os.Bundle
|
|
7
|
+
import com.facebook.react.ReactActivity
|
|
8
|
+
import com.facebook.react.ReactActivityDelegate
|
|
9
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
10
|
+
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
11
|
+
import expo.modules.targets.ExpoTargetsLogger
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* React Native host for Share/Action when the target has an `entry` (USE_RN=true).
|
|
15
|
+
* Mirrors iOS ReactNativeViewController: AppRegistry module = config `name`,
|
|
16
|
+
* Intent extras → launch options (text/url/images), same process as the host app.
|
|
17
|
+
*
|
|
18
|
+
* Requires the host JS bundle to register the component (e.g. host imports
|
|
19
|
+
* `createTarget('Share', …)` so AppRegistry has module "Share").
|
|
20
|
+
*
|
|
21
|
+
* Note: [ReactActivity] calls [createReactActivityDelegate] from its constructor,
|
|
22
|
+
* before subclass fields / [onCreate] run — so MODULE_NAME is resolved from the
|
|
23
|
+
* Activity's manifest meta-data via [ActivityThread.currentApplication].
|
|
24
|
+
*/
|
|
25
|
+
abstract class ExpoTargetsReactTargetActivity : ReactActivity() {
|
|
26
|
+
protected var targetName: String = "Target"
|
|
27
|
+
protected var moduleName: String = "Target"
|
|
28
|
+
protected var appGroup: String = ""
|
|
29
|
+
|
|
30
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
31
|
+
readMeta()
|
|
32
|
+
ExpoTargetsActivityHolder.attach(this)
|
|
33
|
+
// Dialog theme; no splash — share sheet budget.
|
|
34
|
+
super.onCreate(null)
|
|
35
|
+
// Give the RN ShareExtension room (default Dialog is too narrow/short).
|
|
36
|
+
window?.setLayout(
|
|
37
|
+
(resources.displayMetrics.widthPixels * 0.92f).toInt(),
|
|
38
|
+
(resources.displayMetrics.heightPixels * 0.75f).toInt(),
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override fun onNewIntent(intent: Intent) {
|
|
43
|
+
super.onNewIntent(intent)
|
|
44
|
+
setIntent(intent)
|
|
45
|
+
ExpoTargetsActivityHolder.updateIntent(intent)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
override fun onDestroy() {
|
|
49
|
+
ExpoTargetsActivityHolder.detach(this)
|
|
50
|
+
super.onDestroy()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun getMainComponentName(): String = resolveModuleName(javaClass)
|
|
54
|
+
|
|
55
|
+
override fun createReactActivityDelegate(): ReactActivityDelegate {
|
|
56
|
+
val self = this
|
|
57
|
+
val name = resolveModuleName(javaClass)
|
|
58
|
+
return object : DefaultReactActivityDelegate(self, name, fabricEnabled) {
|
|
59
|
+
override fun getLaunchOptions(): Bundle? =
|
|
60
|
+
ExpoTargetsSharedIntent.toLaunchOptions(self.intent)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private fun readMeta() {
|
|
65
|
+
try {
|
|
66
|
+
val info =
|
|
67
|
+
packageManager.getActivityInfo(
|
|
68
|
+
componentName,
|
|
69
|
+
PackageManager.GET_META_DATA,
|
|
70
|
+
)
|
|
71
|
+
val meta = info.metaData
|
|
72
|
+
targetName = meta?.getString("expo.targets.TARGET_NAME") ?: targetName
|
|
73
|
+
moduleName = meta?.getString("expo.targets.MODULE_NAME") ?: targetName
|
|
74
|
+
appGroup =
|
|
75
|
+
meta?.getString("expo.targets.APP_GROUP")
|
|
76
|
+
?: "group.$packageName"
|
|
77
|
+
ExpoTargetsLogger.d(
|
|
78
|
+
"ReactTarget",
|
|
79
|
+
"RN Share/Action host: module=$moduleName target=$targetName",
|
|
80
|
+
)
|
|
81
|
+
} catch (e: Exception) {
|
|
82
|
+
ExpoTargetsLogger.w("ReactTarget", "readMeta failed: ${e.message}")
|
|
83
|
+
appGroup = "group.$packageName"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
companion object {
|
|
88
|
+
/**
|
|
89
|
+
* Safe during [ReactActivity] construction (subclass fields not initialized yet).
|
|
90
|
+
*/
|
|
91
|
+
fun resolveModuleName(activityClass: Class<*>): String {
|
|
92
|
+
return try {
|
|
93
|
+
val activityThreadClass = Class.forName("android.app.ActivityThread")
|
|
94
|
+
val app =
|
|
95
|
+
activityThreadClass
|
|
96
|
+
.getMethod("currentApplication")
|
|
97
|
+
.invoke(null) as? android.app.Application
|
|
98
|
+
?: return "Target"
|
|
99
|
+
val component = ComponentName(app, activityClass)
|
|
100
|
+
val info =
|
|
101
|
+
app.packageManager.getActivityInfo(
|
|
102
|
+
component,
|
|
103
|
+
PackageManager.GET_META_DATA,
|
|
104
|
+
)
|
|
105
|
+
info.metaData?.getString("expo.targets.MODULE_NAME")
|
|
106
|
+
?: info.metaData?.getString("expo.targets.TARGET_NAME")
|
|
107
|
+
?: "Target"
|
|
108
|
+
} catch (e: Exception) {
|
|
109
|
+
ExpoTargetsLogger.w(
|
|
110
|
+
"ReactTarget",
|
|
111
|
+
"resolveModuleName failed: ${e.message}",
|
|
112
|
+
)
|
|
113
|
+
"Target"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** RN Share Activity — used when config has `entry`. */
|
|
120
|
+
open class ExpoTargetsReactShareActivity : ExpoTargetsReactTargetActivity()
|
|
121
|
+
|
|
122
|
+
/** RN Action Activity — used when config has `entry`. */
|
|
123
|
+
open class ExpoTargetsReactActionActivity : ExpoTargetsReactTargetActivity()
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
package expo.modules.targets.extension
|
|
2
|
+
|
|
3
|
+
import android.content.Intent
|
|
4
|
+
import android.net.Uri
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shared Intent → props map for Share/Action Activities and [ExpoTargetsExtensionModule].
|
|
9
|
+
* Keys match iOS initialProperties / ShareExtension props: text, url, images.
|
|
10
|
+
*/
|
|
11
|
+
object ExpoTargetsSharedIntent {
|
|
12
|
+
fun extract(intent: Intent?): Map<String, Any?>? {
|
|
13
|
+
if (intent == null) return null
|
|
14
|
+
val result = linkedMapOf<String, Any?>()
|
|
15
|
+
val type = intent.type
|
|
16
|
+
|
|
17
|
+
when (intent.action) {
|
|
18
|
+
Intent.ACTION_SEND -> {
|
|
19
|
+
intent.getStringExtra(Intent.EXTRA_TEXT)?.let { result["text"] = it }
|
|
20
|
+
intent.getStringExtra(Intent.EXTRA_SUBJECT)?.let { subject ->
|
|
21
|
+
if (!result.containsKey("text")) result["text"] = subject
|
|
22
|
+
}
|
|
23
|
+
@Suppress("DEPRECATION")
|
|
24
|
+
(intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM))?.let { uri ->
|
|
25
|
+
if (type?.startsWith("image/") == true) {
|
|
26
|
+
result["images"] = listOf(uri.toString())
|
|
27
|
+
} else {
|
|
28
|
+
result["url"] = uri.toString()
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
intent.dataString?.let { data ->
|
|
32
|
+
if (!result.containsKey("url") && data.startsWith("http")) {
|
|
33
|
+
result["url"] = data
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
Intent.ACTION_SEND_MULTIPLE -> {
|
|
38
|
+
intent.getStringExtra(Intent.EXTRA_TEXT)?.let { result["text"] = it }
|
|
39
|
+
@Suppress("DEPRECATION")
|
|
40
|
+
val streams = intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM)
|
|
41
|
+
if (streams != null && streams.isNotEmpty()) {
|
|
42
|
+
if (type?.startsWith("image/") == true) {
|
|
43
|
+
result["images"] = streams.map { it.toString() }
|
|
44
|
+
} else {
|
|
45
|
+
result["url"] = streams.first().toString()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
Intent.ACTION_PROCESS_TEXT -> {
|
|
50
|
+
intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT)?.let { result["text"] = it }
|
|
51
|
+
}
|
|
52
|
+
else -> {
|
|
53
|
+
intent.getStringExtra("expo_targets_text")?.let { result["text"] = it }
|
|
54
|
+
intent.getStringExtra("expo_targets_url")?.let { result["url"] = it }
|
|
55
|
+
intent.getStringExtra(Intent.EXTRA_TEXT)?.let { result["text"] = it }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
val clip = intent.clipData
|
|
60
|
+
if (clip != null && !result.containsKey("images") && !result.containsKey("url")) {
|
|
61
|
+
val images = mutableListOf<String>()
|
|
62
|
+
for (i in 0 until clip.itemCount) {
|
|
63
|
+
val item = clip.getItemAt(i)
|
|
64
|
+
item.uri?.let { images.add(it.toString()) }
|
|
65
|
+
item.text?.toString()?.let { text ->
|
|
66
|
+
if (!result.containsKey("text")) result["text"] = text
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (images.isNotEmpty()) {
|
|
70
|
+
result["images"] = images
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return if (result.isEmpty()) null else result
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Bundle for ReactActivityDelegate.getLaunchOptions (RN initial props). */
|
|
78
|
+
fun toLaunchOptions(intent: Intent?): Bundle? {
|
|
79
|
+
val data = extract(intent) ?: return null
|
|
80
|
+
val bundle = Bundle()
|
|
81
|
+
(data["text"] as? String)?.let { bundle.putString("text", it) }
|
|
82
|
+
(data["url"] as? String)?.let { bundle.putString("url", it) }
|
|
83
|
+
@Suppress("UNCHECKED_CAST")
|
|
84
|
+
(data["images"] as? List<String>)?.let { imgs ->
|
|
85
|
+
bundle.putStringArrayList("images", ArrayList(imgs))
|
|
86
|
+
}
|
|
87
|
+
return if (bundle.isEmpty) null else bundle
|
|
88
|
+
}
|
|
89
|
+
}
|