JustLogin
JustLogin

Reputation: 1886

Expo DocumentPicker MIME filter isn't working with JSON

I'm using React Native (v 0.47.2) and Expo (v20.0.0) for Android app development. I need to make a document picker whick can only select JSON files.

So, my code is:

Expo.DocumentPicker.getDocumentAsync({type: 'application/json'})

But all .json files are disabled with this MIME filter (tested on Android 7.1.1). What I'm doing wrong if everything works with type: */*?

Upvotes: 2

Views: 1152

Answers (1)

JustLogin
JustLogin

Reputation: 1886

It turns out, Android simple doesn't know JSON MIME type. The only solution is using another files extension from this list.

Upvotes: 1

Related Questions