Firebase issue - no response from Realtime database on iPod with iOS 8.3 - swift

I'm developing an iOS app written in Swift 3.0 using Xcode 8.2, which supports iOS 8.0 and higher. App's data is stored in Firebase.
I want to listen to database connection changes (app is connected to Firebase or not).
I'm using FIRDatabaseReference's function:
func observe(_ eventType: FIRDataEventType, with block: #escaping (FIRDataSnapshot) -> Swift.Void, withCancel cancelBlock: ((Error) -> Swift.Void)? = nil) -> UInt
to observe changes, but this event always returns false (value of 0). At this time (on Firebase Console), Authentication section related queries are working properly, and Realtime Database related queries are not.
This happens only on iPod 5.1 (5) with iOS 8.3.
I've tested my application on
iPad 2 with iOS 8.4.1
iPod 5.1 (5) with iOS 9.3.5
iPhone 6 with iOS 10.0.1
too. But on these devices it worked well.
Am I doing something wrong? Is there any issue related to iOS version and Firebase SDK?
Thank you!

SOLVED
I left this issue a little bit behind, and after some time, it reappeared on another device.
I'm not sure, if this solves every similar problem, but I figured out, that my token was expired and I get NO response from database. Which problem was caused by a password change of the same user on another device.
Day 1 - I was logged in with an account on two different devices. I changed my password on one of them.
Day 2 - I tried to download some data from Realtime Database section with the other device, but I get NO response, which was really annoying.
After 8 hours Firebase Analytics logs on Xcode console finally helped me figure out the problem. I logged out from the problematic device, and then logged in again.
I was wondering why couldn't I get some kind of 'token_expired'-response from the server, or maybe why couldn't I get logged out from the other devices.

Related

Session sharing is not enabled | Swift

I am currently trying to show Routes in my app, but I get [UserSession] maps short session requested but session sharing is not enabled in the console.
I separated the MapView and calculation of the route in different structs / classes, so that might be the reason. I never heard of the UserSession
[UserSession] maps short session requested but session sharing is not enabled
I have seen people online say this is a bug in iOS 15 / Xcode but I have not found any solution or explanation for what this error means.
Please note that I am also receiving the same error with Mac OSX BigSur and XCode 13.2, so I performed a test with a VM running Mac OSX Catalina:
https://github.com/myspaghetti/macos-virtualbox
Then I downloaded, installed and ran XCode 12.4,
https://xcodereleases.com/
When I built a MapKit / CoreLocation application (see https://www.youtube.com/watch?v=YtYEGsi2HB4), it ran fine on OSX Catalina but I got the same error as above on BigSur. Hopefully, Apple will fix this issue soon with an update.
UPDATE:
It appears that Apple is deprecating their Apple Maps with their Main.storyboard designer because I have a colleague who used Apple Maps without a problem but that was using SwiftUI which has no UI designer--instead everything is specified in code for the UI.

Xcode Version 11.5 CloudKit not working on simulator

before the last update, I was able to manage data with CloudKit on simulator, with the last updating, it's not working, also if I add a file in iCloud Drive, in simulator the folder is not updated.
in my func, I receive couldNotComplete status:
defaultContainer.requestApplicationPermission(.userDiscoverability, completionHandler: {status, error in
switch status {
case .denied:
DispatchQueue.main.async {//necessario perchè lo fa in background e potrebbe crashare senza questo
completionHandler(status)
self.showSettingsAlert()
}
case .initialState:
DispatchQueue.main.async {
completionHandler(status)
self.showSettingsAlert()
}
case .couldNotComplete:
DispatchQueue.main.async {
completionHandler(status)
self.showSettingsAlert()
}
print("#couldNotComplete requestApplicationPermission (func getUserPermission) - probabilmente non ha un account icloud")
case .granted:
completionHandler(status)
#unknown default:
print("#unknown requestApplicationPermission (func getUserPermission)")
}
})
but the problem is in the token:
Optional("Couldn\'t get an authentication token")
Do you have the same problem?
Sorry that I can't help with an answer, but I can say that it isn't just you; this started happening to me too. Some things I know:
Everything works initially, and then at some point I'm asked to re-enter my iCloud password ("Apple ID Verification").
The simulator accepts the password, but past that point CloudKit (and more) stop working.
Here's the error CloudKit returns: Optional(<CKError 0x600002b08b10: "Not Authenticated" (9/2011); "Couldn't get an authentication token">)
I tried using "Features | Trigger iCloud Sync" to see if that would kick iCloud into working, but it didn't.
Signing out on the iPhone simulators never seems to end; so far I've always had to use "Erase All Content and Settings". After that things work again, but not for long.
Signing out on an iPad simulator worked once. After signing back in, everything started working again. Well, so far. :-)
I'm using a test account. I wondered if Apple thought it was a spam account, so I logged into https://appleid.apple.com with it and turned on two-factor authentication, etc. None of that made a difference.
Here are some things I'm planning to try, roughly in order:
new simulator using iOS 13.4 (I'm currently using 13.5)
new test account
Xcode 12 beta
===
So far I've tried:
New simulator using iOS 13.4
Xcode 12 beta
Rebooting my Mac
Ultimately, none of those things have worked; once I start getting the "Couldn't get an authentication token" error--and I typically get it within 24 hours--the only thing that makes the simulator work again is erasing it.
One thing I'm not sure of is whether, once a simulator is in that state, anything can recover it. For example, when I first launched the Xcode 12 beta, and first ran the simulator, it immediately asked for the password. Did the beta start from an already corrupted simulator? More to the point, would Xcode 12 beta corrupt a simulator on its own, or was it just picking up on an error that was actually created by Xcode 11.5? I don't know.
I'll try a few more things...
===
Creating a new test account didn't work, but I may have found something that does: resetting the keychain. Here's how to do it from the command-line:
xcrun simctl keychain reset <device>
After running that command the simulator once again asks for the iCloud password, but the password now produces the expected result: iCloud starts working again.
(If your app was running when you reset the keychain you'll probably have to restart it, or somehow otherwise give it a kick so that it notices the change.)
Simone Pistecchia's comment helped me the most. In the simulator menus select Device > Erase All Content and Settings for each simulator that is having the problem. Then resign into iCloud.

App crashing suddenly on launch - iPhone enterprise version

I have enterprise version installed on few of the devices.
On one of the device app is crashing immediate after the launch button click every time.
It is working on other device without crash. Can any one help me on the issue that why it is crashing ?
**edit:
We seems it certificate expiration issue. But if certificate is expired then it also should not work when I install it in new device.
Here are few steps will help you to find / detect / resolve your issue :
If its live version which you are testing than check out crash logs.
To check crash logs open Xcode -> window -> Organiser -> Select your app -> Crashes -> Select current version. You will find the crash
open it in Xcode it will help you to find the line which generating
crash
If its not live app than try to debug app on same device using debug ad hoc provisioning
Another way is you can also use crashlytics tool into your app. It will give you detailed information of the crash along with the
possible code which encouraging the crash
Possible reasons for crash :
Architecture support. Might be crash issue generated only on base 64 devices than check out your app is base 64 supported or not
Use of Depreciated methods can also cause the crash
iOS Compatibility issue can also be a reason of crash
Most important reason is if your app trying to access privacy information without permission alert than also it will get crashed at
very beginning of app launch
Hope it will help you.
We figured out this but posting bit late.
Few data systems and validation not matched in case of the Date Time system used. Date Time formats are different according to user and devices. Few systems have date formate as a month in the first 3 characters longer than the year(e.g. 1 Aug 2020). (from the same region devices, the date time format could be different). so this validation is very critical and needs to consider and all test cases. This was the issue we were facing as in the start we were opening the calendar and fetching the events accordingly.
Also displaying data on threads and managing threads are also more important in this kind of case. Memory leaks and appropriate GCD usage may also lead to this situation.
Thanks

Is there anywhere else to see my app's crashes other than Xcode?

In the project organizer, one project I'm working on hasn't shown any crashes since I updated to Xcode 9. All of the previously shown crashes disappeared too. I have Fabric in the app, but I'm testing mostly on Apple Watch and Fabric doesn't support watch crashes. I submitted the bug to Apple's Bug Reporter several weeks ago but haven't received a response. Is there anywhere or any way else I can get crash reports, specifically for WatchKit?
Thank you!
You could try on your phone going to Settings -> Privacy -> Analytics -> Analytics Data. Scroll through the Data and look for crashes related to your application.

server did not accept client registration 68

I have an app currently deployed on the app store. Just a few days ago, it stopped working all of a sudden. I am receiving the following error within xcode when testing my application.
server did not accept client registration 68
I am using xcode 4.1. I have read about this error online and seen the workarounds. My issue is that my application was running fine. No issues whatsoever. It literally just ceased to load data all of a sudden a few days ago. No updates were pushed, no code was modified. How is it possible for it to jus stop working all of a sudden? Could it be an update with Apple?
There is not enough info to go on in your question, but by doing a search on the error message, it might be related to CoreLocation.
Has your App for whatever reason be set to not use location services (within the Settings app), real device or simulator? If so, see this SO on how to handle it nicely in code using didFailWithError