Adobe and Firebase Not working in AppDelegate at the same time - ios

I implemented Adobe Lifecycle events and Firebase messaging feature in AppDelegate in two different projects.
But when I try to add adobe lifecycle code with firebase code and import the pods for Adobe Analytics (AEPCore ,AEPAnalytics ,AEPUserProfile, AEPIdentity, AEPLifecycle, AEPSignal,AEPServices ,ACPCore) then I get this error:
Cannot assign value of type 'AppDelegate' to type 'MessagingDelegate?'
Please help if someone faced this issue.

It worked when you write " extension AppDelegate: FirebaseMessaging.MessagingDelegate " instead of "extension AppDelegate: MessagingDelegate"

Related

Customising Firebase Crashlytics crash reports

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.

Implementing Firebase Analytics in a swift framework

i'm trying to configure Firebase Analytics with cocoapods in our app.
The app has an architecture like this:
App <- App-Framework
The app is basically just the AppDelegate importing App-Framework - which is the whole app.
Then to the problem, i'm doing this in AppDelegate:
FirebaseApp.configure()
After this i try to log an event to Analytics in the App-Framework with:
Analytics.logEvent("testEvent", parameters: [
"name": "Krister" as NSObject,
"full_text": "Krister tester" as NSObject
])
And the debugger then says:
Event not logged. Call +[FIRApp configure]: share_image
The framework and the app imports Firebase trough cocoapods and the general Firebase Analytics setup is not missing anything, like the GoogleServices.plist and imports.
I tried to implement this in an app with no framework and the events get logged to the Firebase Console and DebugView.
The weirdest thing is that the default screen tracking is getting
logged, but none of the logEvents().
What to do next?
Solution 1:
I ran the FirebaseApp.configure() inside App-Framework,
trough a method inside of AppDelegate.

Failed importing Facebook SDK in Swift 4.x

I've tried to import Facebook SDK for App Events and tracking of App Installs through Facebook ADS and it's being impossible to do it.
I've done it with CocoaPods using:
pod 'FacebookCore'
as the Facebook official tutorial says.
After that, Facebook Analytics has detected me as a New unique user, so that is great 👍.
The problem is when I try to add an APP Event like so:
AppEventsLogger.log("Opened App Main VC");
And then this ERROR 🔴 appears:
Use of unresolved identifier 'AppEventsLogger'
Apart from this, also it's not detecting AppEventsLogger in the AppDelegate with the same error:
AppEventsLogger.activate(application)
I've imported in the VC and in the AppDelegate this modules/libraries:
import FacebookCore //in theory is just this one
import FBSDKCoreKit
So any tip or help is very welcomed! 😊
Two Imports
import FacebookCore
import FBSDKCoreKit
In AppDelegate
func applicationDidBecomeActive(_ application: UIApplication) {
AppEvents.activateApp()
}
When you want to log an event:
AppEvents.logEvent(AppEvents.Name.init(rawValue: "Opened App Main VC"))
For another type of AppEvents, you can refer to this
The problem is AppEventsLogger is changed to AppEvents. So change the name of AppEventsLogger and it will work fine. This is a new update in Facebook sdk.

QuickBlox iOS SDK , Enabling Cloud Back-End Server AUTHKEY/APPLICATION ID TO APP DELEGATE

I have followed all the guidelines of how to set up the iOS SDK that QuickBlox provides. I added the SDK through cocoa pods, added the run script with the snippet code. example here! I came to a crossroad and got stuck in how to add the auth-key, app-id.. ect. To The app delegate?
This is how you set the values in AppDelegate for QuickBlox
First
import Quickblox
in your AppDelegate, then in didFinishLaunching add this
QBSettings.setApplicationID(yourAppId)
QBSettings.setAuthKey(yourAuthKey)
QBSettings.setAuthSecret(yourAuthSecret)
QBSettings.setAccountKey(yourAccountKey)

SWIFT 2: Class ViewController has no initializers - Using GOOGLE's Admob

I was following a Youtube tutorial to learn how to use Google's AdMob with Swift on XCode: https://www.youtube.com/watch?v=tJi-vQ9e-HI
I got an error saying that my class "ViewController" has no identifiers.
It had worked just fine for the guy on Youtube, we put in the same frameworks, imported the same frameworks, wrote the same code. The only difference I believe is that he was developing for iOS 9.1 while I was doing it for 9.3.
The picture linked below has my code for the ViewController.swift file and I do not know what is wrong with it.
Any help is appreciated.
Thanks!
ViewController.swift
You didn't initialize the banner before loading the view, you have to make sure it exists. So this should fix it:
var adBanner: GADBannerView!

Resources