Stop Firebase downloading task returned by GetFileAsync in Unity3D - unity3d

I met a case when I need to stop already started downloading task using GetFileAsync method. Unfortunately I didn't find any info about it and how to implement it in Unity3D (c#).
I know there is a way to stop thread, but don't see the way to find thread by that task.
The idea is to stop downloading in some cases, for example if user change the scene and downloading content is not actual anymore.
Please, advice, is there a solution to implement it?

Given that the download methods all return a C# Task, which doesn't contain a pause or similar method, I don't think there's a way to do this at present.

Related

reuse result of initialize method from video_player flutter package

Is there option to reuse result of initialize method for video_player package? It takes time for complete - it would be great to cache it (eg. memory level) and reuse it when you back to before used video - and simple use cached data instead of wait for initialize result. I need it for intensive switching between videos.
There is a package called cached_video_player which may help resolve your problem. Check it out here.
I think you are asking about having the screen/page/widget pre-render. That is not currently supported by flutter according to this issue filed on github:
https://github.com/flutter/uxr/issues/6#issuecomment-881918751
Sure, but this is not very scalable and will quickly turn into a mess. It's much simpler and more flexible to just give MyRoute someway it can cache the next route, and then show that cached route when it needs. But flutter doesn't support this as everything needs to be 'on-stage' before it can be initialized. In AIR, or Unity, I could simply construct my new page, and it would begin loading data, I could then toss it on stage whenever I want.
PS. You probably already know you can pre-cache the video data/file itself.

Run background task in Android using MVVM pattern

I working on android app using MVVM pattern. I need to perform some background math calculations in my ViewModel class. This task will read some data from file A and then save results in few other files. And return an Int result when it's done to the MainActivity. My question is how can I achieve this? Searched a lot in the internet but with no success. Any help will be appreciated. Thanks!
A background task in Android means that you want that task to execute when the application is in the foreground/background state. It also means that the task will be executed if the device has been rebooted, or the application has been closed/minimized. Work Manager class is perfect for such a purpose.

Newsstand Download Queue Management

Can u please let me knw what is the status of the NKIssue when it is added in the queue waiting for download to start??
Out of these 3 :
NKIssueContentStatusAvailable
NKIssueContentStatusDownloading
NKIssueContentStatusNone.
I'm getting NKIssueContentStatusDownloading Status even for the queued Issues.
The Apple documentation says the following in the overview of the NewsstandKit object NKLibrary:
The downloadingAssets array holds any downloading assets for any issues. (A downloading asset is represented by a NKAssetDownload object.) A newsstand content application should, when it launches, iterate through this array and call downloadWithDelegate: on each item to have the downloaded assets completely processed.
I am using deductive reasoning to assume that once a NKIssue has had it's downloadWithDelegate: method called it keeps the status NKIssueContentStatusDownloading until it has been removed from the NKLibrary or downloaded.
Also, if a download has been interrupted and needs to be resumed, you would loop through all the NKIssues in NKLibrary's downloadingAssets property to re-call it's downloadWithDelegate to resume it. However, who knows when the downloadingAssets is cleared or reset. I don't even know where we would find that out.
That's the best answer I could find.

Auto Redial using iphone app

Two questions actually.
First : I know iPhone is missing auto-redialing functionality but is there any other way to achieve it by iPhone application, as I can call by my application but facing problem cannot auto redial.
Second : Before calling I want to implement functionality of loud-speaker on a button action.
Is there any way to achieve the above 2 functionalities?
I spent 4-5 hours on googgling about it and the result is only this
I go through to apples doc and found some code hereand also tried this but cant get the right way to implement above functions ...
Any help would be greatly appreciated!
Thanks!!!
Neither of those actions are possible with the SDK.
For the Second case it's definitely NO.
But for the First case, I have no sure about this, but can be tried:
Subscribe with the CTCallCenter for call states notifications and use some background application type (voip, location or audio) or use some waiting block, that will allow to prevent going to suspended state as long as possible
Open URL using tel://
If the call notification about call failure comes in, try to repeat opening an URL
Once again, just an idea, may not work at all :/

ZEND plugin running twice. Why or how to simulate it?

Im hours and hours finding why one of my ZEND plugin sometimes running twice (depends on URL)
Note that my plugin has preDispatch and postDispatch methods and when I debugging the code it works like this:
MY_Plugin:preDispatch (echo $_SESSION['DBG'] has value)
MY_Plugin:postDispatch (unset($_SESSION['DBG']))
and then again
MY_Plugin:preDispatch (echo $_SESSION['DBG'] not exist)
MY_Plugin:postDispatch
This is part of bootstrap code
$_SESSION['DBG'] = 'value';
$MYrouter = new MY_Router_MyRouter();
$frontController->setRouter($MYrouter);
$frontController->registerPlugin(new MY_Plugin());
Do you have any suggestion how this could occur or how can I simulate this.
Thanks for any suggestion
Cervenak
Thanks guys for lot of valuable hints.
Now watch my story :)
First I had turned off showing exceptions (parameter False). So I switch them ON to see exception notification.
$frontController->throwExceptions(true);
Than I saw that I dont have uploaded controller and view files. After uploading them ZEND started to work corectly.
Good to know to have this direction set ON during debugging. You could probably save hours.
The dispatcher loop most likely running twice (the controller is dispatched twice). Possible causes:
using action view helper
calling _forward
redirector action helper
manually calling dispatch()
dispatch loop aborted and started again (eg. resetting request params)
Also, take a look at this ZF flow diagram (hotlinked from php-professionals.com)
Another reason could be an missing favicon.ico :-)
If the Apache cant find it, it fires a second request.