Customising Firebase Crashlytics crash reports - ios

I am trying to customise Firebase Crashlytics reports by adding a couple of custom keys. I followed instructions from https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios
The iOS app is based on React Native. I have added dollowing in one of the methods of RNSPlashScreen.m:
[[FIRCrashlytics crashlytics] setCustomValue:templateVersion forKey:#"template_version"];
But I get following error:
Use of undeclared identifier 'FIRCrashlytics'
I tried adding:
#import FirebaseCrashlytics;
But then another error popped up:
Module 'FirebaseCrashlytics' not found
Although I can confirm that I have followed all steps as mentioned in the documentation and I am able to get the crash reports in Firebase console. I have also added use_frameworks! in my podfile.
I am facing issues in adding customer keys for the more detailed reporting. Any help will be appreciated.

I managed to make it work. Let me start by saying, I'm a newbie in iOS development. I was adding the tracking code in SplashScreen which was the primary concern I believe. I moved it to RootView class and it solved the issue.
About the import error, Replacing #import FirebaseCrashlytics; with #import "FIRCrashlytics.h" did the trick.
Let me know if anyone has any suggestion or comment on the same.

Related

Firebase Crashlytics not showing Logs after SDK upgrade in iOS App

My app is using Crashlytics which is moved from Fabrics to Firebase Crashlytics. My problem is that I recently upgraded firebase Crashlytics and after this upgrade there is no "Logs" displaying with crash report. I cross checked all settings and code but couldn't find any possible reason.
It was working properly before upgrade. Now all crashes are being reported properly as all the information such as "Stack Trace", "Keys" are as before but "Logs" section is empty.
My question may be an "iOS Duplicate" of this question. Anybody please tell me if there is any part of code I'm missing to get this "Logs" data.
Here is the code I setup in my AppDelegate for configuration :
FirebaseApp.configure()
FirebaseConfiguration.shared.setLoggerLevel(.min)
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
Just to confirm, are you capturing log messages with Crashlytics.crashlytics().log()? See https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios#add-logs

How to remove isAdvertisingTrackingEnabled In Unity

We have App in ios. It was developed in unity. Yesterday apple informed that our app has been rejected because we have been used advertising in your app. But we did not used any advertisements in our app. This is the screen shot.
we have been searching in google. but we have not found any solutions. So any idea how to remove the Isadvertisingtrackingenabled in unity.
strong textThose who have received the above error. I have followed the below steps and our app got approved.
The answer is taken from this forum
https://forum.unity.com/threads/important-changes-for-ios-kids-apps-action-needed-by-developers.838939/.
all the credit goes to that person only. I am just posting for information purpose only.
To make the manual fix, please follow the instructions below:
Open the file DeviceSettings.mm within your Xcode project.
Find and remove the line #include
Find and completely remove the function “QueryASIdentifierManager”
Find the function “UnityAdvertisingIdentifier” and replace it with:
extern "C" const char* UnityAdvertisingIdentifier()
{
return NULL;
}
UnityAdvertisingTrackingEnabled()
find the unityadvertisingtrackingenabled and replace the code.
extern "C" int UnityAdvertisingTrackingEnabled()
{
return 0;
}
NOTE:
In Package manager . Unity Ads and Unity Analytics are enabled as default. So kindly disable the both. and then following the above steps. it will works fine for me.
after following the above steps mentioned by this above forum . you will receive one error. So to avoid the error.Kindly add
SystemConfiguration.framework.
in xcode FrameWork Path.
Then the error will solved and your app also got approved.
if you some one need any assistance i am ready to help you.

OAuthProvider for Twitter iOS Log In with Firebase has wrong constructor

I am using the following tutorial to implement Twitter log in for an iOS app: https://firebase.google.com/docs/auth/ios/twitter-login.
I follow all the steps & when I get to var provider = OAuthProvider(providerID: "twitter.com"), Xcode is not happy. I get Argument passed to call that takes no arguments.
I am importing Firebase and installing the Pods as shown.
Any idea on what could be going wrong? Thanks!
I had already face the same problem, and it was solved by updating Firebase/Auth by Pod
pod update

Initialize Fabric-Answeres in iOS with cocoa pods

I posted a post which was named "Initialize Fabric in iOS with cocoa pods", regarding initialization with crashlytics. It basically asked how to initialzie crashlytics with an API key, without having to go through info plist.
That was solved by doing this:
Crashlytics.start(withAPIKey: FABRIC_API_KEY)
But then im trying to do the same for Answers:
Answers.start(withAPIKey: FABRIC_API_KEY)
But Answers doesnt have any .start method? How can I initialize this then?
It is later used in this line:
Fabric.with([Crashlytics.self, Answers.self])
Mike from Fabric here. Answers is included within Crashlytics by default, you only need to init Answers separately if you're not using Crashlytics. Using:
Fabric.with([Crashlytics.self])
is all you need to do.

Getting error improper advertising identifier [IDFA] usage,when i am validating my app in xCode 5

when validating my app, I get an error saying
"Improper Advertising Identifier Usage. Your app contains the Advertising Identifier [IDFA] API but you have not respecting the Limit Ad Tracking setting in iOS."
I have check "Yes" on the Prepare for Upload page for Advertising Identifier.I am using revmob ads and flurry analytics in my app(COCOS2D-X project).How to fix this issue, I have tried a lot but not succeed.I have use below code into appdelegate but no luck.
- (NSString *)identifierForAdvertising
{
if([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled])
{
NSUUID *IDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier];
return [IDFA UUIDString];
}
return nil;
}
this IDFA issue was still happening for me today. I tracked it down to the GoogleAnalytics pod, so I just updated the pod to the latist version by specifying pod 'GoogleAnalytics-iOS-SDK', '~> 3.0.7' in the podfile which fixed the issue for me. the version was previously unspecified but was using 3.0.3.
Around April 26th Apple changed their IDFA scanning procedures. Not only do you have to check the appropriate checkboxes after you click on the "prepare for upload", but your code (or any other third party library that you have must use IDFA by using the class directly.
Someone suggested to do this:
"you can do that by replacing direct refs to ASIdentifierManager with NSClassFromString(#"ASIdentifierManager")"
DO NOT load this class using this approach! New scanning procedure will look specifically for this and if it is found instead of direct references - Apple seems to assume that there is some strange usage of the tracking identifier. I can't say I disagree with that decision.
It may not be easy to find exactly which library is at fault. Latest AdMob SDK for example is using the class directly and is NOT the source of a problem.
One way you can find out which library is the source of the problem is to remove AdSupport.Framework from your project and see which libraries fail to link. Those libraries are NOT the problem. See if you have other advertising libraries that do not require you to include AdSupport.Framework - those are most likely the culprit.
It sounds a bit counter intuitive, but the direct referencing is not the problem, dynamic (weak) loading of that class is.
Hope this helps someone - we were pulling our hair out until we found what was the source of the issue.
Looks like Apple has reverted the changes now. All apps are going through just as usual again :)

Resources