pedometer is not working in background mode in ios 13 only - ios13

I have an app that just counting steps in Active State and Background Mode with CoreMotion CMPedometer.
It works fine on ios 12.4.1
ios 13: steps counting doesn't work in Background Mode, but work in Active State.
I haven't any errors and in Active State I get "steps, that I went in background".
I have permission NSLocationWhenInUseUsageDescription
In fact, I do not receive a notification (print in console) that I am moving.
Please help.

I have looked into this a little bit and it turns out that the background processing logic has been updated on iOS 13. I see that my steps tracking (CMPedometer) task gets almost immediately killed when the app goes into the background.
You are most likely using application(_:performFetchWithCompletionHandler:) to track user steps and motion in the background. This is now deprecated on iOS 13 SDK and you will need to use BGAppRefreshTask to achieve the same functionality.
More details are in the Apple Documentation here.

Related

Connection to daemon was invalidated

My app is using Firebase Analytics and I believe starting in iOS 13.2 started getting the errors described here: Why I get the console warning: [Process] kill() returned unexpected error 1 when I load a WKWebView in iOS13.2?
I guess it wasn't a big deal
Since I planned for my app to go live in January, I began bigger tests in physical devices. I noticed after a while the app started to behave erratically, specially after receiving a [general] Connection to daemon was invalidated error. This doesn't occur in the simulator
Searching the internet I found a post that describes the same problem: https://forums.developer.apple.com/thread/124306
In my case, only Firebase seems to be calling WKWebView, but every time I open the UIMenuController I get the error described in the console and the app appears to be missing inputs. This is specially troublesome with UIScrollViews, which my app uses a lot. The pinch gesture seems to work at will. On an iPhone 6s, the issue isn't as noticeable, on an iPad, it's like a 50% chance the pinch gesture will work properly
Outside of removing Firebase, is there a way to mitigate this issue?
1 June 2020: The console message still persists, however, I have seemed to resolve the UIScrollView issue by deactivating delaysContentTouches, now the pinch gesture seems to work most of the time
23 October 2020 If anyone notices their app starting to behave erratically with no apparent reason I HIGHLY suggest to test it on an iOS 13 physical device if possible. Seems that Apple removed the warning from iOS 14, but testing it on iOS 13 you can pin point the exact reason after the warning appears in the console
Upon further testing, I've reduced the view down to a dead-simple UI view with a single SwiftUI TextField and the 'Connection to daemon was invalidated' still appears after I type the first character into the field. Soon thereafter the app crashes with a sigAbort. (So I don't think the reason is the UITextView wrapper I was using in the previous post). Once the invalidated message appears the app is doomed to crash, not right away but soon thereafter.
I have no idea what causes the 'invalidate' message and a Google search seems to imply that no-one else does either. Some folks appear to have made (experimental?) changes to their UI that stops the message but it appears to be impossible to determine a definite cause. (and like before it only occurs on a real phone)
Same issue without using Firebase at all. What I did: Delete build folder and compile again. Issue does not appears again.
On Xcode:
Clean the Build Folder
This will delete all of the products and intermediate files in the build folder. To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder.
On Flutter:
Just delete build folder.

Is there a way to show firebase notifications in the foreground on android and ios using ionic?

I solved this problem in android studio by creating my custom notification handler and just inputing the data firebase sends. But I can't seem to find a way/guide/tutorial to do so with ionic.
Is there a way to do that or do is it only possible to show notifications when app in background?
I've tried every guide I found online but most of them just do nothing or the notification is just showed when app in background.
Thanks
Update: 23 July 2019
The reworked implementation has been released as cordova-plugin-firebasex#6.0.0.
See the documentation for more info: https://github.com/dpa99c/cordova-plugin-firebase
Original answer
This is something I'm working on in cordova-plugin-firebasex (my fork of cordova-plugin-firebase).
Currently it's a work in progress (first draft implementation done for Android on the dev branch) and I'm working on the iOS implementation.
You can test it out using the dev branch of my test harness project.
Hoping to have a releasable version in the next week or so.

Failures in "Pre-Launch report" in Google Play Developer Console in Google VR startup

I've been working on a game using Google VR in Unity3d and I recently updated my version of unity3d and the (built in) Google VR SDK to the latest version. After doing so the pre-launch report (automated testing on firebase) is showing crashes, during the unity splash screen, on 5 out of 6 devices.
This is the issue that is reported:
Issue: Crash of app uk.co.softkitty.puzzleroom running instrumentation ComponentInfo{com.google.android.apps.mtaas.crawler/android.support.test.runner.AndroidJUnitRunner}
Not very helpful, it looks like a generic unit test result if the app closes unexpectedly . I've looked through the logs and cant find anything unusual from my app or unity, but I did find something. It looks to me like this may be being caused by the test script itself:
10-27 01:54:54.494: I/ViewInteraction(19677): Performing 'single click' action on view (with class name: is "android.widget.ImageButton" and with id: uk.co.softkitty.puzzleroom:id/ui_back_button ...............
This to me, looks like the test runner is exploring the app UI and the first thing it does is click the "back" button. Which I would expect to close the app. I also tried using Firebase directly, which seemed to confirm it:
Firebase Activity Map
Does that seem likely that this is just a bug/red herring caused by changes to unity/GVR Or even firebase? Has anyone else experienced this?
I just don't want to release it if it really is crashing on so many devices!
Many Thanks
I asked Google Play Support about this and they got back to me.
They have confirmed that the issue is caused by a new crawler used by the Pre-Launch report. Details can be found here under the section "Pre-launch report versions"
They've escalated the issue and have also provided a workaround:
Sign in to your Play Console.
Select an app.
Select Release management > Pre-launch report > Settings.
In the “Pre-launch report version” section, move the Opt-out switch
to the right until it turns blue.
I haven't verified this yet but will mark as answer once I have.
Edit
I have tested this and all the tests pass again so this looks like a good solution for now.
We got this when uploading our APK as well. It started October 27th and crashed the following 4 days until we changed our setup. I couldn't see anything in our code base that should trigger this problem, so I wonder if it's related to changes on Google's side.
However, we did just did two changes and now everything's working again.
We added the following line to proguard-project.txt:
-keep class android.arch.** { *; }
I assume this was what fixed it.
At the same time we changed the compileSdkVersion and targetSdkVersion to 27 (and correspondingly all belonging support libs). For all I know they could have fixed it here too..
Edit:
To more directly answer your question: Yes, it does seem likely that this is just a bug/red herring, not on Unity's side, but in Firebase Test Lab or in Google's support lib. I tested the APK that failed the pre-launch tests and it worked just fine on my device.

Apple Watch App "extension continues to load"

I've had an Apple Watch App hosted in an iOS App rejected for:
"We discovered one or more bugs in your app when reviewed on Apple Watch.
Specifically we found the watch extension continues to load indefinitely on launch."
In the simulator and on the watch itself (iOS 9, WatchOS 2, xCode 7.01)
None of the visible routines are repeatedly called, and I can't find a starting point to debug this.
The watch app has no notifications, no glance interface, and has a single story on the storyboard. It does contain a WKInterfaceTimer which I "stop" and "start" on activate and deactivate, but of course the underlying timer is not stopped or started. I don't even know what they are seeing that causes this report. So tough to debug. Any ideas?
That's WatchOS bug. See related discussion on ADF.

iOS Simulator keeps asking for an app to simulate

I only use the iOS simulator for testing websites, not actual apps. Today I opened it up and it keeps asking me for an app for it to simulate. If I click cancel, it just quits the simulator.
I've tried deleting preference files, but I'm just not familiar enough with the simulator to know what's going on. How can I just get this back to normal, or satisfy this dialog?
I think you could try the menu
iOS Simulator -> Reset Content and Settings...
This would clean your simulator storage.
Update
According to this link, Cleaning up the iPhone simulator
move to path
/Users/<username>/Library/Application Support/iPhone Simulator/{6.0 / 6.1}
You could try to clean it manually

Resources