HomeiOS Developmentios - Sort 'Analytics' has no member 'logEvent' Xcode

ios – Sort ‘Analytics’ has no member ‘logEvent’ Xcode


Had an issue, when tried to implement Analytics into my venture on Xcode:

Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
    AnalyticsParameterItemID: "id-(testTitle)",
    AnalyticsParameterItemName: testTitle,
    AnalyticsParameterContentType: "cont",
])

Error: Can't discover 'Analytics' in scope and Can't discover 'AnalyticsParameterItemName' in scope.

Script:
import FirebaseStorage

class mainScreenScript: UIViewController
{

override func viewDidLoad()
    {
        tremendous.viewDidLoad()

        let testTitle = "TestContentTitle"

        Analytics.logEvent(AnalyticsEventSelectContent, parameters: [
            AnalyticsParameterItemID: "id-(testTitle)",
            AnalyticsParameterItemName: testTitle,
            AnalyticsParameterContentType: "cont",
        ])
    }
}

My pods have been:

platform :ios, '13.0'

goal '(myAppName)' do
  use_frameworks!

  # Pods for (myAppName)
  
  pod 'Firebase/Auth'
  pod 'Firebase/Firestore'
  pod 'FirebaseUI'
  pod 'FirebaseAnalytics'
  pod 'FirebaseUI/E-mail'
  pod 'Firebase/Storage', '~> 8.0'
  pod 'GoogleUtilities/UserDefaults'
  pod 'Charts'
  pod 'IQKeyboardManagerSwift'
  pod 'CryptoSwift'
  pod 'Firebase/MLModelDownloader'
  pod 'TensorFlowLiteSwift'
  pod 'GoogleSignIn'
  pod 'FBSDKLoginKit'
  pod 'FBSDKCoreKit'
  pod 'Google-Cellular-Advertisements-SDK'
  pod 'SideMenu'
  pod "MBCircularProgressBar"
  pod 'DGCharts' 


finish


post_install do |installer|
    installer.generated_projects.every do |venture|
          venture.targets.every do |goal|
              goal.build_configurations.every do |config|
                  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
               finish
          finish
   finish
finish

AppDelegate:

import Firebase
import FirebaseFirestore
import FirebaseAuthUI
import FirebaseStorage

and

func utility(_ utility: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
    FirebaseApp.configure()
    let db = Firestore.firestore()
    
    //different components of the code
    
    ApplicationDelegate.shared.utility(utility, didFinishLaunchingWithOptions: launchOptions)
    
    return true
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments