IOS app doesn't show up in Firebase Analytics - ios

I build a firebase iOS app. It works with Firestore and it works fine but the problem is the app doesn't show up when I click on dashboard (under analytics in the Firebase console). I have reinstalled firebase (multible times) and I have checked if analytics was enabled and it was. Does anyone know what I need to check or something?
I followed the instructions from firebase when adding firebase to the IOS project (if this was installed correctly firestore wouldn't work). The only difference that I didn't use cocoapods but Swift package dependencies. I followeded this instructions: https://firebase.google.com/docs/ios/swift-package-manager. The reason that I didn't use cocoapods is that I just can't get accesses to the iOS project. It keeps giving me zsh: permission denied. I have tried everything from chmod 777 to using sudo. I gave the terminal full disk acces but I keep getting permission denied. Anyway that's why I use swift package manager. I use the following dependencies:
FirebaseAnalytics
FirebaseFirestore
FirebaseCrashlytics
Everything works fine apart from getting user data on the dashboard. Does anyone know what this problem could be? I don't know what code to give. I do use FirebaseApp.configure() in AppDelegate (otherwise Firestore wouldn't) work. But I do get this error in the logs:
app[74317:4168079] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
Because of confusion in the comment section this edit.
Firebase gives you automatically all kinds of information on the analytics page about your app. When enabled the only thing you need to do (according to the docs) is call FirebaseApp.configure() in AppDelegate. I have done this and it works because otherwise Firestore would not work. But the IOS app doesn't show up on the analytics page. I have reinstalled Firebase 6 times on my IOS app and still nothing. Does anyone know what could possible go wrong? Because this should all work automatically so I don't know what code to post.

I forgot to add -ObjC to my build settings. That fixed my problem.
Link: https://firebase.google.com/docs/ios/swift-package-manager#analytics

Related

Can't get debug token for Firebase App Check for my Flutter iOS App

So I recently started setting up app check for my existing Flutter project (for both android and iOS platforms). I've had no problem with android's "Play Integrity", got the necessary debug token, and can successfully send and retrieve data to/from firestore (app check for firestore is currently enforced for my project).
The problem is, I can not get such a debug key for my iOS app. I will list the sources I've used and what I've tried so far.
I have firebase_app_check: ^0.1.1+8 installed via pubspec.yaml
I also added pod 'FirebaseAppCheck' to my Podfile
I have the necessary initialization code in my main.dart: await FirebaseAppCheck.instance.activate(...);
For "DeviceCheck", I am using THE SAME private key that I am using
for "Sign in With Apple" (which I have implemented successfully). I
have also enabled the checkbox for DeviceCheck in the settings of
that private key (in Apple Developer).
For my App ID (Apple Developer > Identifiers > App IDs), I have also
enabled the checkbox for "App Attest".
I have put "-FIRDebugEnabled" as an argument passed on launch in
XCode > Product > Scheme > Edit Scheme.
I always uninstall my app from my iOS simulator (iOS 16.2) or real device (iOS 16.1.2),
before trying again, because I have read across multiple forums that
the debug token only gets printed to the output the first time you
run your app.
I have also added these 4 lines of code in my AppDelegate.swift from here:
#if DEBUG
let providerFactory = AppCheckDebugProviderFactory()
AppCheck.setAppCheckProviderFactory(providerFactory)
#endif
Official firebase docs "iOS+ (App Attest)":
I have NOT copied ANY code from this page of the official docs, as I assume it's for native iOS apps only, and not for flutter, and I don't know where exactly I would have to put that code. I have only added the pod dependency and run pod install.
I don't have a .entitlements file.
So after all those steps, I'm apparently supposed to expect to find a debug token in my run output, as in:
Yet the only relevant output I can find is the following:
Runner[72719:33546579] 10.3.0 - [FirebaseFirestore][I-FST000001] AppCheck failed: 'The operation couldn’t be completed. (com.apple.devicecheck.error error 1.)'
If it matters:
I have NOT YET uploaded my iOS app to apple developer, app store connect or whatever (I'm not yet familiar with the process of publishing to the app store).
Neither have I uploaded my android app to Google Play console or created an app there (for this project).
Don't tell me anything about firestore rules. I already had that set up long ago, and everything worked just fine before I started integrating App Check.
Don't recommend any 3rd party plugins to me, I will only use official ones.
The firebase documentation says:
Tip: Confirm in your Xcode project's build settings that it passes the DEBUG flag to the Swift compiler
Try removing the '#if DEBUG' and '#endif' and run the app.
If it works, it mean you have missed that step
I was not able to find that build setting, so i just removed those lines from the AppDelegate, but i need to keep in mind to remove the other 2 lines while building the release mode
See this answer on the flutterfire Github issues page. Basically, call setAppCheckProviderFactory before GeneratedPluginRegistrant.register(with: self) in the app delegate file. I was investigating the same issue and it fixed it for me (the debug token was instantly printed out in Xcode's debug output). Hope it helps you as well!

Fabric Crashlytics not working. iOS 14 app/XCode 12

Firebase integration with my app is working like a charm.
So I tried to add Crashlytics.
After pod the SDK and configuring my app in XCode, I've got the version message on log:
"2020-10-23 14:13:36.386002-0300 Findn[44158:3074710] [Firebase/Crashlytics] Version 4.6.2"
But at Firebase Console there isn't a card for Crashlytics.
And at Crashlytics tab this circle keep spinning.
Any tips?
EDIT:
Guess I wasn't clear enough, sorry.
I did follow all guidelines to integrate Firebase to my app.
The problem seems to be on Firebase side, since my app's log does not report any errors on xcode.
Yes, Now you can not use fabric solely. You have to integrate firebase to use a fabric.
Check this link:
firebase crashlytics
Maybe the solution is here!
The steps are the following:
Ensure you add the code in order to force a crash, something like that firebase
First, you need to build the app and launch the app with Xcode,
Next launch without attaching with Xcode (manually, tapping on icon app), and force crash app with fatalError()
Then launch with Xcode and the app will send the traces... 💥

Why does my Flutter app crash at startup on iOS?

I'm trying to build a simple app using Flutter for iOS and Android, but the app crashes on startup when I try to run it on an iPhone (Android runs fine). I don't have a mac, so I'm using Codemagic to compile a release build and deploy to TestFlight, then installing on an iPhone from there. Apple only shows their crash logs in Xcode as far as I can tell (nothing in App Store Connect online?), and since I don't have a mac, I can't see those. Any thoughts as to what I might be running into, or what information I can gather to debug the problem?
Thanks!
Edit: I've been digging around some more and it looks like the crash is related to the Firebase dependencies. If I create the Flutter demo project (flutter create ), it runs fine on iOS. However if I then add Firebase packages to pubspec.yaml, and manually add GoogleServices-info.plist, the app crashes on startup. (I'm not adding any code that uses Firebase yet.) GoogleServices-info.plist is supposed to be added with Xcode, but since I don't have Xcode or a mac, that makes it tough. The second answer to this question gives a suggestion: Where to save GoogleService-Info.plist in Flutter without Xcode?
I tried making those changes but got the same result. Anybody have any recommendations for adding Firebase without a mac?
Ok, so here's what happened. Originally the app crashed on iOS because there were issues with the GoogleServices-info.plist file (probably). There were no error messages, so I didn't know where to look. I finally just went back to the simple demo app and started layering things back in to isolate the issue. The demo app would build and run on iOS with no problems, but when I added the Firebase dependencies (as a group), it failed. I had added the GoogleServices-info.plist file manually (outside of Xcode) and adjusted the references in ios/Runner.xcodeproj/project.pbxproj using a text editor, but that didn't do the trick.
At this point I finally broke down and got a MacBook. Debugging on the Mac, I could now see that the app crashed in debug mode on the emulator as well as when in release mode on a device, but still no helpful error messages. I added the GoogleServices-info.plist file using Xcode, so at least that piece was correct, but the app still crashed immediately. Going through the documentation, I realized that when I made the sample app, I had forgotten to add the app ID in the info.plist file for AdMob. At this point it was just AdMob causing the crash, not the other Firebase dependencies. I added that back in and things ran fine. I wish I had looked at that a month ago. Ugh.
Thanks #Mikhail Tokharev and #season for taking a stab at such a vague question. I wish I had more detail to share initially, but I didn't know enough yet to know what could be going wrong.
TL;DR
Just get a Mac. Trying to debug through Codemagic won't work.
For Firebase, be sure you actually add your GoogleServices-info.plist file through Xcode. Trying to add it manually and hack the project.pbxproj file probably won't work (this a practical recommendation, I didn't prove this conclusively).
https://firebase.google.com/docs/flutter/setup?platform=ios#add-config-file
For AdMob, be sure to add your application ID to the info.plist. https://pub.dev/packages/firebase_admob
I've been facing this error since the last few days and I happen to solve it today. So, I would like to share it with anyone facing startup error after connecting their iOS app to firebase.
I had followed all the steps while setting up a new iOS app with firebase and this was what exactly caused the error, in my case. If you have placed import 'Firebase' and Firebase.configure() in your AppDelegate.swift, then remove it and run your app again. I removed those two lines and it worked fine. Test it with Cloud Firestore (just make a button write something to your cloud firestore) and make sure you add await Firebase.initializeApp(); as well when the button is pressed.
I did all of those steps and it worked fine with me.
P.S. I did it with android studio in a Mac.
For any newbies out there like me, make sure registering firebase is before GeneratedPluginRegistrant in your ios/Runner/AppDelegate.swift file.
// This works without crashes, FirebaseApp.configure() after GeneratedPluginRegistrant crashes
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
i had the same issue and i have fixed it as i was new to ios deployment i forgot to add capabilities which indeed crashed my app in testflight ...so please be sure you have added required capabilities in signing and capability tab in xcode
use terminal to run the app.
run this command
flutter run --release
For iOS: In our case this happened because of Facebook plugin update.
Previous version: flutter_facebook_auth: ^3.5.1
New Version: flutter_facebook_auth: ^4.3.3
We were missing FacebookClientToken in Info.plist file. So after adding that it worked.
<key>FacebookClientToken</key>
<string>$(FACEBOOK_CLIENT_TOKEN)</string>
most probably you've faced with next Flutter issue https://github.com/flutter/flutter/issues/54707
I had the same problem and solved it as below :
In the folder of flutter sdk,
I did git pull then run the app again and it was solved .
If you using Google Firebase library in flutter app
Make sure use FirebaseApp.configure() before GeneratedPluginRegistrant.register(with: self) in AppDelegate.swift file.
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)

iOS Firebase + Fabric Beta Crashylitics Not Reporting Issue

I've just recently installed Fabric to a project which already had Firebase installed and suddenly Crashyltics has stopped working. It's not included within the 'Fabric.with([])' call on AppDelegate.swift but I wondered if Fabric and Firebase were cancelling out Crashyltics. I'm using Fabric for it's Beta option and everything else is inside Firebase.
I can force a crash inside the app - But not getting anything reported in either Dashboard.
My run Script Phase is also correct.
My Debug is DWARF with DYSIM.
Cleared derived data etc.
Firebase is called after Fabric inside AppDelegate.
Thanks
I think that you have to link your firebase and fabric apps.
Go to https://fabric.io/firebase_migration/status, click on link apps and select the apps to link (the one on fabric and the corresponding app on firebase)
Do you upload your dSYM to Firebase/Crashlytics? If not it can be the issue.

Why is Firebase Analytics disabled for my iOS app?

I've written an app which uses Firebase. I have installed it properly, I believe, and I've done the [FIRApp configure]; in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
I've also added the debug arguments for the project scheme to see what's happening. Firebase seems to be working as intended, except that it keeps telling me that Firebase analytics is disabled.
My log in Xcode:
Firebase screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
Configuring the default app.
InstanceID library version 2.0.5
Debug mode is on
Firebase Analytics v.40004000 started
Firebase Analytics disabled
Tracking view controller. Class, ID: MainViewController
Screen view event not logged. App is not active.
Firebase Analytics is disabled. Event not logged
So Firebase obviously works, but it won't let me send any events, custom or otherwise. I can't find anyone else with this issue. I believe my project is correct set up in console.firebase.com but it simply won't send any data there. I have downloaded and added my GoogleServices-Info.plist file. My app is targeted iOS9 and above, and I'm using Objective-C.
I've followed this guide: https://firebase.google.com/docs/ios/setup#add_firebase_to_your_app
Edit
My project is old, before Firebase existed. So I imported it from Google Cloud Platform. I'm thinking this might be the issue. I tried creating an entirely new project on another account and then added a completely new app. Firebase worked as intended. Anyone experienced any issues when migrating from Google Cloud Platform?
So I finally found the issue. After creating a new project entirely and moving my app to that project it still didn't work. So I started to scan through the entire project for anything that might cause Firebase to disable logging.
Turns out FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED was set to YES in the Info.plist file. I have no idea why, since the project didn't use Firebase at all until I started to add it. Hope this blunder helps someone else with the same issue.
TL;DR
try update Firebase SDK to latest version.
Just incase anyone see this thread. We have met a similar situation like #ClockWise met. however, after trying tweak with info.plist. it turn's out the reason was the version of SDK.
We use to have version 6.11.0(firebase), and 6.1.3(firebase analytics), after running pod update to update sdk to latest version(6.21.0), it works properly, debug view is working, and we can see the events in firebase dashboard.

Resources