expo-targets 0.3.0 → 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.
Files changed (355) hide show
  1. package/README.md +5 -4
  2. package/android/build.gradle +4 -0
  3. package/android/src/main/AndroidManifest.xml +11 -0
  4. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsActivityHolder.kt +37 -0
  5. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsExtensionModule.kt +59 -8
  6. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsHarnessActivity.kt +28 -0
  7. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsReactTargetActivity.kt +123 -0
  8. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsSharedIntent.kt +89 -0
  9. package/android/src/main/java/expo/modules/targets/extension/ExpoTargetsTargetActivity.kt +363 -0
  10. package/android/src/main/java/expo/modules/targets/liveActivity/ExpoTargetsLiveActivityModule.kt +153 -0
  11. package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationModule.kt +134 -0
  12. package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationRouter.kt +192 -0
  13. package/android/src/main/java/expo/modules/targets/notification/ExpoTargetsNotificationService.kt +92 -0
  14. package/android/src/main/java/expo/modules/targets/storage/ExpoTargetsStorageModule.kt +127 -42
  15. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsAutofillService.kt +28 -0
  16. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsCallScreeningService.kt +47 -0
  17. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsDocumentsProvider.kt +148 -0
  18. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsFileProviderUiActivity.kt +47 -0
  19. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsInputMethodService.kt +41 -0
  20. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsPrintService.kt +34 -0
  21. package/android/src/main/java/expo/modules/targets/system/ExpoTargetsVpnService.kt +32 -0
  22. package/android/src/main/res/layout/expo_targets_notification_content.xml +29 -0
  23. package/android/src/main/res/xml/expo_targets_autofill_service.xml +3 -0
  24. package/android/src/main/res/xml/expo_targets_method.xml +9 -0
  25. package/android/src/main/res/xml/expo_targets_print_service.xml +4 -0
  26. package/build/metro/src/withTargets.d.ts.map +1 -1
  27. package/build/metro/src/withTargets.js +37 -11
  28. package/build/metro/src/withTargets.js.map +1 -1
  29. package/build/plugin/src/android/activationMime.d.ts +12 -0
  30. package/build/plugin/src/android/activationMime.d.ts.map +1 -0
  31. package/build/plugin/src/android/activationMime.js +47 -0
  32. package/build/plugin/src/android/activationMime.js.map +1 -0
  33. package/build/plugin/src/android/resolveUserClass.d.ts +14 -0
  34. package/build/plugin/src/android/resolveUserClass.d.ts.map +1 -0
  35. package/build/plugin/src/android/resolveUserClass.js +48 -0
  36. package/build/plugin/src/android/resolveUserClass.js.map +1 -0
  37. package/build/plugin/src/android/targetSourceSets.d.ts +9 -0
  38. package/build/plugin/src/android/targetSourceSets.d.ts.map +1 -0
  39. package/build/plugin/src/android/targetSourceSets.js +90 -0
  40. package/build/plugin/src/android/targetSourceSets.js.map +1 -0
  41. package/build/plugin/src/android/withAndroidNotification.d.ts +12 -0
  42. package/build/plugin/src/android/withAndroidNotification.d.ts.map +1 -0
  43. package/build/plugin/src/android/withAndroidNotification.js +192 -0
  44. package/build/plugin/src/android/withAndroidNotification.js.map +1 -0
  45. package/build/plugin/src/android/withAndroidShareAction.d.ts +11 -0
  46. package/build/plugin/src/android/withAndroidShareAction.d.ts.map +1 -0
  47. package/build/plugin/src/android/withAndroidShareAction.js +172 -0
  48. package/build/plugin/src/android/withAndroidShareAction.js.map +1 -0
  49. package/build/plugin/src/android/withAndroidSystemService.d.ts +12 -0
  50. package/build/plugin/src/android/withAndroidSystemService.d.ts.map +1 -0
  51. package/build/plugin/src/android/withAndroidSystemService.js +332 -0
  52. package/build/plugin/src/android/withAndroidSystemService.js.map +1 -0
  53. package/build/plugin/src/android/withAndroidTarget.d.ts +2 -1
  54. package/build/plugin/src/android/withAndroidTarget.d.ts.map +1 -1
  55. package/build/plugin/src/android/withAndroidTarget.js +25 -3
  56. package/build/plugin/src/android/withAndroidTarget.js.map +1 -1
  57. package/build/plugin/src/android/withAndroidTargetsConfig.d.ts +9 -0
  58. package/build/plugin/src/android/withAndroidTargetsConfig.d.ts.map +1 -0
  59. package/build/plugin/src/android/withAndroidTargetsConfig.js +52 -0
  60. package/build/plugin/src/android/withAndroidTargetsConfig.js.map +1 -0
  61. package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts +3 -0
  62. package/build/plugin/src/codegen/collectRuntimeConfigs.d.ts.map +1 -1
  63. package/build/plugin/src/codegen/collectRuntimeConfigs.js.map +1 -1
  64. package/build/plugin/src/codegen/index.d.ts +1 -1
  65. package/build/plugin/src/codegen/index.d.ts.map +1 -1
  66. package/build/plugin/src/codegen/index.js +2 -1
  67. package/build/plugin/src/codegen/index.js.map +1 -1
  68. package/build/plugin/src/codegen/typedTargets.d.ts +11 -1
  69. package/build/plugin/src/codegen/typedTargets.d.ts.map +1 -1
  70. package/build/plugin/src/codegen/typedTargets.js +102 -12
  71. package/build/plugin/src/codegen/typedTargets.js.map +1 -1
  72. package/build/plugin/src/config.d.ts +37 -6
  73. package/build/plugin/src/config.d.ts.map +1 -1
  74. package/build/plugin/src/config.js.map +1 -1
  75. package/build/plugin/src/domain/characteristics.d.ts +8 -0
  76. package/build/plugin/src/domain/characteristics.d.ts.map +1 -1
  77. package/build/plugin/src/domain/characteristics.js +81 -10
  78. package/build/plugin/src/domain/characteristics.js.map +1 -1
  79. package/build/plugin/src/domain/index.d.ts +1 -1
  80. package/build/plugin/src/domain/index.d.ts.map +1 -1
  81. package/build/plugin/src/domain/index.js.map +1 -1
  82. package/build/plugin/src/ios/apply/podfile/podfile.d.ts.map +1 -1
  83. package/build/plugin/src/ios/apply/podfile/podfile.js +21 -4
  84. package/build/plugin/src/ios/apply/podfile/podfile.js.map +1 -1
  85. package/build/plugin/src/ios/cng/appShortcutsCodegen.d.ts +1 -1
  86. package/build/plugin/src/ios/cng/appShortcutsCodegen.d.ts.map +1 -1
  87. package/build/plugin/src/ios/cng/appShortcutsCodegen.js +1 -1
  88. package/build/plugin/src/ios/cng/appShortcutsCodegen.js.map +1 -1
  89. package/build/plugin/src/ios/plan/swiftSources.d.ts.map +1 -1
  90. package/build/plugin/src/ios/plan/swiftSources.js +10 -0
  91. package/build/plugin/src/ios/plan/swiftSources.js.map +1 -1
  92. package/build/plugin/src/ios/plan/types.d.ts +6 -0
  93. package/build/plugin/src/ios/plan/types.d.ts.map +1 -1
  94. package/build/plugin/src/ios/utils/reactNativeSwift.d.ts +3 -0
  95. package/build/plugin/src/ios/utils/reactNativeSwift.d.ts.map +1 -1
  96. package/build/plugin/src/ios/utils/reactNativeSwift.js +3 -0
  97. package/build/plugin/src/ios/utils/reactNativeSwift.js.map +1 -1
  98. package/build/plugin/src/resolveExcludedPackages.d.ts +15 -0
  99. package/build/plugin/src/resolveExcludedPackages.d.ts.map +1 -0
  100. package/build/plugin/src/resolveExcludedPackages.js +30 -0
  101. package/build/plugin/src/resolveExcludedPackages.js.map +1 -0
  102. package/build/plugin/src/withTargetsDir.d.ts +5 -0
  103. package/build/plugin/src/withTargetsDir.d.ts.map +1 -1
  104. package/build/plugin/src/withTargetsDir.js +114 -47
  105. package/build/plugin/src/withTargetsDir.js.map +1 -1
  106. package/build/src/Target.d.ts +11 -6
  107. package/build/src/Target.d.ts.map +1 -1
  108. package/build/src/Target.js +4 -1
  109. package/build/src/Target.js.map +1 -1
  110. package/build/src/generatedNames.d.ts +23 -0
  111. package/build/src/generatedNames.d.ts.map +1 -0
  112. package/build/src/generatedNames.js +3 -0
  113. package/build/src/generatedNames.js.map +1 -0
  114. package/build/src/index.d.ts +8 -0
  115. package/build/src/index.d.ts.map +1 -1
  116. package/build/src/index.js +43 -17
  117. package/build/src/index.js.map +1 -1
  118. package/build/src/modules/extension/index.d.ts +1 -0
  119. package/build/src/modules/extension/index.d.ts.map +1 -1
  120. package/build/src/modules/extension/index.js +9 -5
  121. package/build/src/modules/extension/index.js.map +1 -1
  122. package/build/src/modules/extensionBundle/ExtensionUpdates.d.ts +72 -0
  123. package/build/src/modules/extensionBundle/ExtensionUpdates.d.ts.map +1 -0
  124. package/build/src/modules/extensionBundle/ExtensionUpdates.js +165 -0
  125. package/build/src/modules/extensionBundle/ExtensionUpdates.js.map +1 -0
  126. package/build/src/modules/extensionBundle/ExtensionUpdatesApi.d.ts +33 -0
  127. package/build/src/modules/extensionBundle/ExtensionUpdatesApi.d.ts.map +1 -0
  128. package/build/src/modules/extensionBundle/ExtensionUpdatesApi.js +87 -0
  129. package/build/src/modules/extensionBundle/ExtensionUpdatesApi.js.map +1 -0
  130. package/build/src/modules/extensionBundle/constants.d.ts +21 -0
  131. package/build/src/modules/extensionBundle/constants.d.ts.map +1 -0
  132. package/build/src/modules/extensionBundle/constants.js +30 -0
  133. package/build/src/modules/extensionBundle/constants.js.map +1 -0
  134. package/build/src/modules/extensionBundle/enableExtensionUpdates.d.ts +42 -0
  135. package/build/src/modules/extensionBundle/enableExtensionUpdates.d.ts.map +1 -0
  136. package/build/src/modules/extensionBundle/enableExtensionUpdates.js +114 -0
  137. package/build/src/modules/extensionBundle/enableExtensionUpdates.js.map +1 -0
  138. package/build/src/modules/extensionBundle/fsInstall.d.ts +50 -0
  139. package/build/src/modules/extensionBundle/fsInstall.d.ts.map +1 -0
  140. package/build/src/modules/extensionBundle/fsInstall.js +180 -0
  141. package/build/src/modules/extensionBundle/fsInstall.js.map +1 -0
  142. package/build/src/modules/extensionBundle/nativeInstall.d.ts +12 -0
  143. package/build/src/modules/extensionBundle/nativeInstall.d.ts.map +1 -0
  144. package/build/src/modules/extensionBundle/nativeInstall.js +33 -0
  145. package/build/src/modules/extensionBundle/nativeInstall.js.map +1 -0
  146. package/build/src/modules/liveActivity/index.d.ts +13 -6
  147. package/build/src/modules/liveActivity/index.d.ts.map +1 -1
  148. package/build/src/modules/liveActivity/index.js +2 -2
  149. package/build/src/modules/liveActivity/index.js.map +1 -1
  150. package/build/src/modules/notification/index.d.ts +21 -0
  151. package/build/src/modules/notification/index.d.ts.map +1 -0
  152. package/build/src/modules/notification/index.js +32 -0
  153. package/build/src/modules/notification/index.js.map +1 -0
  154. package/build/src/modules/storage/index.d.ts +2 -0
  155. package/build/src/modules/storage/index.d.ts.map +1 -1
  156. package/build/src/modules/storage/index.js +11 -1
  157. package/build/src/modules/storage/index.js.map +1 -1
  158. package/cli/build/checks/easCredentials.d.ts +5 -0
  159. package/cli/build/checks/easCredentials.d.ts.map +1 -0
  160. package/cli/build/checks/easCredentials.js +150 -0
  161. package/cli/build/checks/easCredentials.js.map +1 -0
  162. package/cli/build/checks/heavyExclusions.d.ts +5 -0
  163. package/cli/build/checks/heavyExclusions.d.ts.map +1 -0
  164. package/cli/build/checks/heavyExclusions.js +186 -0
  165. package/cli/build/checks/heavyExclusions.js.map +1 -0
  166. package/cli/build/checks/nameSync.d.ts.map +1 -1
  167. package/cli/build/checks/nameSync.js +31 -2
  168. package/cli/build/checks/nameSync.js.map +1 -1
  169. package/cli/build/checks/plugin.js +1 -1
  170. package/cli/build/checks/plugin.js.map +1 -1
  171. package/cli/build/checks/updateScript.d.ts +7 -0
  172. package/cli/build/checks/updateScript.d.ts.map +1 -0
  173. package/cli/build/checks/updateScript.js +91 -0
  174. package/cli/build/checks/updateScript.js.map +1 -0
  175. package/cli/build/doctor.d.ts.map +1 -1
  176. package/cli/build/doctor.js +11 -1
  177. package/cli/build/doctor.js.map +1 -1
  178. package/cli/build/exportExtensionBundles.d.ts +21 -0
  179. package/cli/build/exportExtensionBundles.d.ts.map +1 -0
  180. package/cli/build/exportExtensionBundles.js +193 -0
  181. package/cli/build/exportExtensionBundles.js.map +1 -0
  182. package/cli/build/extensionBundle/constants.d.ts +21 -0
  183. package/cli/build/extensionBundle/constants.d.ts.map +1 -0
  184. package/cli/build/extensionBundle/constants.js +30 -0
  185. package/cli/build/extensionBundle/constants.js.map +1 -0
  186. package/cli/build/extensionBundle/fsInstall.d.ts +50 -0
  187. package/cli/build/extensionBundle/fsInstall.d.ts.map +1 -0
  188. package/cli/build/extensionBundle/fsInstall.js +180 -0
  189. package/cli/build/extensionBundle/fsInstall.js.map +1 -0
  190. package/cli/build/extensionBundle/hermesExport.d.ts +37 -0
  191. package/cli/build/extensionBundle/hermesExport.d.ts.map +1 -0
  192. package/cli/build/extensionBundle/hermesExport.js +112 -0
  193. package/cli/build/extensionBundle/hermesExport.js.map +1 -0
  194. package/cli/build/generate.d.ts.map +1 -1
  195. package/cli/build/generate.js +7 -1
  196. package/cli/build/generate.js.map +1 -1
  197. package/cli/build/index.js +53 -3
  198. package/cli/build/index.js.map +1 -1
  199. package/cli/build/scaffold/copyTemplate.d.ts +15 -0
  200. package/cli/build/scaffold/copyTemplate.d.ts.map +1 -0
  201. package/cli/build/scaffold/copyTemplate.js +109 -0
  202. package/cli/build/scaffold/copyTemplate.js.map +1 -0
  203. package/cli/build/scaffold/expoConfigIO.d.ts +15 -0
  204. package/cli/build/scaffold/expoConfigIO.d.ts.map +1 -0
  205. package/cli/build/scaffold/expoConfigIO.js +104 -0
  206. package/cli/build/scaffold/expoConfigIO.js.map +1 -0
  207. package/cli/build/scaffold/generateConfig.d.ts +13 -0
  208. package/cli/build/scaffold/generateConfig.d.ts.map +1 -0
  209. package/cli/build/scaffold/generateConfig.js +169 -0
  210. package/cli/build/scaffold/generateConfig.js.map +1 -0
  211. package/cli/build/scaffold/index.d.ts +3 -0
  212. package/cli/build/scaffold/index.d.ts.map +1 -0
  213. package/cli/build/scaffold/index.js +8 -0
  214. package/cli/build/scaffold/index.js.map +1 -0
  215. package/cli/build/scaffold/prompts.d.ts +3 -0
  216. package/cli/build/scaffold/prompts.d.ts.map +1 -0
  217. package/cli/build/scaffold/prompts.js +92 -0
  218. package/cli/build/scaffold/prompts.js.map +1 -0
  219. package/cli/build/scaffold/reactNativeTemplate.d.ts +3 -0
  220. package/cli/build/scaffold/reactNativeTemplate.d.ts.map +1 -0
  221. package/cli/build/scaffold/reactNativeTemplate.js +56 -0
  222. package/cli/build/scaffold/reactNativeTemplate.js.map +1 -0
  223. package/cli/build/scaffold/resolveAndroidPackage.d.ts +5 -0
  224. package/cli/build/scaffold/resolveAndroidPackage.d.ts.map +1 -0
  225. package/cli/build/scaffold/resolveAndroidPackage.js +42 -0
  226. package/cli/build/scaffold/resolveAndroidPackage.js.map +1 -0
  227. package/cli/build/scaffold/resolveAppGroup.d.ts +6 -0
  228. package/cli/build/scaffold/resolveAppGroup.d.ts.map +1 -0
  229. package/cli/build/scaffold/resolveAppGroup.js +68 -0
  230. package/cli/build/scaffold/resolveAppGroup.js.map +1 -0
  231. package/cli/build/scaffold/scaffoldTarget.d.ts +14 -0
  232. package/cli/build/scaffold/scaffoldTarget.d.ts.map +1 -0
  233. package/cli/build/scaffold/scaffoldTarget.js +267 -0
  234. package/cli/build/scaffold/scaffoldTarget.js.map +1 -0
  235. package/cli/build/scaffold/templates/android.d.ts +33 -0
  236. package/cli/build/scaffold/templates/android.d.ts.map +1 -0
  237. package/cli/build/scaffold/templates/android.js +117 -0
  238. package/cli/build/scaffold/templates/android.js.map +1 -0
  239. package/cli/build/scaffold/templates/ios.d.ts +20 -0
  240. package/cli/build/scaffold/templates/ios.d.ts.map +1 -0
  241. package/cli/build/scaffold/templates/ios.js +505 -0
  242. package/cli/build/scaffold/templates/ios.js.map +1 -0
  243. package/cli/build/scaffold/templates/liveActivity.d.ts +11 -0
  244. package/cli/build/scaffold/templates/liveActivity.d.ts.map +1 -0
  245. package/cli/build/scaffold/templates/liveActivity.js +71 -0
  246. package/cli/build/scaffold/templates/liveActivity.js.map +1 -0
  247. package/cli/build/scaffold/utils.d.ts +3 -0
  248. package/cli/build/scaffold/utils.d.ts.map +1 -0
  249. package/cli/build/scaffold/utils.js +15 -0
  250. package/cli/build/scaffold/utils.js.map +1 -0
  251. package/cli/build/scaffold/wireExpoConfig.d.ts +12 -0
  252. package/cli/build/scaffold/wireExpoConfig.d.ts.map +1 -0
  253. package/cli/build/scaffold/wireExpoConfig.js +49 -0
  254. package/cli/build/scaffold/wireExpoConfig.js.map +1 -0
  255. package/cli/build/scaffold/wireHost.d.ts +21 -0
  256. package/cli/build/scaffold/wireHost.d.ts.map +1 -0
  257. package/cli/build/scaffold/wireHost.js +89 -0
  258. package/cli/build/scaffold/wireHost.js.map +1 -0
  259. package/cli/build/scaffold/wireMetro.d.ts +11 -0
  260. package/cli/build/scaffold/wireMetro.d.ts.map +1 -0
  261. package/cli/build/scaffold/wireMetro.js +64 -0
  262. package/cli/build/scaffold/wireMetro.js.map +1 -0
  263. package/cli/build/scaffold/wirePackageJson.d.ts +2 -0
  264. package/cli/build/scaffold/wirePackageJson.d.ts.map +1 -0
  265. package/cli/build/scaffold/wirePackageJson.js +24 -0
  266. package/cli/build/scaffold/wirePackageJson.js.map +1 -0
  267. package/cli/build/types.d.ts +1 -0
  268. package/cli/build/types.d.ts.map +1 -1
  269. package/expo-module.config.json +4 -1
  270. package/ios/ExpoTargetsExtensionBundleModule.swift +172 -0
  271. package/ios/ExpoTargetsMessagesModule.swift +4 -3
  272. package/ios/ExpoTargetsStorage.podspec +1 -0
  273. package/ios/ExpoTargetsStorageModule.swift +13 -0
  274. package/metro/build/withTargets.d.ts.map +1 -1
  275. package/metro/build/withTargets.js +37 -11
  276. package/metro/build/withTargets.js.map +1 -1
  277. package/package.json +5 -1
  278. package/plugin/build/android/activationMime.d.ts +12 -0
  279. package/plugin/build/android/activationMime.d.ts.map +1 -0
  280. package/plugin/build/android/activationMime.js +47 -0
  281. package/plugin/build/android/activationMime.js.map +1 -0
  282. package/plugin/build/android/resolveUserClass.d.ts +14 -0
  283. package/plugin/build/android/resolveUserClass.d.ts.map +1 -0
  284. package/plugin/build/android/resolveUserClass.js +48 -0
  285. package/plugin/build/android/resolveUserClass.js.map +1 -0
  286. package/plugin/build/android/targetSourceSets.d.ts +9 -0
  287. package/plugin/build/android/targetSourceSets.d.ts.map +1 -0
  288. package/plugin/build/android/targetSourceSets.js +90 -0
  289. package/plugin/build/android/targetSourceSets.js.map +1 -0
  290. package/plugin/build/android/withAndroidNotification.d.ts +12 -0
  291. package/plugin/build/android/withAndroidNotification.d.ts.map +1 -0
  292. package/plugin/build/android/withAndroidNotification.js +192 -0
  293. package/plugin/build/android/withAndroidNotification.js.map +1 -0
  294. package/plugin/build/android/withAndroidShareAction.d.ts +11 -0
  295. package/plugin/build/android/withAndroidShareAction.d.ts.map +1 -0
  296. package/plugin/build/android/withAndroidShareAction.js +172 -0
  297. package/plugin/build/android/withAndroidShareAction.js.map +1 -0
  298. package/plugin/build/android/withAndroidSystemService.d.ts +12 -0
  299. package/plugin/build/android/withAndroidSystemService.d.ts.map +1 -0
  300. package/plugin/build/android/withAndroidSystemService.js +332 -0
  301. package/plugin/build/android/withAndroidSystemService.js.map +1 -0
  302. package/plugin/build/android/withAndroidTarget.d.ts +2 -1
  303. package/plugin/build/android/withAndroidTarget.d.ts.map +1 -1
  304. package/plugin/build/android/withAndroidTarget.js +25 -3
  305. package/plugin/build/android/withAndroidTarget.js.map +1 -1
  306. package/plugin/build/android/withAndroidTargetsConfig.d.ts +9 -0
  307. package/plugin/build/android/withAndroidTargetsConfig.d.ts.map +1 -0
  308. package/plugin/build/android/withAndroidTargetsConfig.js +52 -0
  309. package/plugin/build/android/withAndroidTargetsConfig.js.map +1 -0
  310. package/plugin/build/codegen/collectRuntimeConfigs.d.ts +3 -0
  311. package/plugin/build/codegen/collectRuntimeConfigs.d.ts.map +1 -1
  312. package/plugin/build/codegen/collectRuntimeConfigs.js.map +1 -1
  313. package/plugin/build/codegen/index.d.ts +1 -1
  314. package/plugin/build/codegen/index.d.ts.map +1 -1
  315. package/plugin/build/codegen/index.js +2 -1
  316. package/plugin/build/codegen/index.js.map +1 -1
  317. package/plugin/build/codegen/typedTargets.d.ts +11 -1
  318. package/plugin/build/codegen/typedTargets.d.ts.map +1 -1
  319. package/plugin/build/codegen/typedTargets.js +102 -12
  320. package/plugin/build/codegen/typedTargets.js.map +1 -1
  321. package/plugin/build/config.d.ts +37 -6
  322. package/plugin/build/config.d.ts.map +1 -1
  323. package/plugin/build/config.js.map +1 -1
  324. package/plugin/build/domain/characteristics.d.ts +8 -0
  325. package/plugin/build/domain/characteristics.d.ts.map +1 -1
  326. package/plugin/build/domain/characteristics.js +81 -10
  327. package/plugin/build/domain/characteristics.js.map +1 -1
  328. package/plugin/build/domain/index.d.ts +1 -1
  329. package/plugin/build/domain/index.d.ts.map +1 -1
  330. package/plugin/build/domain/index.js.map +1 -1
  331. package/plugin/build/ios/apply/podfile/podfile.d.ts.map +1 -1
  332. package/plugin/build/ios/apply/podfile/podfile.js +21 -4
  333. package/plugin/build/ios/apply/podfile/podfile.js.map +1 -1
  334. package/plugin/build/ios/cng/appShortcutsCodegen.d.ts +1 -1
  335. package/plugin/build/ios/cng/appShortcutsCodegen.d.ts.map +1 -1
  336. package/plugin/build/ios/cng/appShortcutsCodegen.js +1 -1
  337. package/plugin/build/ios/cng/appShortcutsCodegen.js.map +1 -1
  338. package/plugin/build/ios/plan/swiftSources.d.ts.map +1 -1
  339. package/plugin/build/ios/plan/swiftSources.js +10 -0
  340. package/plugin/build/ios/plan/swiftSources.js.map +1 -1
  341. package/plugin/build/ios/plan/types.d.ts +6 -0
  342. package/plugin/build/ios/plan/types.d.ts.map +1 -1
  343. package/plugin/build/ios/templates/ReactNativeViewController.swift +45 -7
  344. package/plugin/build/ios/utils/reactNativeSwift.d.ts +3 -0
  345. package/plugin/build/ios/utils/reactNativeSwift.d.ts.map +1 -1
  346. package/plugin/build/ios/utils/reactNativeSwift.js +3 -0
  347. package/plugin/build/ios/utils/reactNativeSwift.js.map +1 -1
  348. package/plugin/build/resolveExcludedPackages.d.ts +15 -0
  349. package/plugin/build/resolveExcludedPackages.d.ts.map +1 -0
  350. package/plugin/build/resolveExcludedPackages.js +30 -0
  351. package/plugin/build/resolveExcludedPackages.js.map +1 -0
  352. package/plugin/build/withTargetsDir.d.ts +5 -0
  353. package/plugin/build/withTargetsDir.d.ts.map +1 -1
  354. package/plugin/build/withTargetsDir.js +114 -47
  355. package/plugin/build/withTargetsDir.js.map +1 -1
@@ -0,0 +1,192 @@
1
+ package expo.modules.targets.notification
2
+
3
+ import android.app.NotificationChannel
4
+ import android.app.NotificationManager
5
+ import android.app.PendingIntent
6
+ import android.content.Context
7
+ import android.content.Intent
8
+ import android.os.Build
9
+ import android.widget.RemoteViews
10
+ import androidx.core.app.NotificationCompat
11
+ import androidx.core.app.NotificationManagerCompat
12
+ import expo.modules.targets.R
13
+ import org.json.JSONObject
14
+
15
+ /**
16
+ * Shared NotificationCompat posting for notification-service, notification-content,
17
+ * and LiveActivity ongoing-notification helper (Wave 2).
18
+ */
19
+ object ExpoTargetsNotificationRouter {
20
+ const val LAST_TITLE_KEY = "nse-last-title"
21
+ const val LIVE_CHANNEL_ID = "expo_targets_live_activity"
22
+ const val LIVE_CHANNEL_NAME = "Live Activities"
23
+
24
+ fun ensureChannel(
25
+ context: Context,
26
+ channelId: String,
27
+ channelName: String,
28
+ importance: Int = NotificationManager.IMPORTANCE_DEFAULT,
29
+ ) {
30
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
31
+ val mgr = context.getSystemService(NotificationManager::class.java) ?: return
32
+ if (mgr.getNotificationChannel(channelId) != null) return
33
+ mgr.createNotificationChannel(
34
+ NotificationChannel(channelId, channelName, importance),
35
+ )
36
+ }
37
+
38
+ fun persistLastTitle(context: Context, appGroup: String, title: String) {
39
+ context
40
+ .getSharedPreferences(appGroup, Context.MODE_PRIVATE)
41
+ .edit()
42
+ .putString(LAST_TITLE_KEY, title)
43
+ .commit()
44
+ }
45
+
46
+ fun readLastTitle(context: Context, appGroup: String): String? {
47
+ return context
48
+ .getSharedPreferences(appGroup, Context.MODE_PRIVATE)
49
+ .getString(LAST_TITLE_KEY, null)
50
+ }
51
+
52
+ fun processTitle(title: String, mutationMarker: String): String {
53
+ return if (title.contains(mutationMarker.trim())) title else "$title$mutationMarker"
54
+ }
55
+
56
+ /**
57
+ * Local NSE equivalent: mutate title, persist marker, post NotificationCompat.
58
+ */
59
+ fun presentProcessed(
60
+ context: Context,
61
+ appGroup: String,
62
+ channelId: String,
63
+ channelName: String,
64
+ title: String,
65
+ body: String,
66
+ mutationMarker: String,
67
+ notificationId: Int = title.hashCode(),
68
+ ): String {
69
+ ensureChannel(context, channelId, channelName)
70
+ val mutated = processTitle(title, mutationMarker)
71
+ persistLastTitle(context, appGroup, mutated)
72
+
73
+ val builder =
74
+ NotificationCompat.Builder(context, channelId)
75
+ .setSmallIcon(android.R.drawable.ic_dialog_info)
76
+ .setContentTitle(mutated)
77
+ .setContentText(body)
78
+ .setContentIntent(hostPendingIntent(context))
79
+ .setAutoCancel(true)
80
+ .setPriority(NotificationCompat.PRIORITY_DEFAULT)
81
+
82
+ NotificationManagerCompat.from(context).notify(notificationId, builder.build())
83
+ return mutated
84
+ }
85
+
86
+ /**
87
+ * notification-content approximation: DecoratedCustomViewStyle + RemoteViews.
88
+ * Android 12+ clamps custom chrome — documented partial.
89
+ */
90
+ fun presentRichContent(
91
+ context: Context,
92
+ appGroup: String,
93
+ channelId: String,
94
+ channelName: String,
95
+ title: String,
96
+ body: String,
97
+ category: String,
98
+ notificationId: Int = (title + category).hashCode(),
99
+ ) {
100
+ ensureChannel(context, channelId, channelName)
101
+ persistLastTitle(context, appGroup, title)
102
+
103
+ val custom =
104
+ RemoteViews(context.packageName, R.layout.expo_targets_notification_content).apply {
105
+ setTextViewText(R.id.expo_targets_notif_title, title)
106
+ setTextViewText(R.id.expo_targets_notif_body, body)
107
+ setTextViewText(R.id.expo_targets_notif_category, category)
108
+ }
109
+
110
+ val builder =
111
+ NotificationCompat.Builder(context, channelId)
112
+ .setSmallIcon(android.R.drawable.ic_dialog_info)
113
+ .setContentTitle(title)
114
+ .setContentText(body)
115
+ .setStyle(NotificationCompat.DecoratedCustomViewStyle())
116
+ .setCustomContentView(custom)
117
+ .setCustomBigContentView(custom)
118
+ .setContentIntent(hostPendingIntent(context))
119
+ .setAutoCancel(true)
120
+ .setCategory(category)
121
+ .setPriority(NotificationCompat.PRIORITY_DEFAULT)
122
+
123
+ NotificationManagerCompat.from(context).notify(notificationId, builder.build())
124
+ }
125
+
126
+ fun presentOngoing(
127
+ context: Context,
128
+ activityId: String,
129
+ title: String,
130
+ body: String,
131
+ contentStateJson: String,
132
+ ) {
133
+ ensureChannel(
134
+ context,
135
+ LIVE_CHANNEL_ID,
136
+ LIVE_CHANNEL_NAME,
137
+ NotificationManager.IMPORTANCE_LOW,
138
+ )
139
+
140
+ val stateHint =
141
+ try {
142
+ val json = JSONObject(contentStateJson)
143
+ json.optString("status", body).ifEmpty { body }
144
+ } catch (_: Exception) {
145
+ body
146
+ }
147
+
148
+ val builder =
149
+ NotificationCompat.Builder(context, LIVE_CHANNEL_ID)
150
+ .setSmallIcon(android.R.drawable.ic_menu_info_details)
151
+ .setContentTitle(title)
152
+ .setContentText(stateHint)
153
+ .setOngoing(true)
154
+ .setOnlyAlertOnce(true)
155
+ .setContentIntent(hostPendingIntent(context))
156
+ .setPriority(NotificationCompat.PRIORITY_LOW)
157
+ .setCategory(NotificationCompat.CATEGORY_STATUS)
158
+
159
+ NotificationManagerCompat.from(context).notify(notifIdFor(activityId), builder.build())
160
+ }
161
+
162
+ fun cancelOngoing(context: Context, activityId: String) {
163
+ NotificationManagerCompat.from(context).cancel(notifIdFor(activityId))
164
+ }
165
+
166
+ fun cancelAllLive(context: Context, activityIds: Collection<String>) {
167
+ val mgr = NotificationManagerCompat.from(context)
168
+ for (id in activityIds) {
169
+ mgr.cancel(notifIdFor(id))
170
+ }
171
+ }
172
+
173
+ fun notificationsEnabled(context: Context): Boolean {
174
+ return NotificationManagerCompat.from(context).areNotificationsEnabled()
175
+ }
176
+
177
+ private fun notifIdFor(activityId: String): Int {
178
+ return 0x71000000 or (activityId.hashCode() and 0x00FFFFFF)
179
+ }
180
+
181
+ private fun hostPendingIntent(context: Context): PendingIntent {
182
+ val launch =
183
+ context.packageManager.getLaunchIntentForPackage(context.packageName)
184
+ ?: Intent().setPackage(context.packageName)
185
+ return PendingIntent.getActivity(
186
+ context,
187
+ 0,
188
+ launch,
189
+ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
190
+ )
191
+ }
192
+ }
@@ -0,0 +1,92 @@
1
+ package expo.modules.targets.notification
2
+
3
+ import android.app.Service
4
+ import android.content.ComponentName
5
+ import android.content.Intent
6
+ import android.content.pm.PackageManager
7
+ import android.os.IBinder
8
+
9
+ /**
10
+ * Host-process notification processor (Wave 2).
11
+ * Receives `expo.targets.action.PROCESS_NOTIFICATION` with title/body extras,
12
+ * mutates like iOS NSE, posts NotificationCompat, writes SharedPreferences marker.
13
+ *
14
+ * Not a system NSE — only notifications you route here (local path REQUIRED;
15
+ * FCM leftover when push credentials unavailable).
16
+ */
17
+ open class ExpoTargetsNotificationService : Service() {
18
+ protected var targetName: String = "Notification"
19
+ protected var appGroup: String = ""
20
+ protected var channelId: String = "expo_targets_notification"
21
+ protected var channelName: String = "Notifications"
22
+ protected var kind: String = "service"
23
+ protected var category: String = "myNotificationCategory"
24
+ protected var mutationMarker: String = " [expo-targets]"
25
+
26
+ override fun onBind(intent: Intent?): IBinder? = null
27
+
28
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
29
+ readMeta()
30
+ if (intent?.action == ACTION_PROCESS) {
31
+ handleProcess(intent)
32
+ }
33
+ stopSelf(startId)
34
+ return START_NOT_STICKY
35
+ }
36
+
37
+ private fun readMeta() {
38
+ try {
39
+ val cn = ComponentName(this, javaClass)
40
+ val info =
41
+ packageManager.getServiceInfo(
42
+ cn,
43
+ PackageManager.GET_META_DATA,
44
+ )
45
+ val meta = info.metaData
46
+ targetName = meta?.getString("expo.targets.TARGET_NAME") ?: targetName
47
+ appGroup =
48
+ meta?.getString("expo.targets.APP_GROUP") ?: "group.$packageName"
49
+ channelId = meta?.getString("expo.targets.CHANNEL_ID") ?: channelId
50
+ channelName = meta?.getString("expo.targets.CHANNEL_NAME") ?: channelName
51
+ kind = meta?.getString("expo.targets.NOTIF_KIND") ?: kind
52
+ category = meta?.getString("expo.targets.CATEGORY") ?: category
53
+ mutationMarker =
54
+ meta?.getString("expo.targets.MUTATION_MARKER") ?: mutationMarker
55
+ } catch (_: Exception) {
56
+ appGroup = "group.$packageName"
57
+ }
58
+ }
59
+
60
+ private fun handleProcess(intent: Intent) {
61
+ val title = intent.getStringExtra(EXTRA_TITLE) ?: "Notification"
62
+ val body = intent.getStringExtra(EXTRA_BODY) ?: ""
63
+
64
+ if (kind == "content") {
65
+ ExpoTargetsNotificationRouter.presentRichContent(
66
+ this,
67
+ appGroup,
68
+ channelId,
69
+ channelName,
70
+ title,
71
+ body,
72
+ category,
73
+ )
74
+ } else {
75
+ ExpoTargetsNotificationRouter.presentProcessed(
76
+ this,
77
+ appGroup,
78
+ channelId,
79
+ channelName,
80
+ title,
81
+ body,
82
+ mutationMarker,
83
+ )
84
+ }
85
+ }
86
+
87
+ companion object {
88
+ const val ACTION_PROCESS = "expo.targets.action.PROCESS_NOTIFICATION"
89
+ const val EXTRA_TITLE = "expo.targets.TITLE"
90
+ const val EXTRA_BODY = "expo.targets.BODY"
91
+ }
92
+ }
@@ -10,6 +10,7 @@ import expo.modules.targets.ExpoTargetsReceiver
10
10
  class ExpoTargetsStorageModule : Module() {
11
11
  companion object {
12
12
  private const val TAG = "Storage"
13
+ const val TARGETS_CONFIG_ASSET = "expo_targets_config.json"
13
14
  }
14
15
 
15
16
  override fun definition() = ModuleDefinition {
@@ -19,71 +20,103 @@ class ExpoTargetsStorageModule : Module() {
19
20
  appContext.reactContext?.let { ExpoTargetsLogger.init(it) }
20
21
  }
21
22
 
22
- Function("setInt") { key: String, value: Int, suite: String? ->
23
- ExpoTargetsLogger.d(TAG, "setInt: key=$key, value=$value, suite=$suite")
23
+ Function("setInt") { key: String, value: Int, suite: String?, targetName: String? ->
24
+ val resolved = resolveKey(key, targetName)
25
+ ExpoTargetsLogger.d(TAG, "setInt: key=$resolved, value=$value, suite=$suite")
24
26
  val prefs = getSharedPreferences(suite)
25
- prefs.edit().putInt(key, value).commit().also { success ->
27
+ prefs.edit().putInt(resolved, value).commit().also { success ->
26
28
  ExpoTargetsLogger.d(TAG, "setInt committed: $success")
27
29
  }
28
30
  }
29
31
 
30
- Function("setString") { key: String, value: String, suite: String? ->
31
- ExpoTargetsLogger.d(TAG, "setString: key=$key, value=$value, suite=$suite")
32
+ Function("setString") { key: String, value: String, suite: String?, targetName: String? ->
33
+ val resolved = resolveKey(key, targetName)
34
+ ExpoTargetsLogger.d(TAG, "setString: key=$resolved, value=$value, suite=$suite")
32
35
  val prefs = getSharedPreferences(suite)
33
- prefs.edit().putString(key, value).commit().also { success ->
36
+ prefs.edit().putString(resolved, value).commit().also { success ->
34
37
  ExpoTargetsLogger.d(TAG, "setString committed: $success")
35
38
  }
36
39
  }
37
40
 
38
- Function("setObject") { key: String, value: Map<String, Any?>, suite: String? ->
39
- ExpoTargetsLogger.d(TAG, "setObject: key=$key, value=$value, suite=$suite")
41
+ Function("setObject") { key: String, value: Map<String, Any?>, suite: String?, targetName: String? ->
42
+ val resolved = resolveKey(key, targetName)
43
+ ExpoTargetsLogger.d(TAG, "setObject: key=$resolved, value=$value, suite=$suite")
40
44
  val prefs = getSharedPreferences(suite)
41
45
  // Convert map to JSON string for storage
42
- val jsonString = value.entries.joinToString(",", "{", "}") { (k, v) ->
43
- "\"$k\":${when (v) {
44
- is String -> "\"$v\""
45
- is Number -> v.toString()
46
- is Boolean -> v.toString()
47
- null -> "null"
48
- else -> "\"$v\""
49
- }}"
50
- }
51
- val success = prefs.edit().putString(key, jsonString).commit()
46
+ val jsonString =
47
+ value.entries.joinToString(",", "{", "}") { (k, v) ->
48
+ "\"$k\":${
49
+ when (v) {
50
+ is String -> "\"$v\""
51
+ is Number -> v.toString()
52
+ is Boolean -> v.toString()
53
+ null -> "null"
54
+ else -> "\"$v\""
55
+ }
56
+ }"
57
+ }
58
+ val success = prefs.edit().putString(resolved, jsonString).commit()
52
59
  ExpoTargetsLogger.d(TAG, "setObject committed: $success, json=$jsonString")
53
- return@Function success
60
+ success
54
61
  }
55
62
 
56
- Function("get") { key: String, suite: String? ->
63
+ Function("get") { key: String, suite: String?, targetName: String? ->
64
+ val resolved = resolveKey(key, targetName)
57
65
  val prefs = getSharedPreferences(suite)
58
- val value = prefs.getString(key, null)
59
- ExpoTargetsLogger.d(TAG, "get: key=$key, suite=$suite, value=$value")
60
- return@Function value
66
+ val value = prefs.getString(resolved, null)
67
+ ExpoTargetsLogger.d(TAG, "get: key=$resolved, suite=$suite, value=$value")
68
+ value
61
69
  }
62
70
 
63
- Function("remove") { key: String, suite: String? ->
64
- ExpoTargetsLogger.d(TAG, "remove: key=$key, suite=$suite")
71
+ Function("remove") { key: String, suite: String?, targetName: String? ->
72
+ val resolved = resolveKey(key, targetName)
73
+ ExpoTargetsLogger.d(TAG, "remove: key=$resolved, suite=$suite")
65
74
  val prefs = getSharedPreferences(suite)
66
- prefs.edit().remove(key).commit()
75
+ prefs.edit().remove(resolved).commit()
67
76
  }
68
77
 
69
- Function("getAllKeys") { suite: String? ->
78
+ Function("getAllKeys") { suite: String?, targetName: String? ->
70
79
  val prefs = getSharedPreferences(suite)
71
- val keys = prefs.all.keys.toList()
80
+ val keys =
81
+ if (targetName.isNullOrEmpty()) {
82
+ prefs.all.keys.toList()
83
+ } else {
84
+ val prefix = "$targetName:"
85
+ prefs.all.keys
86
+ .filter { it.startsWith(prefix) }
87
+ .map { it.removePrefix(prefix) }
88
+ }
72
89
  ExpoTargetsLogger.d(TAG, "getAllKeys: suite=$suite, keys=$keys")
73
- return@Function keys
90
+ keys
74
91
  }
75
92
 
76
- Function("getAllData") { suite: String? ->
93
+ Function("getAllData") { suite: String?, targetName: String? ->
77
94
  val prefs = getSharedPreferences(suite)
78
- val data = prefs.all
95
+ val all = prefs.all
96
+ val data: Map<String, Any?> =
97
+ if (targetName.isNullOrEmpty()) {
98
+ all
99
+ } else {
100
+ val prefix = "$targetName:"
101
+ all
102
+ .filterKeys { it.startsWith(prefix) }
103
+ .mapKeys { it.key.removePrefix(prefix) }
104
+ }
79
105
  ExpoTargetsLogger.d(TAG, "getAllData: suite=$suite, data=$data")
80
- return@Function data
106
+ data
81
107
  }
82
108
 
83
- Function("clearAll") { suite: String? ->
84
- ExpoTargetsLogger.d(TAG, "clearAll: suite=$suite")
109
+ Function("clearAll") { suite: String?, targetName: String? ->
110
+ ExpoTargetsLogger.d(TAG, "clearAll: suite=$suite, targetName=$targetName")
85
111
  val prefs = getSharedPreferences(suite)
86
- prefs.edit().clear().commit()
112
+ if (targetName.isNullOrEmpty()) {
113
+ prefs.edit().clear().commit()
114
+ } else {
115
+ val prefix = "$targetName:"
116
+ val editor = prefs.edit()
117
+ prefs.all.keys.filter { it.startsWith(prefix) }.forEach { editor.remove(it) }
118
+ editor.commit()
119
+ }
87
120
  }
88
121
 
89
122
  Function("refreshTarget") { name: String? ->
@@ -91,9 +124,7 @@ class ExpoTargetsStorageModule : Module() {
91
124
  val context = appContext.reactContext
92
125
  if (context == null) {
93
126
  ExpoTargetsLogger.w(TAG, "refreshTarget: React context is null, cannot refresh")
94
- return@Function
95
- }
96
- if (name != null) {
127
+ } else if (name != null) {
97
128
  ExpoTargetsLogger.d(TAG, "refreshTarget: Calling ExpoTargetsReceiver.refreshWidget for '$name'")
98
129
  ExpoTargetsReceiver.refreshWidget(context, name)
99
130
  } else {
@@ -102,18 +133,72 @@ class ExpoTargetsStorageModule : Module() {
102
133
  }
103
134
 
104
135
  Function("getTargetsConfig") {
105
- // Android: Read targets configuration
106
- // Will read from app resources or manifest metadata
107
136
  ExpoTargetsLogger.d(TAG, "getTargetsConfig called")
108
- return@Function null
137
+ val context = appContext.reactContext
138
+ if (context == null) {
139
+ ExpoTargetsLogger.w(TAG, "getTargetsConfig: React context is null")
140
+ null
141
+ } else {
142
+ readTargetsConfigAsset(context)
143
+ }
109
144
  }
110
145
  }
111
146
 
147
+ private fun resolveKey(key: String, targetName: String?): String {
148
+ if (targetName.isNullOrEmpty()) return key
149
+ return "$targetName:$key"
150
+ }
151
+
112
152
  private fun getSharedPreferences(suite: String?): SharedPreferences {
113
153
  val context = appContext.reactContext ?: throw IllegalStateException("React context is null")
114
154
  val prefsName = suite ?: "${context.packageName}_preferences"
115
155
  ExpoTargetsLogger.d(TAG, "getSharedPreferences: prefsName=$prefsName")
116
156
  return context.getSharedPreferences(prefsName, Context.MODE_PRIVATE)
117
157
  }
118
- }
119
158
 
159
+ /**
160
+ * Reads `assets/expo_targets_config.json` written by the config plugin
161
+ * ([withAndroidTargetsConfig]).
162
+ */
163
+ private fun readTargetsConfigAsset(context: Context): Any? {
164
+ return try {
165
+ context.assets.open(TARGETS_CONFIG_ASSET).bufferedReader().use { reader ->
166
+ val json = reader.readText()
167
+ if (json.isBlank()) {
168
+ null
169
+ } else {
170
+ parseJsonValue(org.json.JSONTokener(json).nextValue())
171
+ }
172
+ }
173
+ } catch (e: java.io.FileNotFoundException) {
174
+ ExpoTargetsLogger.d(TAG, "getTargetsConfig: asset missing (${e.message})")
175
+ null
176
+ } catch (e: Exception) {
177
+ ExpoTargetsLogger.w(TAG, "getTargetsConfig: failed to read asset: ${e.message}")
178
+ null
179
+ }
180
+ }
181
+
182
+ private fun parseJsonValue(value: Any?): Any? {
183
+ return when (value) {
184
+ is org.json.JSONObject -> {
185
+ val map = HashMap<String, Any?>()
186
+ val keys = value.keys()
187
+ while (keys.hasNext()) {
188
+ val key = keys.next()
189
+ map[key] = parseJsonValue(value.get(key))
190
+ }
191
+ map
192
+ }
193
+ is org.json.JSONArray -> {
194
+ val list = ArrayList<Any?>(value.length())
195
+ for (i in 0 until value.length()) {
196
+ list.add(parseJsonValue(value.get(i)))
197
+ }
198
+ list
199
+ }
200
+ org.json.JSONObject.NULL -> null
201
+ else -> value
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,28 @@
1
+ package expo.modules.targets.system
2
+
3
+ import android.os.CancellationSignal
4
+ import android.service.autofill.AutofillService
5
+ import android.service.autofill.FillCallback
6
+ import android.service.autofill.FillRequest
7
+ import android.service.autofill.SaveCallback
8
+ import android.service.autofill.SaveRequest
9
+
10
+ /**
11
+ * Minimal AutofillService (Wave 3a credentials-provider).
12
+ * Settings → Autofill service picker is leftover (Play/Settings taxonomy).
13
+ * BeginGetCredential / CredentialProviderService can deepen later beside Autofill.
14
+ */
15
+ open class ExpoTargetsAutofillService : AutofillService() {
16
+ override fun onFillRequest(
17
+ request: FillRequest,
18
+ cancellationSignal: CancellationSignal,
19
+ callback: FillCallback,
20
+ ) {
21
+ // Empty response — registered + fails closed without preferred-service selection.
22
+ callback.onSuccess(null)
23
+ }
24
+
25
+ override fun onSaveRequest(request: SaveRequest, callback: SaveCallback) {
26
+ callback.onSuccess()
27
+ }
28
+ }
@@ -0,0 +1,47 @@
1
+ package expo.modules.targets.system
2
+
3
+ import android.content.ComponentName
4
+ import android.content.Context
5
+ import android.telecom.Call
6
+ import android.telecom.CallScreeningService
7
+
8
+ /**
9
+ * CallScreeningService dual for call-directory (Wave 3b).
10
+ * Role grant / telephony Settings is leftover. Host can seed blocked numbers
11
+ * in SharedPreferences suite (appGroup) under key `blocked_numbers` (CSV).
12
+ */
13
+ open class ExpoTargetsCallScreeningService : CallScreeningService() {
14
+ override fun onScreenCall(callDetails: Call.Details) {
15
+ val number = callDetails.handle?.schemeSpecificPart ?: ""
16
+ val blocked = loadBlocked().any { number.endsWith(it) || number == it }
17
+ val response =
18
+ CallResponse.Builder()
19
+ .setDisallowCall(blocked)
20
+ .setRejectCall(blocked)
21
+ .setSkipCallLog(false)
22
+ .setSkipNotification(false)
23
+ .build()
24
+ respondToCall(callDetails, response)
25
+ }
26
+
27
+ private fun loadBlocked(): List<String> {
28
+ val suite =
29
+ try {
30
+ val cn = ComponentName(this, javaClass)
31
+ val info =
32
+ packageManager.getServiceInfo(
33
+ cn,
34
+ android.content.pm.PackageManager.GET_META_DATA,
35
+ )
36
+ info.metaData?.getString("expo.targets.APP_GROUP")
37
+ } catch (_: Exception) {
38
+ null
39
+ } ?: "group.$packageName"
40
+
41
+ val raw =
42
+ getSharedPreferences(suite, Context.MODE_PRIVATE)
43
+ .getString("blocked_numbers", "")
44
+ ?: ""
45
+ return raw.split(',').map { it.trim() }.filter { it.isNotEmpty() }
46
+ }
47
+ }