Comments (8)
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.
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.
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.
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.
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.
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.
@AlexBrownShi were you ever able to figure out a solution to your problem? Or do you still need help?
from ios-samples.
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)
- XamarinFormsAppleSignIn for iOS HOT 2
- Tracking Objects Example - camera setup and coordinate system issues HOT 2
- Vision Faces sample can't stop at breakpoint HOT 2
- DidWriteData not being Called HOT 2
- A
- Can someone help me convert an IOS code to C#? HOT 1
- ConvertedFrogScroller - pinch to zoom does not work with small images HOT 2
- Map
- intro-to-extensions not working. HOT 1
- Doubts about the use class WCSessionManager HOT 4
- Request: Sample with MFMailComposeViewController HOT 2
- Profiling.MemoryDemo not showing any useful stacktrace with Instruments 13.0 HOT 2
- ios13/UsingCollectionViewCompositionalLayoutsAndDiffableDataSources ImageView not Rendering HOT 1
- ARKit / iOS - App crashes in release mode using SceneView.Snapshot() HOT 5
- iOSTenThree sample don't work well on iPad HOT 2
- Please Update CoreLocation to the latest iOS HOT 1
- def fibonacci(n) return n if ( 0..1 ).include? n (fibonacci(n - 1) + fibonacci(n - 2)) #recursive calls end
- if image dont exist HOT 2
- MonkeyNotify sample not working. HOT 3
- AirLocate crashes on startup HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ios-samples.