GithubHelp home page GithubHelp logo

Comments (8)

rzaitov avatar rzaitov commented on July 25, 2024

I think you are interested in SimpleBackgroundTransfer sample:
https://github.com/xamarin/monotouch-samples/tree/master/SimpleBackgroundTransfer

Here the prof that iOS takes snapshot after completionHandler invocation. Paste the following code
InvokeOnMainThread (() => {
var v = new UIView ();
v.BackgroundColor = UIColor.Red;
v.Frame = new CoreGraphics.CGRect (0, 0, 100, 100);
appDelegate.Window.AddSubview (v);
v.Center = appDelegate.Window.Center;
});

just before the handler invocation:
https://github.com/xamarin/monotouch-samples/blob/bd9cefdd3e6eb028b65ab0be2a47ac6268e9e569/SimpleBackgroundTransfer/SimpleBackgroundTransfer/SimpleBackgroundTransferViewController.cs#L151

This will put red rectangle to window's hierarchy, then iOS will take snapshot, so you should be able to see red square in app switcher. Steps to reproduce:

  • paste code before handler();
  • run app
  • press "Start"
  • press Home button and wait
  • go to app switcher

from ios-samples.

AlexBrownShi avatar AlexBrownShi commented on July 25, 2024

Well, that is how I was doing it originally and it works great. But it appears AirWatch app wrapping does not support creating your own NSURLSession with configuration (you must use SharedSession) so, I am now back to using the ModernHttpClient for the upload and using this older method of running a background task as in the BackgroundExecution example (which seems to work with airwatch). One of the downsides is that it doesn't seem to give me a snapshot of the app when the task completes.

Any ideas?

I suppose if I could modify or re-initialize the SharedSession to make it run with backgrounding delegate, that might solve my problem as well.

from ios-samples.

rzaitov avatar rzaitov commented on July 25, 2024

I am afraid that these are the only possible ways:
http://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/

from ios-samples.

AlexBrownShi avatar AlexBrownShi commented on July 25, 2024

What do you mean? Are you saying that the BackgroundExecution example method is no longer supported by Xamarin/iOS (I noticed the documentation was taken down off the site recently) or that it just doesn't update the app screen snapshot when completed?

from ios-samples.

rzaitov avatar rzaitov commented on July 25, 2024

Just to clarify we support all samples in this repo.
Looks like I wasn't clear in my previous comment, let me explain. As I understand you want to update UI while app in the background mode. The possible solutions are explained here:
http://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/

And I am afraid that there is no other way to update your UI while your app is working in background mode. But I am not 100% sure.

from ios-samples.

AlexBrownShi avatar AlexBrownShi commented on July 25, 2024

The method of background execution outlined in the BackgroundExecution example is no longer documented on this page - it used to be as recent as a couple of months ago. The code still works - but doesn't update that UI snapshot. I mean updates to the UI still seem to execute, they just don't update the screenshot and are visible only when you switch back to the app.

Does that make sense? I want to make sure you understand the problem, but it sounds like you are saying that it is just not supported in that situation.

from ios-samples.

rolfbjarne avatar rolfbjarne commented on July 25, 2024

@AlexBrownShi were you ever able to figure out a solution to your problem? Or do you still need help?

from ios-samples.

spouliot avatar spouliot commented on July 25, 2024

We have not received the requested information. If you are still experiencing this issue please provide all the requested information then click the Reopen Issue button.

Thanks!

from ios-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.