react-native-my-uploader-android 1.0.21 → 1.0.23

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/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Yaren Coskun
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yaren Coskun
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
@@ -1,21 +1,21 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = "MyUploader"
7
- s.version = package["version"]
8
- s.summary = package["description"]
9
- s.homepage = package["homepage"]
10
- s.license = package["license"]
11
- s.authors = package["author"]
12
-
13
- s.platforms = { :ios => min_ios_version_supported }
14
- s.source = { :git => "https://www.npmjs.com/~yrncskn.git", :tag => "#{s.version}" }
15
-
16
- s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
- s.private_header_files = "ios/**/*.h"
18
-
19
-
20
- install_modules_dependencies(s)
21
- end
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "MyUploader"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => min_ios_version_supported }
14
+ s.source = { :git => "https://www.npmjs.com/~yrncskn.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
+ s.private_header_files = "ios/**/*.h"
18
+
19
+
20
+ install_modules_dependencies(s)
21
+ end
package/README.md CHANGED
@@ -1,205 +1,205 @@
1
- # react-native-my-uploader
2
-
3
- file uploader
4
-
5
- ## Installation
6
-
7
-
8
- ```sh
9
- npm install react-native-my-uploader
10
- ```
11
-
12
-
13
- ## Usage
14
-
15
-
16
- ```js
17
- import React, {useState} from 'react';
18
- import {
19
- StyleSheet,
20
- View,
21
- Button,
22
- Text,
23
- Alert,
24
- ScrollView,
25
- StatusBar,
26
- } from 'react-native';
27
-
28
- import {
29
- pickFile,
30
- FileInfo,
31
- DocumentPickerOptions,
32
- } from 'react-native-my-uploader';
33
-
34
- const App = () => {
35
- const [selectedFiles, setSelectedFiles] = useState<FileInfo[]>([]);
36
-
37
- const handlePickFile = async (options: DocumentPickerOptions) => {
38
- try {
39
- console.log('Dosya seçici şu seçeneklerle başlatılıyor:', options);
40
- const files = await pickFile(options);
41
- console.log('Başarıyla seçilen dosyalar:', files);
42
-
43
- if (options.multipleFiles) {
44
- setSelectedFiles(prevFiles => [...prevFiles, ...files]);
45
- Alert.alert(
46
- 'Başarılı!',
47
- `${files.length} adet yeni dosya listeye eklendi.`,
48
- );
49
- } else {
50
- setSelectedFiles(files);
51
- Alert.alert('Başarılı!', `1 adet dosya başarıyla seçildi.`);
52
- }
53
-
54
- } catch (error: any) {
55
- if (error.code === 'E_PICKER_CANCELLED') {
56
- console.log('Kullanıcı seçimi iptal etti.');
57
- return;
58
- }
59
- console.error('Dosya seçme hatası:', error);
60
- Alert.alert('Bir Hata Oluştu', error.message || 'Bilinmeyen bir hata.');
61
- }
62
- };
63
-
64
- return (
65
- <View style={styles.container}>
66
- <StatusBar barStyle="dark-content" />
67
- <View style={styles.header}>
68
- <Text style={styles.title}>Dosya Yükleyici Paket Testi</Text>
69
- </View>
70
-
71
- <View style={styles.buttonGrid}>
72
- <Button
73
- title="Tek Bir Görüntü Seç"
74
- onPress={() =>
75
- handlePickFile({
76
- multipleFiles: false,
77
- fileTypes: ['image/*'],
78
- })
79
- }
80
- />
81
- <Button
82
- title="birden Fazla Dosya Seç (Maks 2MB)"
83
- onPress={() =>
84
- handlePickFile({
85
- multipleFiles: true,
86
- fileTypes: ['application/*'],
87
- maxSize: 2,
88
- })
89
- }
90
- />
91
- <Button
92
- title="Listeyi Temizle"
93
- color="#c0392b"
94
- onPress={() => setSelectedFiles([])}
95
- />
96
- </View>
97
-
98
- <View style={styles.resultsArea}>
99
- <Text style={styles.resultsTitle}>
100
- Seçilen Dosyalar ({selectedFiles.length} adet)
101
- </Text>
102
- <ScrollView contentContainerStyle={styles.scrollViewContent}>
103
- {selectedFiles.length > 0 ? (
104
- selectedFiles.map((file, index) => (
105
- <View key={`${file.fileUri}-${index}`} style={styles.fileCard}>
106
- <Text style={styles.fileName} numberOfLines={1}>
107
- {file.fileName}
108
- </Text>
109
- <Text style={styles.fileDetail}>
110
- Boyut: {(file.fileSize / 1024).toFixed(2)} KB
111
- </Text>
112
- </View>
113
- ))
114
- ) : (
115
- <Text style={styles.noFilesText}>
116
- Seçilen dosya yok.
117
- </Text>
118
- )}
119
- </ScrollView>
120
- </View>
121
- </View>
122
- );
123
- };
124
-
125
- const styles = StyleSheet.create({
126
- container: {
127
- flex: 1,
128
- backgroundColor: '#f0f2f5',
129
- },
130
- header: {
131
- padding: 20,
132
- alignItems: 'center',
133
- },
134
- title: {
135
- fontSize: 22,
136
- fontWeight: 'bold',
137
- color: '#1c1e21',
138
- },
139
- buttonGrid: {
140
- paddingHorizontal: 20,
141
- gap: 10,
142
- },
143
- resultsArea: {
144
- flex: 1,
145
- marginTop: 20,
146
- borderTopWidth: 1,
147
- borderTopColor: '#dddfe2',
148
- paddingHorizontal: 20,
149
- },
150
- resultsTitle: {
151
- fontSize: 18,
152
- fontWeight: '600',
153
- paddingVertical: 15,
154
- color: '#1c1e21',
155
- },
156
- scrollViewContent: {
157
- paddingBottom: 20,
158
- },
159
- fileCard: {
160
- backgroundColor: '#ffffff',
161
- padding: 15,
162
- borderRadius: 8,
163
- marginBottom: 10,
164
- shadowColor: '#000',
165
- shadowOffset: {width: 0, height: 1},
166
- shadowOpacity: 0.2,
167
- shadowRadius: 1.41,
168
- elevation: 2,
169
- },
170
- fileName: {
171
- fontSize: 16,
172
- fontWeight: 'bold',
173
- color: '#000',
174
- },
175
- fileDetail: {
176
- fontSize: 13,
177
- color: '#555',
178
- marginTop: 4,
179
- },
180
- noFilesText: {
181
- textAlign: 'center',
182
- color: '#888',
183
- marginTop: 30,
184
- fontStyle: 'italic',
185
- },
186
- });
187
-
188
-
189
- export default App;
190
- ```
191
-
192
-
193
- ## Contributing
194
-
195
- - [Development workflow](CONTRIBUTING.md#development-workflow)
196
- - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
197
- - [Code of conduct](CODE_OF_CONDUCT.md)
198
-
199
- ## License
200
-
201
- MIT
202
-
203
- ---
204
-
205
- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
1
+ # react-native-my-uploader
2
+
3
+ file uploader
4
+
5
+ ## Installation
6
+
7
+
8
+ ```sh
9
+ npm install react-native-my-uploader
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+
16
+ ```js
17
+ import React, {useState} from 'react';
18
+ import {
19
+ StyleSheet,
20
+ View,
21
+ Button,
22
+ Text,
23
+ Alert,
24
+ ScrollView,
25
+ StatusBar,
26
+ } from 'react-native';
27
+
28
+ import {
29
+ pickFile,
30
+ FileInfo,
31
+ DocumentPickerOptions,
32
+ } from 'react-native-my-uploader';
33
+
34
+ const App = () => {
35
+ const [selectedFiles, setSelectedFiles] = useState<FileInfo[]>([]);
36
+
37
+ const handlePickFile = async (options: DocumentPickerOptions) => {
38
+ try {
39
+ console.log('Dosya seçici şu seçeneklerle başlatılıyor:', options);
40
+ const files = await pickFile(options);
41
+ console.log('Başarıyla seçilen dosyalar:', files);
42
+
43
+ if (options.multipleFiles) {
44
+ setSelectedFiles(prevFiles => [...prevFiles, ...files]);
45
+ Alert.alert(
46
+ 'Başarılı!',
47
+ `${files.length} adet yeni dosya listeye eklendi.`,
48
+ );
49
+ } else {
50
+ setSelectedFiles(files);
51
+ Alert.alert('Başarılı!', `1 adet dosya başarıyla seçildi.`);
52
+ }
53
+
54
+ } catch (error: any) {
55
+ if (error.code === 'E_PICKER_CANCELLED') {
56
+ console.log('Kullanıcı seçimi iptal etti.');
57
+ return;
58
+ }
59
+ console.error('Dosya seçme hatası:', error);
60
+ Alert.alert('Bir Hata Oluştu', error.message || 'Bilinmeyen bir hata.');
61
+ }
62
+ };
63
+
64
+ return (
65
+ <View style={styles.container}>
66
+ <StatusBar barStyle="dark-content" />
67
+ <View style={styles.header}>
68
+ <Text style={styles.title}>Dosya Yükleyici Paket Testi</Text>
69
+ </View>
70
+
71
+ <View style={styles.buttonGrid}>
72
+ <Button
73
+ title="Tek Bir Görüntü Seç"
74
+ onPress={() =>
75
+ handlePickFile({
76
+ multipleFiles: false,
77
+ fileTypes: ['image/*'],
78
+ })
79
+ }
80
+ />
81
+ <Button
82
+ title="birden Fazla Dosya Seç (Maks 2MB)"
83
+ onPress={() =>
84
+ handlePickFile({
85
+ multipleFiles: true,
86
+ fileTypes: ['application/*'],
87
+ maxSize: 2,
88
+ })
89
+ }
90
+ />
91
+ <Button
92
+ title="Listeyi Temizle"
93
+ color="#c0392b"
94
+ onPress={() => setSelectedFiles([])}
95
+ />
96
+ </View>
97
+
98
+ <View style={styles.resultsArea}>
99
+ <Text style={styles.resultsTitle}>
100
+ Seçilen Dosyalar ({selectedFiles.length} adet)
101
+ </Text>
102
+ <ScrollView contentContainerStyle={styles.scrollViewContent}>
103
+ {selectedFiles.length > 0 ? (
104
+ selectedFiles.map((file, index) => (
105
+ <View key={`${file.fileUri}-${index}`} style={styles.fileCard}>
106
+ <Text style={styles.fileName} numberOfLines={1}>
107
+ {file.fileName}
108
+ </Text>
109
+ <Text style={styles.fileDetail}>
110
+ Boyut: {(file.fileSize / 1024).toFixed(2)} KB
111
+ </Text>
112
+ </View>
113
+ ))
114
+ ) : (
115
+ <Text style={styles.noFilesText}>
116
+ Seçilen dosya yok.
117
+ </Text>
118
+ )}
119
+ </ScrollView>
120
+ </View>
121
+ </View>
122
+ );
123
+ };
124
+
125
+ const styles = StyleSheet.create({
126
+ container: {
127
+ flex: 1,
128
+ backgroundColor: '#f0f2f5',
129
+ },
130
+ header: {
131
+ padding: 20,
132
+ alignItems: 'center',
133
+ },
134
+ title: {
135
+ fontSize: 22,
136
+ fontWeight: 'bold',
137
+ color: '#1c1e21',
138
+ },
139
+ buttonGrid: {
140
+ paddingHorizontal: 20,
141
+ gap: 10,
142
+ },
143
+ resultsArea: {
144
+ flex: 1,
145
+ marginTop: 20,
146
+ borderTopWidth: 1,
147
+ borderTopColor: '#dddfe2',
148
+ paddingHorizontal: 20,
149
+ },
150
+ resultsTitle: {
151
+ fontSize: 18,
152
+ fontWeight: '600',
153
+ paddingVertical: 15,
154
+ color: '#1c1e21',
155
+ },
156
+ scrollViewContent: {
157
+ paddingBottom: 20,
158
+ },
159
+ fileCard: {
160
+ backgroundColor: '#ffffff',
161
+ padding: 15,
162
+ borderRadius: 8,
163
+ marginBottom: 10,
164
+ shadowColor: '#000',
165
+ shadowOffset: {width: 0, height: 1},
166
+ shadowOpacity: 0.2,
167
+ shadowRadius: 1.41,
168
+ elevation: 2,
169
+ },
170
+ fileName: {
171
+ fontSize: 16,
172
+ fontWeight: 'bold',
173
+ color: '#000',
174
+ },
175
+ fileDetail: {
176
+ fontSize: 13,
177
+ color: '#555',
178
+ marginTop: 4,
179
+ },
180
+ noFilesText: {
181
+ textAlign: 'center',
182
+ color: '#888',
183
+ marginTop: 30,
184
+ fontStyle: 'italic',
185
+ },
186
+ });
187
+
188
+
189
+ export default App;
190
+ ```
191
+
192
+
193
+ ## Contributing
194
+
195
+ - [Development workflow](CONTRIBUTING.md#development-workflow)
196
+ - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
197
+ - [Code of conduct](CODE_OF_CONDUCT.md)
198
+
199
+ ## License
200
+
201
+ MIT
202
+
203
+ ---
204
+
205
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -1,40 +1,40 @@
1
- apply plugin: "com.android.library"
2
- apply plugin: "kotlin-android"
3
-
4
- def getExtOrDefault(name) {
5
- return rootProject.hasProperty(name) ? rootProject.ext[name] : project.properties[name]
6
- }
7
-
8
- android {
9
- namespace "com.myuploader"
10
-
11
- compileSdkVersion getExtOrDefault('compileSdkVersion')
12
-
13
- defaultConfig {
14
- minSdkVersion getExtOrDefault('minSdkVersion')
15
- targetSdkVersion getExtOrDefault('targetSdkVersion')
16
- }
17
-
18
- compileOptions {
19
- sourceCompatibility JavaVersion.VERSION_1_8
20
- targetCompatibility JavaVersion.VERSION_1_8
21
- }
22
-
23
- sourceSets {
24
- main {
25
- java.srcDirs = ['src/main/java']
26
- }
27
- }
28
- }
29
-
30
- repositories {
31
- mavenCentral()
32
- google()
33
- }
34
-
35
- def kotlin_version = getExtOrDefault("kotlinVersion")
36
-
37
- dependencies {
38
- implementation "com.facebook.react:react-native:+"
39
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
1
+ apply plugin: "com.android.library"
2
+ apply plugin: "kotlin-android"
3
+
4
+ def getExtOrDefault(name) {
5
+ return rootProject.hasProperty(name) ? rootProject.ext[name] : project.properties[name]
6
+ }
7
+
8
+ android {
9
+ namespace "com.myuploaderandroid"
10
+
11
+ compileSdkVersion getExtOrDefault('compileSdkVersion')
12
+
13
+ defaultConfig {
14
+ minSdkVersion getExtOrDefault('minSdkVersion')
15
+ targetSdkVersion getExtOrDefault('targetSdkVersion')
16
+ }
17
+
18
+ compileOptions {
19
+ sourceCompatibility JavaVersion.VERSION_1_8
20
+ targetCompatibility JavaVersion.VERSION_1_8
21
+ }
22
+
23
+ sourceSets {
24
+ main {
25
+ java.srcDirs = ['src/main/java']
26
+ }
27
+ }
28
+ }
29
+
30
+ repositories {
31
+ mavenCentral()
32
+ google()
33
+ }
34
+
35
+ def kotlin_version = getExtOrDefault("kotlinVersion")
36
+
37
+ dependencies {
38
+ implementation "com.facebook.react:react-native:+"
39
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
40
40
  }
@@ -1,5 +1,5 @@
1
- MyUploader_kotlinVersion=2.0.21
2
- MyUploader_minSdkVersion=24
3
- MyUploader_targetSdkVersion=34
4
- MyUploader_compileSdkVersion=35
5
- MyUploader_ndkVersion=27.1.12297006
1
+ MyUploader_kotlinVersion=2.0.21
2
+ MyUploader_minSdkVersion=24
3
+ MyUploader_targetSdkVersion=34
4
+ MyUploader_compileSdkVersion=35
5
+ MyUploader_ndkVersion=27.1.12297006
@@ -1,2 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>