Fabric.io not updates the portal if not initiate in appDelegate - ios

I have integrated Fabric.io framework in my code. I have a screen to show to user for his acceptance on fabric so I initiates the fabric in that particular screen but this is not working. I mean session is not updating in this flow.. Where as it works as expected if I keep initiation in didFinishLanuchOptions.
[Fabric with:#[[Crashlytics class]]];
// Enabling debug mode
[[Fabric sharedSDK] setDebug: YES];
[Fabric with:#[CrashlyticsKit]];
Any help would be appreciated.
Thanks.

Related

Firebase Stops working when app starts second time in iOS

Here I am facing a bug in iOS Objective-C.
if([FIRApp defaultApp] == nil){
[FIRApp configure];
}
in AppDelegate.m
If I delete App and and run a fresh install, Google Phone Auth and All REST APIs work fine. After closing the the App and starting second time. [FIRApp configure] If I manage not to configure app, all REST APIs start working but App starts crashing with the error: Firebase App is not configured.
Please reply if anyone has faced this issue and resolved.
Thanks in Advance.

Issues setting up Firebase SDK with Unity iOS

I am a Unity game developer and know very little about app side code, so forgive me if I'm doing something stupid.
I'm trying to set up Firebase to work in my Unity iOS app. I'm in the very first setup, trying to get the SDK working.
So Firebase has you do a couple steps, and then they want you to do some initialization in your App Delegate. They want you to add two lines, an import and a configure. This is the code from their setup section.
#import UIKit;
#import Firebase;
#implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FIRApp configure];
return YES;
}
So Unity doesn't actually use a traditional AppDelegate. I went sleuthing and found this guy's work. He basically shows how to use a standard Unity Plugin to override the app delegate. So I put the following code in my Plugins folder.
#import "UnityAppController.h"
#import Firebase;
#interface OverrideAppDelegate : UnityAppController
#end
IMPL_APP_CONTROLLER_SUBCLASS(OverrideAppDelegate)
#implementation OverrideAppDelegate
-(BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) options
{
NSLog(#"[OverrideAppDelegate application:%# didFinishLaunchingWithOptions:%#]", application, options);
[FIRApp configure];
return [super application:application didFinishLaunchingWithOptions:options];
}
#end
Now. I'm pretty sure the Plugin is working because I can find it in my XCode project, and when I was screwing around with it and had two instances of [FIRApp configure]; it actually crashed with an error basically saying, "don't configure twice". But Firebase has not received anything from my app. They have a little prompt that says, "Checking if the app has communicated with our servers. You may need to uninstall and reinstall your app." I've uninstalled, reinstalled, tried their whole installation process again, and still nothing.
Any thoughts?? Thanks ahead of time.
If you're developing an app in Unity you can use the Firebase for Unity plugin rather than implementing your own iOS solution. Try adding Analytics to your app with this guide.

Stop tracking Crashlytics runtime in iOS

I've just integrated Crashlytics with iOS and it's quite easy integration steps. I started session of crashlytics in didFinishLaunchingWithOptions with code [Fabric with:#[[Crashlytics class]]]; and its start tracking.
At some point in App I want to stop tracking of Crashlytics so how Can I do this? Is there any code for this? There is a way to stop tracking from online Dashboard in Crashlytics but I want to do from Code.
Looking for suggestions and help.
Thanks.
Xcode debugger does NOT allow Crashlytics to process crash reports.
if you have your device connected to your Mac, XCode's debugger will step in as well. So just disconnect the device before testing.
To make sure a crash is reported during your simulator testing:
Launch simulator
Press stop
Launch your app and force a crash
Relaunch the app from simulator
See the crash report in the web dashboard
Reference
Mike from Fabric here. I believe you're looking to kill an active Fabric session once it's been started with the same launch/session of the app.
In that case, there is not a way to kill the SDK session. I'd recommend wrapping the Fabric init in a conditional call or boolean check to see if Fabric should be initialized or not.

iOS Crashlytics - Block crash reports from being send to server

I have installed the Crashlytics to my app, It's working fine and sends crash reports to the server.
But in my app setting, I'm having new option as "Send crash reports" switch.
So if the user toggle off the switch in setting page, It should block the Crashlytics report from being send to its server.
But i'm not seeing any option in the Crashlytics framework to block the reports or even stop the Crashlytics from running.
Is there any way to block the reports or stop the Crashlytics from running?
Once the setting changes, you can make sure Crashlytics is not enabled once the app restarts. In your app delegate, you can check for the setting and then enable Crashlytics.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Crashlytics
//Check setting
if ([[NSUserDefaults standardUserDefaults] boolForKey: #"CanSendCrashReports"])
{
[Fabric with:#[[Crashlytics class]]];
}
}

App crash on using Fabric and TwitterKit

I've got this line of code on my application didFinishLaunchingWithOptions delegate method and it causes a crash saying:
'[Fabric] Value of Info.plist key "Fabric" must be a NSDictionary.'
Anyone can help me with this one?
Here's the code that causing the crash:
[[Twitter sharedInstance] startWithConsumerKey:#"consumer_key" consumerSecret:#"secret_key"];
[Fabric with:#[[Twitter sharedInstance]]];
Alex from Fabric here. To use different Twitter API keys or API keys generated on apps.twitter.com, you're declaring it correctly in your code above. It sounds like you may not have fully onboarded your app through the Fabric app, and required entries, like the Fabric APIKey, are missing from your info.plist.
Some more info on the Fabric Mac App and info.plist:
When you onboard an kit through the Mac App, a Fabric Dictionary entry is injected into your info.plist. Under the Fabric parent, there will be two children entries: APIKey and Kits.
Your Fabric API key, if it's not injected for some reason (it should be added automatically if you're using the Fabric app) or you want to manually change it, can be found by visiting https://fabric.io/settings/organizations, clicking your organization and clicking "API Key" below the organization title.
The Kits array contains an Item X for each Fabric kit you've included. If you've included Twitter Kit, the automatically provisioned consumerKey and consumerSecret are listed under KitInfo.
I followed the steps as described above but still was getting this error
uncaught exception 'TWTRInvalidInitializationException', reason:
'Attempted to call TwitterKit methods before calling the requisite
start methods; you must call +[Fabric with:#[Twitter class]] before
using the methods on TwitterKit
As i am using multiple kits i tried to initialize on different calls as follows
[Fabric with:#[[Crashlytics class]]];
[Fabric with:#[[Twitter class]]];
As per Fabric documentation for + (instancetype)with:(NSArray *)kitClasses;
Only the first call to this method is honored. Subsequent calls are
no-ops.
So only Crashlytics was initializing and Twitter got ignored.
Solution was to initialize as follows;
[Fabric with:#[[Crashlytics class], [Twitter class]]];

Resources