[Android SDK] Unable to download file in one to one conversation
I'm trying to download a file received in a one to one conversation. The method isFileDescriptorAvailable returns true for the message with the file but when I get the fileDescriptor, the methods getFile and getImagePreview returns null. And when I try to download the file with RainbowSdk.instance().fileStorage().downloadFile(),
I get the following error:
01-24 17:15:13.959 25867-25867/com.ale.conversationsdemo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ale.conversationsdemo, PID: 25867
java.lang.NullPointerException: file == null
at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
at com.ale.infra.manager.fileserver.FileServerMgr.downloadFile(FileServerMgr.java:663)
at com.ale.rainbowsdk.FileStorage.downloadFile(FileStorage.java:33)
SDK version: 1.50.0
Thanks for your help
-
Hello Maxime,
Its seems that your app isn't allowed to have storage acces. You must add this permission in your manifest
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
like described in the "getting started" section of the documentation.
If your device has Android 6 or superior you also need to ask the user to accept this permission at runtime (or just for testing you can go in the parameters/application/your app/autorisations/ and activate the needed permission.Look at the official Android documentation for more information: Permissions
Please sign in to leave a comment.
Comments
1 comment