Ask for android storage permissions

How I can ask for android permissions at runtime or starting my game? I really need it for the save system, but the ‘Use externaldir’ option (For save the game without the need of permissions, but when the game uninstalls the save get erased) don’t work for me.

When I package my project for development, the game automatically asks for permissions before starts.

When I package my project for shipping, the game doesn’t asks anything.
This is a problem because I need to warn to make users to go to the app settings, permissions and manually enable them. And I can’t translate that warning to every language in the world. This would kill my Google Play app ratings.

As you can see, I have a node in begin play, that check for android permissions. If the permissions are enabled, it prints ‘worked’ (Only in debug, obviously). If the permissions aren’t enabled, they create a warning widget.

When I go to test the game to my phone with a shipping build, THIS WORKS!!! When I open the game without storage permissions, it creates the widget. Otherwise, it doesn’t create anything.

The problem comes when the ‘Request for permissions’ blueprint doesn’t ask for permissions:

My issue is using Request Android Permissions node. If I put another node that converts an string to array, the game crashes, so this node+‘Get Character Array from String’ is ‘valid’. There isn’t any documentation online of how to use the Check and Request Android Permissions (Android Runtime Permissions plugin).

Please, help. Is one of the last things that I need to finish my first game in UE4. I don’t want to finish a game that needs savedata without access to savedata.

Any other way to request android permissions? Any way to correctly use that node?

1 Like

I do this. Works for me in Store.

Also difference between Shipping and Debug\Development may be in manifest. You may need to add your desired permissions to the manifest of your app. You may not ask for permissions which is not in the manifest as i can remember. Not sure.

Request permission accept array of strings where each index has one string of permission, what you did is you converting your single string to array of char which will not make any sense

I have same issue on my project.
The development build asks user permission for writing storage and save game feature works fine, but the shipping build doesn’t. Anyone who knows the reason and the solution?

(I checked AndroidManifest.xml in the Intermediate folder and there is the tag:

uses-permission android:name=“android.permission.WRITE_EXTERNAL_STORAGE”/

I also added “android.permission.WRITE_EXTERNAL_STORAGE” on the Extra Permission section in the Project Setting. But the issue was not solved.)

Hello, I have the same problem. Have you found a solution ?

Same problem built with 5.1 ,target 33