Logging Additional Information for Error Reporting - ios

In our error logging, we are using Crashlytics.
Now there are 2 ways that we log errors:
The automatic logging (when the app has crashed) done when the app starts up again.
Immediate logging using the Swift SDK
In case 1. it seems that there is no way of logging additional information.
However, in case 2. we use the following call :
Crashlytics.sharedInstance().recordError(error, withAdditionalUserInfo:additionalInfo)
With additionalInfo being a simple set of KVP's ["ListingNumber": "abcAsEasyAs123"]
However, this does not show up on the portal as well as in the .txt download that they offer.
We then amended our logging method to try and attach the additional info to the error itself.
if let error = error {
let newError = NSError(domain: (error as NSError).domain, code: (error as NSError).code, userInfo: ["ListingNumber": "abcAsEasyAs123"])
Crashlytics.sharedInstance().recordError(newError)
}
However, even in this case, the additional info is nowhere to be found.
According to the documentation, this should be possible, but nothing I am doing is showing.
EDIT: This is not a duplicate of that question as I have read it and referenced the same material that the accepted answer used.

Related

SwiftUI Firebase Auth Error "Paths must not contain // in them"

In my SwiftUI app I suddenly started getting this error once my user logs in (I use Firebase Phone Auth)". It happens right as soon as I do this:
let db = Firestore.firestore()
db.collection("user").document(user.UID)
.getDocument { document, err in
This is the error, the app crashes totally:
Invalid path (com.googleusercontent.apps.178114301509-gvnp7pp9tm6jq9s4rridgoae9glog8nj://firebaseauth/link?deep_link_id=https%3A%2F%2Fgigas-4f2dd.firebaseapp.com%2F__%2Fauth%2Fcallback%3FauthType%3DverifyApp%26recaptchaToken%3DTOKEN%26eventId%3Dmwkcoldfan). Paths must not contain // in them."
I tried reverting back my project with Github but I cannot find whatever happened that started all this. I don't even know what Path is the debugger talking about. I have seen people in other cases saying that maybe it is the id being empty so a / and another / collapse into a // making it causing such an error but it is not my case since I am sure the id is not empty.

Error initialize AZSCloudStorageAccount Swift 3

I tried link to my account with this code
let storageAccount : AZSCloudStorageAccount;
try! storageAccount = AZSCloudStorageAccount(fromConnectionString: config.getAzureConnection())
let blobClient = storageAccount.getBlobClient()
var container : AZSCloudBlobContainer = (blobClient?.containerReference(fromName: config.getContainer()))!
the "config.getAzureConnection()" contains the right path because i used the same for android app.
In this line try! storageAccount = AZSCloudStorageAccount(fromConnectionString: config.getAzureConnection()) the app crash without error, only (lldb) .
Can someone help me.
Does your error look like this?
fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.Microsoft.AzureStorage.ErrorDomain Code=1 "(null)": file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-802.0.53/src/swift/stdlib/public/core/ErrorType.swift, line 182
(lldb)
Code=1 is AZSEInvalidArgument, which means that your connection string is invalid. I am a bit confused why you said "the right path", since fromConnectionString takes the string directly, not the path to a file. To see an example of what a correct connection string looks like, please refer to the Getting Started Guide. Basically it looks like this:
"DefaultEndpointsProtocol=https;AccountName=your_account_name_here;AccountKey=your_account_key_here"
We will document the error codes properly very soon. Sorry for the confusion!
the app crash without error, only (lldb) .
I am sorry for that SWIFT blob client haven't provide error-handling code whatsoever currently. I will provide some clues to track your issue based on your code.
Before building the storage code, make one change in the project. Go to 'Azure Storage Client Library' -> Build Settings, search for the "Defines Module" setting, and change it to 'YES'.
Please check whether the issue is caused by bad network connection.
You could get error code of this issue by putting your code in a do-catch code block.
do {
//put your code here
} catch let error as NSError {
print("Error code = %ld, error domain = %#, error userinfo = %#", error.code, error.domain, error.userInfo);
}
The SWIFT blob sample has been tested and work well targeting iOS 9.0 and using XCode 7. If you have a different setup, the sample may not run properly. I suggest you use Blob Storage REST API as a workaround.

iOS: GooglePlaces API error

I am getting this error when trying to use the sample code from Google Places getting started Link
Error: Current Place error: The operation couldn’t be completed. An internal error occurred in the Places API library.
I am calling this function on viewDidLoad. I also created a IBAction with this code to make sure it wasn't a timing issue. I got the same error this way as well.
placesClient.currentPlace { (placeLikelihoods, error) in
guard error == nil else {
print("Current Place error: \(error!.localizedDescription)")
return
}
if let placeLikelihoods = placeLikelihoods {
for likelihood in placeLikelihoods.likelihoods {
let place = likelihood.place
print(place.name)
}
}
}
I have created a new project in Firebase, which created a new project in Google Dev Console. I created new API Key, Enabled Google Maps and Google Places API. I added CoreLocation framework, my pods are up to date. I should not be hitting any limits as it is just me learning. I have the Location When In Use set up i the Plist - user gets the dialog on fresh install. I accepted it. I added location manager code from here to make sure I am getting the location. I signed up for Apple developer to get the app on my device just in case the location wasn't staying on the simulator. I have a feeling this is something stupid. Please let me know any ideas to get passed this. Thanks!

getting error ContentBlockerErrorDomain Code=3 in adblocker

I am getting error in loading content blocker by creating group: When i provide list of small number of rules in content blocker the error didn't came, but when i add more rules in my blocker list it gives error, It means there is limit of data to provide on App Group? Any one followed some other approach please share
ContentBlockerErrorDomain Code=3
i think that you are facing this issue while using NSUserdefault
after setting object in UserDefault you need to synchronize it . that thing you missed:
once apply this :
NSUserDefaults.standardUserDefaults()["key"] = "value"
NSUserDefaults.standardUserDefaults().synchronize()

ContentExtensionsDomain error 1

I am trying to use "reloadContentBlockerWithIdentifier" function of SFContentBlockerManager as follows:
[SFContentBlockerManager reloadContentBlockerWithIdentifier:#"appid.extensionid"
completionHandler: ^ (NSError *error) {
NSLog("%#", error.localizedDescription)
}
However, it only returns error message that said as follows:
The operation couldn’t be completed. (ContentExtensionsDomain error 1.)
I set both APP IDs (appid and appid.appextensionid) in "Certificates, Identifiers & Profiles" in developer.apple.com. Also, I made two "target"s for each -- ios app and ios app extension. I also checked open source implementations in Github which are roughly the same as mine, and App Extension manual several times, but it seems hard to find the relevant page for this problem. The most critical problem is: I couldn't find any offcial documents describing this message.
I'd appreciate if you let me know what is the problem.
Looking at the safari services generated swift interface, I could find the following enum for error codes:
public enum SFContentBlockerErrorCode : Int {
case NoExtensionFound
case NoAttachmentFound
case LoadingInterrupted
}
So in your case it's probably the NoAttachmentFound error. Which can be caused by failure to initialise an item provider with given data from a json file.

Resources