react-native-my-uploader-android 1.0.41 → 1.0.42
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.
|
@@ -80,11 +80,19 @@ class MyUploaderModule(private val reactContext: ReactApplicationContext) :
|
|
|
80
80
|
try {
|
|
81
81
|
val intent: Intent
|
|
82
82
|
if (isGallery) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) {
|
|
84
|
+
intent = Intent(MediaStore.ACTION_PICK_IMAGES) // Doğrudan sistem fotoğraf seçicisi
|
|
85
|
+
if (multipleFiles) {
|
|
86
|
+
// Not: Photo Picker'da max limit belirlenebilir
|
|
87
|
+
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, maxFiles)
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
// Eski sürümler için standart galeri
|
|
91
|
+
intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
|
|
92
|
+
if (multipleFiles) {
|
|
93
|
+
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
88
96
|
} else {
|
|
89
97
|
// SENARYO B: Genel Dosya Seçiciyi Açarlar (Sizin eski kodunuz)
|
|
90
98
|
val fileTypes = options.takeIf { it.hasKey("fileTypes") }
|
|
@@ -100,7 +108,11 @@ class MyUploaderModule(private val reactContext: ReactApplicationContext) :
|
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
|
-
|
|
111
|
+
// galeri fotograflar ve dosyalarım seçimi yaptırtıyor ...
|
|
112
|
+
// currentActivity.startActivityForResult(Intent.createChooser(intent, "Seçim Yapın"), REQUEST_CODE)
|
|
113
|
+
|
|
114
|
+
currentActivity.startActivityForResult(intent, REQUEST_CODE)
|
|
115
|
+
|
|
104
116
|
} catch (e: Exception) {
|
|
105
117
|
pickerPromise?.reject(E_FAILED_TO_OPEN_DOCUMENT, e)
|
|
106
118
|
pickerPromise = null
|