react-native-attachment-kit 1.0.10 → 1.0.12

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 (29) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/android/src/main/libs/rnattachmentkit-release.aar +0 -0
  3. package/android/src/newarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +12 -1
  4. package/android/src/oldarch/java/com/rnattachmentkit/RNAttachmentKitModule.kt +12 -1
  5. package/ios/RNAttachmentKit.swift +2 -0
  6. package/ios/RNAttachmentKit.xcframework/Info.plist +5 -5
  7. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Assets.car +0 -0
  8. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.abi.json +404 -294
  9. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -0
  10. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  11. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios.swiftinterface +1 -0
  12. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  13. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  14. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeResources +12 -12
  15. package/ios/RNAttachmentKit.xcframework/ios-arm64/RNAttachmentKit.framework/_CodeSignature/CodeSignature +0 -0
  16. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Assets.car +0 -0
  17. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.abi.json +404 -294
  18. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -0
  19. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  20. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  21. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +404 -294
  22. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -0
  23. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  24. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/Modules/RNAttachmentKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -0
  25. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/RNAttachmentKit +0 -0
  26. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeDirectory +0 -0
  27. package/ios/RNAttachmentKit.xcframework/ios-arm64_x86_64-simulator/RNAttachmentKit.framework/_CodeSignature/CodeResources +22 -22
  28. package/package.json +1 -1
  29. package/src/types.ts +6 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.12 — 2026-10-20
4
+
5
+ - Album picker ("최근 항목 ⌄"): fixed crashes on fast repeated taps and on first use (iOS + Android); on iOS the popup no longer opens empty right after granting photo access.
6
+
7
+ ## 1.0.11 — 2026-10-20
8
+
9
+ - Viewer: `showDeleteButton` option (iOS + Android) — hides only the trash icon in the top bar (default `true`; save / share stay).
10
+ - Android: the gallery camera cell's "Tap to allow camera" is localized (59 languages).
11
+ - Android: the picker asks for video permission once when only "selected photos" access was granted (Android 14+).
12
+
3
13
  ## 1.0.10 — 2026-10-19
4
14
 
5
15
  - iOS: photos just saved from another app (e.g. KakaoTalk) now show at the top of "최근 항목". Recents is ordered by when photos were added (like the Photos app and the Android picker) instead of capture date — a saved photo keeps its original EXIF date and used to land far down the list.
@@ -506,7 +506,11 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
506
506
  }
507
507
 
508
508
  val permissionsToRequest = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && permission == Manifest.permission.READ_MEDIA_IMAGES) {
509
- if (ContextCompat.checkSelfPermission(fragmentActivity, Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) == PackageManager.PERMISSION_GRANTED) {
509
+ // 일부만 허용한 사용자는 열 때마다 사진 선택 창을 다시 띄우지 않으려고 바로 엶.
510
+ // 단 동영상도 보여야 하는데 READ_MEDIA_VIDEO 를 한 번도 묻지 않았으면 한 번은 물어봄 — 예전엔 사진 전용으로
511
+ // 권한을 받은 사용자(예: 가입 때 프로필 사진)가 여기서 바로 열려 동영상 권한을 영영 묻지 않아 동영상이 안 보였음
512
+ if (ContextCompat.checkSelfPermission(fragmentActivity, Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) == PackageManager.PERMISSION_GRANTED &&
513
+ (mediaType == "photo" || ContextCompat.checkSelfPermission(fragmentActivity, Manifest.permission.READ_MEDIA_VIDEO) == PackageManager.PERMISSION_GRANTED || wasVideoPermissionAsked())) {
510
514
  showSheet()
511
515
  return
512
516
  }
@@ -515,6 +519,7 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
515
519
  mediaPermissions
516
520
  }
517
521
 
522
+ if (permissionsToRequest.contains(Manifest.permission.READ_MEDIA_VIDEO)) markVideoPermissionAsked()
518
523
  permissionAwareActivity.requestPermissions(permissionsToRequest, 100, object : PermissionListener {
519
524
  override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray): Boolean {
520
525
  if (requestCode == 100 && grantResults != null) {
@@ -537,6 +542,11 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
537
542
  }
538
543
  }
539
544
 
545
+ // 동영상 권한(READ_MEDIA_VIDEO)을 한 번 물어봤는지 — 물어본 뒤 거절했으면 다시 묻지 않음 (Android 14+ 일부 허용 경로)
546
+ private fun mediaPermPrefs() = reactApplicationContext.getSharedPreferences("rnak_media_perm", android.content.Context.MODE_PRIVATE)
547
+ private fun wasVideoPermissionAsked(): Boolean = mediaPermPrefs().getBoolean("video_asked", false)
548
+ private fun markVideoPermissionAsked() { mediaPermPrefs().edit().putBoolean("video_asked", true).apply() }
549
+
540
550
  override fun openViewer(options: ReadableMap, promise: Promise) {
541
551
  // 동영상 페이지는 라이선스 키가 있어야
542
552
  if (!LicenseGate.isLicensed && options.hasKey("videos")) {
@@ -688,6 +698,7 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
688
698
  // 상단바 저장/공유/삭제 버튼과 그 문구들 (iOS와 동일한 옵션 키). 문구를 안 넘기면
689
699
  // 네이티브 쪽 로케일 리소스(values-ko/ja/zh, 그 외 en)가 자동 적용됩니다.
690
700
  putBoolean("showActionButtons", !options.hasKey("showActionButtons") || options.getBoolean("showActionButtons"))
701
+ putBoolean("showDeleteButton", !options.hasKey("showDeleteButton") || options.getBoolean("showDeleteButton"))
691
702
  for (key in listOf(
692
703
  "saveAllText", "saveOneText", "shareAllText", "shareOneText", "actionCancelText",
693
704
  "deleteConfirmTitle", "deleteConfirmMessage", "deleteConfirmGroupMessage", "deleteButtonText"
@@ -444,7 +444,11 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
444
444
  }
445
445
 
446
446
  val permissionsToRequest = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && permission == Manifest.permission.READ_MEDIA_IMAGES) {
447
- if (ContextCompat.checkSelfPermission(fragmentActivity, Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) == PackageManager.PERMISSION_GRANTED) {
447
+ // 일부만 허용한 사용자는 열 때마다 사진 선택 창을 다시 띄우지 않으려고 바로 엶.
448
+ // 단 동영상도 보여야 하는데 READ_MEDIA_VIDEO 를 한 번도 묻지 않았으면 한 번은 물어봄 — 예전엔 사진 전용으로
449
+ // 권한을 받은 사용자(예: 가입 때 프로필 사진)가 여기서 바로 열려 동영상 권한을 영영 묻지 않아 동영상이 안 보였음
450
+ if (ContextCompat.checkSelfPermission(fragmentActivity, Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) == PackageManager.PERMISSION_GRANTED &&
451
+ (mediaType == "photo" || ContextCompat.checkSelfPermission(fragmentActivity, Manifest.permission.READ_MEDIA_VIDEO) == PackageManager.PERMISSION_GRANTED || wasVideoPermissionAsked())) {
448
452
  showSheet()
449
453
  return
450
454
  }
@@ -453,6 +457,7 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
453
457
  mediaPermissions
454
458
  }
455
459
 
460
+ if (permissionsToRequest.contains(Manifest.permission.READ_MEDIA_VIDEO)) markVideoPermissionAsked()
456
461
  permissionAwareActivity.requestPermissions(permissionsToRequest, 100, object : PermissionListener {
457
462
  override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray): Boolean {
458
463
  if (requestCode == 100 && grantResults != null) {
@@ -545,6 +550,11 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
545
550
  }
546
551
 
547
552
  @ReactMethod
553
+ // 동영상 권한(READ_MEDIA_VIDEO)을 한 번 물어봤는지 — 물어본 뒤 거절했으면 다시 묻지 않음 (Android 14+ 일부 허용 경로)
554
+ private fun mediaPermPrefs() = reactApplicationContext.getSharedPreferences("rnak_media_perm", android.content.Context.MODE_PRIVATE)
555
+ private fun wasVideoPermissionAsked(): Boolean = mediaPermPrefs().getBoolean("video_asked", false)
556
+ private fun markVideoPermissionAsked() { mediaPermPrefs().edit().putBoolean("video_asked", true).apply() }
557
+
548
558
  override fun openViewer(options: ReadableMap, promise: Promise) {
549
559
  // 동영상 페이지는 라이선스 키가 있어야
550
560
  if (!LicenseGate.isLicensed && options.hasKey("videos")) {
@@ -697,6 +707,7 @@ class RNAttachmentKitModule(reactContext: ReactApplicationContext) :
697
707
  // 상단바 저장/공유/삭제 버튼과 그 문구들 (iOS와 동일한 옵션 키). 문구를 안 넘기면
698
708
  // 네이티브 쪽 로케일 리소스(values-ko/ja/zh, 그 외 en)가 자동 적용됩니다.
699
709
  putBoolean("showActionButtons", !options.hasKey("showActionButtons") || options.getBoolean("showActionButtons"))
710
+ putBoolean("showDeleteButton", !options.hasKey("showDeleteButton") || options.getBoolean("showDeleteButton"))
700
711
  for (key in listOf(
701
712
  "saveAllText", "saveOneText", "shareAllText", "shareOneText", "actionCancelText",
702
713
  "deleteConfirmTitle", "deleteConfirmMessage", "deleteConfirmGroupMessage", "deleteButtonText"
@@ -448,6 +448,7 @@ class RNAttachmentKit: RCTEventEmitter {
448
448
  // 저장/공유/삭제 상단바 버튼 - 사용자가 준 스크린샷(전체 저장/이 사진만 저장 등)에
449
449
  // 맞춘 기본 한국어 문구가 있으므로, JS에서 안 넘기면 그 기본값을 그대로 씁니다.
450
450
  let showActionButtons = (options["showActionButtons"] as? Bool) ?? true
451
+ let showDeleteButton = (options["showDeleteButton"] as? Bool) ?? true
451
452
  let saveAllText = options["saveAllText"] as? String
452
453
  let saveOneText = options["saveOneText"] as? String
453
454
  let shareAllText = options["shareAllText"] as? String
@@ -528,6 +529,7 @@ class RNAttachmentKit: RCTEventEmitter {
528
529
  viewerVC.themeColor = color
529
530
  }
530
531
  viewerVC.showActionButtons = showActionButtons
532
+ viewerVC.showDeleteButton = showDeleteButton
531
533
  if let saveAllText = saveAllText { viewerVC.saveAllText = saveAllText }
532
534
  if let saveOneText = saveOneText { viewerVC.saveOneText = saveOneText }
533
535
  if let shareAllText = shareAllText { viewerVC.shareAllText = shareAllText }
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>RNAttachmentKit.framework/RNAttachmentKit</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_x86_64-simulator</string>
11
+ <string>ios-arm64</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>RNAttachmentKit.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
- <string>x86_64</string>
18
17
  </array>
19
18
  <key>SupportedPlatform</key>
20
19
  <string>ios</string>
21
- <key>SupportedPlatformVariant</key>
22
- <string>simulator</string>
23
20
  </dict>
24
21
  <dict>
25
22
  <key>BinaryPath</key>
26
23
  <string>RNAttachmentKit.framework/RNAttachmentKit</string>
27
24
  <key>LibraryIdentifier</key>
28
- <string>ios-arm64</string>
25
+ <string>ios-arm64_x86_64-simulator</string>
29
26
  <key>LibraryPath</key>
30
27
  <string>RNAttachmentKit.framework</string>
31
28
  <key>SupportedArchitectures</key>
32
29
  <array>
33
30
  <string>arm64</string>
31
+ <string>x86_64</string>
34
32
  </array>
35
33
  <key>SupportedPlatform</key>
36
34
  <string>ios</string>
35
+ <key>SupportedPlatformVariant</key>
36
+ <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>