Background
I have an iOS app which scans for BLE devices in the Background. It worked well until I updated to iOS12. This is what I have:
App is configured to run in Background (e.g. location & bluetooth-central keys in .plist)
App is supposed to run continuously in Background, scanning for Peripherals. This is not to be confused with Background Fetch, which is a different use case.
App does not connect to Peripherals. It only reads the advertisement packets.
App gets suspended after running for a few hours in the Background.
App resumes normal operation when brought to the Foreground
App operated properly in iOS 11. Problems started after updating to iOS 12.x
I placed log messages in the App Delegate methods. This last thing I see is the app entering Background State. I never see a call to applicationWillTerminate(), as it is only called when the app is in the Foreground.
I have seen other posts (e.g. iOS 12 terminates apps in the background for no reason) for similar behavior with the Location stack. Using the test app written by the author of the post, I verified the problem has been fixed in iOS 12 for Location Services. But the BLE problems persist.
Has anyone found a workaround for this problem?
thanks in advance.
Related
Im running server on hololens, and i created a PC app that works as a client.
Via client i can drag, rescale, rotate etc. holograms created in unity.
The holograms have some function that starts when user makes an air tap gesture on them.
I want to be able to start those functions in my pc app.
The easiest way to do it is just to send an info from app to hololens to do certain thing but...
I want to run those functions specificly as if the air tap gesture happened.
To do so i need to simulate an air tap gesture.
I want to send the coordinates from pc app to hololens, and i want my scene to behave like there was an actual air tap gesture executed without executing that gesture in real life.
Similiar thing can be done on PC version of Windows10 and its described for example here
https://superuser.com/questions/159618/simulating-mouse-clicks-at-specific-screen-coordinates.
There is my question to you.
Is it possible to simulate gestures? I would realy appretiate any info you can share with me.
Thanks.
If you are using the standard MRTK Gaze stuff to handle your gestures, you could define a new IInputSource.
The example for adding Gamepad input could be a good starting point - instead of triggering an air tap when a gamepad button is pressed, trigger it in response to remote calls from your PC app.
The benefit of this is that it's in keeping with the existing input system - your code which acts on input doesn't need to know that it came from a gamepad, a hand, or your desktop app.
I'm using a barcode scanner (LS2208 OPOS mode) in an application and every time I close it the scanner is disabled. It starts to work again when I reopen the app.
In my app there is no call to disabled it, so why is this happening? Is this normal ?
The same thing happens with the sample app in the POS for .NET SDK
That is normal behavior.
Calls such as Close or Release method(Release is exclusive device only), or application termination or abort, will disable the OPOS/POS for.NET device.
However, termination or abort of the application may not be disable depending on timing.
It is considered a bug in either OPOS/POS for.NET/application.
I am working on push notification in my Windows Phone App and I am having this issues.
From time to time the BackgroundTask which is responsible for push notification handling isn't wake up I know it- cause I've spread logs after each code line in my Task.
I know for sure that my token is valid and I am getting the notifications from the server.
This happens only when debugger is not attached.
I don't see any exception either in my log.
I can see in my logs, that one line before I am showing the Toast is cut at the end in a middle of writing (guess the task was terminated suddenly?)
Any ideas what can cause this behavior?
I think that the main problem was that I tried to use too many of CPU time , while writing logs and using my heavy application services (MvvmCross) such as Sqlite.
After removing logs, and heavy consuming time operations - everything worked :)
I have a watchOS 2 app that displays health data during a run. I start a workout using HKWorkoutSession as follows:
self.workoutSession = HKWorkoutSession(activityType: .Running, locationType: .Outdoor)
self.workoutSession!.delegate = self;
self.healthStore.startWorkoutSession(self.workoutSession!)
This keeps my app in the foreground when the screen shuts off for a while and the user looks at it again later.
Now lets say during the workout the user switches to a different app OR the watch screen locks (due to the watch not being secured tight enough) and then the user re-launches my running app by double clicking the digital crown. The app resumes where it left off and continues to get health data as expected, but my app won't stay in the foreground anymore. The workout is still in progress because on the watch face I can still see the workout icon at the top, and the heart rate monitor continues to collect heart rate data, but the app refuses to stay in the foreground.
Does anyone have any idea on how to have a workout app resume to the foreground during a workout even if the screen locks or a user switches to a different app?
I contacted Apple using one of my 2 yearly technical support requests. According to the representative I talked to, he believes this is a bug in watchOS. I had submitted this as a bug report way back in October, but the ticket has gotten no response so I thought I was perhaps missing something. I guess we are stuck with how this works for the time being.
I have an application that should run continuously even after the user presses the back button.
It has to send some data using POST method to my database in a remote server for every half an hour. This should happen even after the user has pressed the back button and the app should only stop when the mobile is switched off.
While I have set up the HTTP Adapter to send POST data and also an HTML file to call the adapter procedures on launch, I dont know how to make it background or which code to run to keep sending the POST data every half an hour.
It sounds like you are running on Android.
The expected behavior in Android is that pressing the Back button QUITS the application.
Moving to the background is performed by pressing the Home button.
So, I don't think you should do this when pressing the Back button... or maybe you should at least present the user the choice of either quitting or moving to the background (you can override the Back button by using WL.App.overrideBackButton).
That said, I am not familiar with a programmatic method to move to the background instead of quitting (maybe there is an existing Cordova plug-in or another way that does this).
The other way to accomplish this is by using an Android Background Service, however, Worklight does not have support in its Native API to do this.
As for what happens when the Worklight application is in the background, I have never tried it myself, so I cannot be certain at all, but try using WL.Client.setHeartBeatInterval to keep alive the connection to the Worklight Server and write some logic that sends the adapter requests. See if that would work for you...
I have found this:
How to create plugin in phonegap to run the application in background?
Maybe you'll be able to massage it into your Worklight project (in case the heartbeat approach above does not work).
More information on running in the background:
Android:
http://developer.android.com/training/basics/activity-lifecycle/index.html
http://developer.android.com/reference/android/app/Activity.html
iOS:
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html
Override the Back button by using WL.App.overrideBackButton.,
remove the exit function in that method and leave it blank (if you want the background process not to exit when clicked)