How to use fabric when having multiple target in project - ios

I have an iOS project with 2 targets, I am trying to integrate fabric to the project. After following through their documentation I was able to implement crashlytics for first target and I am able to see the crash log in the dashboard also. Everything is working fine.
In the second target I used same API key and script which was used for first target then I tested the second app, in the dashboard I am able to see two different app reports.
Is it the right way to do it. I mean to use same API key for multiple targets.
Hope you understand the problem.

Mike from Fabric here.
API keys are set per organization within Fabric, so multiple apps or targets within the same Fabric organization would use the same key.

Related

Firebase dynamic link not opening correct app when multiple flavors are installed on iOS

We developed a flutter app for Android and iOS, with different flavors: dev, test and prod, so we have 6 apps in total. To on-board the user, we send a firebase dynamic link via Email (with a deep link inside it) to navigate the user to a specific screen when it is tapped.
The expected behavior is that when the user taps on a dynamic link of - say - the dev app, it opens a screen in the dev app. Similar for the other flavors.
Now this works just fine on Android.
On iOS it works fine if only one app is installed, but if for example the dev and the test apps are installed, then tapping on the dynamic links always opens the test app. This is also true when dev, test and prod are installed: test is opened.
This is a development issue and not relevant for production as the user will never have the test or dev app installed, but it is annoying us as we have to uninstall and reinstall flavors all the time.
Our dynamic links have the following format (values in '<>' are placeholders):
Dev: https://<app_id>.page.link/?link=http://dev.<mydomain>.com/reset?token=token1&apn=<mypackage>.dev&isi=<isiNumber1>&ibi=<mypackage>.dev
Test: https://<app_id>.page.link/?link=http://test.<mydomain>.com/reset?token=token2&apn=<mypackage>.test&isi=<isiNumber2>&ibi=<mypackage>.test
Prod: https://<app_id>.page.link/?link=http://<mydomain>.com/reset?token=token3&apn=<mypackage>&isi=<isiNumber3>&ibi=<mypackage>
The behavior is the same for all iOS versions I could get my hands on on real devices, i.e. iOS 11, 12 and 13.
We're using Flutter 1.9.1-hotfix6 and firebase_dynamic_links 0.5.0+1
Any ideas what this might be caused by?
Firebase Dynamic Links do not support using the same URL prefix for multiple iOS apps/targets contained in the same Firebase project.
You can workaround this in multiple ways though:
Using multiple (sub)domains (as already suggested by Janmenjaya)
Use a custom domain
Using multiple Firebase projects (as already suggested by Aleksandr)
On Android it works out of the box, because you are in charge of matching paths with particular apps within the Manifest file. On iOS it doesn't work, because Firebase is in charge of such matches within the hosted apple-app-site-association file.
For further information, I've written an extensive answer here.
Do not use one project in the firebase console, it is better to split and use different url in <key>com.apple.developer.associated-domains</key>
In Firebase under dynamic link, we can create multiple url domain. And these url domain we need to add in the associated domain of different target.
Steps
Let’s assume I have two target test and production.
I created two domain link like “test.page.link” and production.page.link
In test target in Xcode under Signing & Capabilities -> Associated Domain, use the “test.page.link”
And for production target set the production.page.link

Firebase Analytics events on iOS - test and production

The iOS app I am working on uses Firebase Analytics to report events. It works as expected, but the app is not in production yet. Once it is it would be preferable to have the events logged by real users separate from these logged when debugging.
What is the best way to have Firebase Analytics events logged separately for test and production?
First you will probably want to create a separate Firebase project for staging/debug.
Then you will have to configure your app to be able to use different resources based on build type. For Android we solved this using build flavors, not sure what the iOS equivalent is.
From docs (https://firebase.google.com/docs/projects/multiprojects):
By default, FirebaseApp.configure() will load the GoogleService-Info.plist file bundled with the application. If your development and production environments are configured as separate targets in XCode, you can:
Download both GoogleService-Info.plist files
Store the two files in different directories
Add both to your XCode project
Associate the
different files with the different targets using the Target
Membership panel.
If the builds are part of a single target, the best option is to give both configuration files unique names (e.g. GoogleService-Info-Free.plist and GoogleService-Info-Paid.plist). Then choose at runtime which plist to load.

Configure Fabric in iOS application

i'm trying to configure fabric in my iOS application
I have idea that we need to enter api key in application and have to download fabric' framework. The problem is i don't know how to get APi key.
I've created account on fabric, but don't know how to proceed. Unable to see Dashboard over there. Kindly help me how to do it. I'm stuck on this screen (screen shot below).
I've added xcode sdk and can see fabric app in my mac. But what about 3rd step. i think it's the main step and may be i will be able to get api key from here. but how to navigate to that.
Thanks,
I don't know what was the issue with project. i cloned it from another one and deleted fabric Api key from info.plist. Something was causing issue.
How i fixed it:
i created a new project. Made account on fabric. Installed its xcode plugin. The plugin gave me the option to choose project, i selected mine. Afterwards, it guided me step by step i.e adding run script etc and added fabric api keys in my info.plist on its own. Now it's working fine.
i was worried that why dashboard is not displayed on fabric.io, it was no issue at all. Once i configured fabric in my project, the dashboard appeared on fabric.io as well
The easiest way to add fabric to your app is via the desktop app, Click on "New app" and follow the instructions

Fabric + Appsee with Ad Hoc / Release API Keys

I’m using Fabric, and porting my existing Appsee integration over (from Cocoapods). I can’t find a way to tell Fabric to use my two separate API keys for my Ad Hoc and Release builds, everything’s being piped through to live at the moment since that’s the key in its plist entry.
Anyone done this?
Right now - there is no way to do this through Fabric. The only way is to replace the call:
[Fabric with:Appsee]
to:
[Appsee start:#"apikey"] and specify the different API keys manually.
We are working with the Fabric team to improve this.

Add Fabric app (Twitter) without Xcode

I have this situation: I need to build my app on the command line, but I need to make changes too. (The tool I would be using is Fastlane).
I could enter the api keys externally, but the question is: How do I create a Fabric app without opening Xcode?
Thanks!
If you already have a Fabric account, all you need is the organisation API key. On the first launch of a new app, the app will automatically be created on Fabric.

Resources