How can I find the total disk size of the device my app is running on?

118 views Asked by At

I want to know what is the total disk size of the device my app is running on. For example, I want to find whether it is an iphone6 16gb or 32gb.

In SystemInfo, there is a property systemMemorySize. But that returns the amount of RAM. I want to find the hard disk size. How to do that?

Thanks.

1

There are 1 answers

4
Programmer On BEST ANSWER

The DriveInfo class is used to do something like on Windows or Desktop computers. Not sure if that will work on iOS since it uses the GetDrives() function to get disk size. The real solution is to make a native plugin with Objective-C.

Luckily, there is a free plugin for this called Simple Disk Utils on the Asset store. You can also get its source code from here.

Available functions:

int CheckAvailableSpace(); 
int CheckBusySpace();
int CheckTotalSpace(); //<--- You need this