Skip to content

Get the progress in iOS #10

Open
Open

Description

@saparkhid-isimorgh

Please take a look at the code below:

 using (var download = Unity.Networking.BackgroundDownload.Start(new Uri(URL), Application.persistentDataPath+"/temp/assets"))
        {
            while (download.progress <=1.0f) 
            {
                percent = download.progress * 100; 
                DownloadProgressbar.GetComponent<Progressbar>().SetValue((int)percent);
                yield return null;
            }

            yield return new WaitForSeconds(0.5f);
            

            if (download.status == Unity.Networking.BackgroundDownloadStatus.Failed)
            {
                Debug.Log(download.error);
            }
}

it does not give me the progress of my download operation. also I have used
yield return new download
but it doesn't work.

Please help with a proper documentation.
@aurimasc
@Tak
@lucasmeijer
Thanks in advance.

Activity

  1. aurimasc commented on Nov 19, 2019

    @aurimasc
    Collaborator

    Which version of iOS are you using? Progress requires iOS 11.1 or newer, otherwise it will be -1 until completion, then it will jump to 1.
    Also note, that progress is potentially expensive. At least on Android it is very expensive and should be avoided or queried at very rare intervals.

  2. saparkhid commented on Nov 23, 2019

    @saparkhid

    @aurimasc, I have used iOS 13.0 and also my download is about 180 MB. why you think its expensive?many games and apps are bundled and are downloading data from external sources.

  3. aurimasc commented on Nov 25, 2019

    @aurimasc
    Collaborator

    Querying progress is very expensive on Android. So, if you target Android or cross-platform including, you should really avoid checking progress and certainly not do it frequently.
    I'll check iOS 13, thanks for info.

  4. saparkhid commented on Nov 25, 2019

    @saparkhid

    Querying progress is very expensive on Android. So, if you target Android or cross-platform including, you should really avoid checking progress and certainly not do it frequently.
    I'll check iOS 13, thanks for info.

    Thanks for your reply. please inform me with updated code sample for iOS progress. I would not to use it on Android.
    Do you know why I'm going to use this plugin?
    When I want to download asset bundles from an URL and assets are large. in iOS when; I am pressing home button and then application goes into background, this makes the downloading of asset bundles (started with WWW class) to be stopped. (I have tested with BackgroundFectch capability but it doesn't work).

  5. MantsSk commented on Nov 28, 2019

    @MantsSk

    @saparkhid-isimorgh I'm not able to reproduce the issue. Progress is shown fine for me with iOS 13.0 with your given code sample. What Unity version + plugin version were you using?

  6. saparkhid commented on Nov 28, 2019

    @saparkhid

    @saparkhid-isimorgh I'm not able to reproduce the issue. Progress is shown fine for me with iOS 13.0 with your given code sample. What Unity version + plugin version were you using?

    Unity 2019

  7. MantsSk commented on Nov 29, 2019

    @MantsSk

    Could you provide a more specific Unity version? You can see it in Help --> About Unity
    Also, what branch, commit version of plugin you were using?

    Thank you

  8. saparkhid commented on Nov 29, 2019

    @saparkhid

    Could you provide a more specific Unity version? You can see it in Help --> About Unity
    Also, what branch, commit version of plugin you were using?

    Thank you

    Unity 2019.2.5f1

  9. borastudy commented on Jun 17, 2020

    @borastudy

    Hi, I have the same problem here! Have this problem resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions