We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 52a2645 + 9c4cee6 commit 096bb8eCopy full SHA for 096bb8e
src/services/storage.ts
@@ -3,7 +3,7 @@ import { AppwriteException, Client } from '../client';
3
import type { Models } from '../models';
4
import type { UploadProgress, Payload } from '../client';
5
import * as FileSystem from 'expo-file-system';
6
-import * as Device from 'expo-device'
+import { Platform } from 'react-native';
7
8
export class Storage extends Service {
9
@@ -141,7 +141,7 @@ export class Storage extends Service {
141
length: Service.CHUNK_SIZE
142
});
143
var path = `data:${file.type};base64,${chunk}`;
144
- if (Device.osName == 'Android') {
+ if (Platform.os.toLowerCase() == 'android') {
145
path = FileSystem.cacheDirectory + '/tmp_chunk';
146
await FileSystem.writeAsStringAsync(path, chunk, {encoding: FileSystem.EncodingType.Base64});
147
}
0 commit comments