Google Play OBB Downloader (499288)

Hi!

Anyone knows why the Google Play Downloader package has gone from Asset Store?

Thanks!

I’m also trying to track this down. I had this working in my project for months, and then all of a sudden my ooh files stopped downloading. I wanted to re-download the package and see if i had accidentally changed something, but I can’t find it anywhere. Is the package still the way to do this or is there a better way now?

Bump… anyone can confirm this plugin working with latest unity? or 4.3.4

For two weeks I was fighting this problem.

My solution was to use a different browser to upload the obb.
With Safari I had the problem that no obb file was found.
The upload with Firefox works for me.

You don’t need to use the Google OBB Downloader-Asset.
Split your app in unity3d.
If your first scene is small enough, just upload the apk and the obb.
Otherwise create an empty scene and put it in first position in build settings. In this scene you only have to load the next scene.

When installing your app with Google Play your apk file and the matching obb file will be automatically downloaded and installed.

Been looking all over the internet for this, its crazy how it does not auto delete old obbs, my players must have about 8 now (all around 60mb each) ah well, at least i found out and can now fix it! :slight_smile:
Thank you for being the only post within my 30mins search that had a solution!

This is helpful, however it does not work in my case. I don’t know about other platforms but on Android, the old obb file names aren’t necessarily named in the same format. On my devices, some are named with temp.something.packagename.

If you are using GoogleDownloader like me, you can get the version number from the plugin easily by changing the private static int to public at GoogleDownloaderImpl.cs to grab the ObbVersion at m_ObbVersion.

Here’s my code to delete all old OBBs for anyone else looking. There’s not a lot of examples on the web.

void DeleteOldOBB()
    {
        m_obbDownloader = GooglePlayObbDownloadManager.GetGooglePlayObbDownloader();
        m_obbDownloader.PublicKey =  // YOUR PUBLIC KEY HERE
   
        string expPath = m_obbDownloader.GetExpansionFilePath();
        var mainPath = m_obbDownloader.GetMainOBBPath();
 
        int obbVersion = GooglePlayObbDownloader.ObbVersion;
 
        if(expPath != null)
        {
            DirectoryInfo dir = new DirectoryInfo(expPath);
            FileInfo[] info = dir.GetFiles("*.*");
       
            // The file exists -> run event
            foreach (FileInfo f in info)
            {
                if (f.Name == "main." + obbVersion + <package_name> + ".obb") //YOUR PACKAGE NAME HERE
                {
                    //Don't do anything
                    Debug.Log("Keep this " + f.Name);
                }
                else
                {
                    // There are other files in this folder, delete them
                    File.Delete(expPath + "/" + f.Name);
 
//To make sure it is deleted on android
#if UNITY_ANDROID
                    using (AndroidJavaClass jcUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
                    using (AndroidJavaObject joActivity = jcUnityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
                    using (AndroidJavaObject joContext = joActivity.Call<AndroidJavaObject>("getApplicationContext"))
                    using (AndroidJavaClass jcMediaScannerConnection = new AndroidJavaClass("android.media.MediaScannerConnection"))
                    using (AndroidJavaClass jcEnvironment = new AndroidJavaClass("android.os.Environment"))
                    using (AndroidJavaObject joExDir = jcEnvironment.CallStatic<AndroidJavaObject>("getExternalStorageDirectory"))
                    {
                        jcMediaScannerConnection.CallStatic("scanFile", joContext, new string[] { expPath + "/" + f.Name }, null, null);
                    }
#endif
                }
            }
        }
    }

so this way we don’t need to care about the obb file was exist ?