I am trying to make a demo of this ads. While i follow this tutorial. Getting this error Use of undeclared type 'GADUnifiedNativeAdLoaderDelegate'. I am using the latest version of GoogleMobileAds.framework.
AppDelegate
import Firebase
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
// Initialize the Google Mobile Ads SDK.
GADMobileAds.configure(withApplicationID: "ca-app-pub-3940256099942544~1458002511")
return true
}
ViewController
import UIKit
import Firebase
import GoogleMobileAds
class ViewController: UIViewController, GADUnifiedNativeAdLoaderDelegate
I am using an older version(7.25.0) of Admob. The latest one is 7.29.0. When i have written pod 'Firebase/AdMob' in podfile at that time i got version 7.25.0. Then after i write pod 'Google-Mobile-Ads-SDK' so i got 7.29.0 version of AdMob.
Related
I'm creating a social app (out of personal interest) using Xcode on my macOS Catalina 10.15.6 and facing tons of config issues before really doing something.
I'm stuck in this swift compiler error for 2 days already: Use of unresolved identifier 'FirebaseApp'
I've updated Ruby successfully.
I followed the instructions on the firebase official website
import UIKit
import Firebase
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
}
I've met bumps all along after executing "pod init" in Terminal. This was solved after I updated Ruby. I've got some help from Stack Overflow posts but couldn't find the one that solve my problem.
I have found the official documentation regarding the setup misleading. Therefore I use import FirebaseCore when implementing FirebaseApp.configure() and not as suggested import Firebase.
I am developing an App that uses Firestore. The app runs fine on the Xcode simulator, but crashes when I try to run it on my phone. I get the following error message:
*** Terminating app due to uncaught exception 'FIRIllegalStateException', reason: 'Failed to get FirebaseApp
instance. Please call FirebaseApp.configure() before using Firestore'
I do call FirebaseApp.configure() in the didFinishLaunchingWithOptions:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
return true
}
I don't understand why it would run in the simulator and not on my phone. Any help would be appreciated.
Check your podfile for how you add the firebase cocoapods, It should be like this,
pod 'FirebaseCore'
pod 'Firebase/Messaging'
If your podfile different ,please remove old firebase related pods,insert this and install.
I discovered, on a Japanese code forum, what to do. I added the following code to the AppDelegate.swift file:
var window: UIWindow?
override init() { //初期化メソッドを追記
FirebaseApp.configure()
}
The app now runs both in the simulator and on my iPhone.
I am trying to implement Stripe Payment Gateway in my iOS application. Which is on Xcode 8.2 with 10.2 simulator.
My application Build getting successful. But after building it, It says.
dyld: Library not loaded: #rpath/Stripe.framework/Stripe
Referenced from:
/Users/user/Library/Developer/CoreSimulator/Devices/D27A4EC3-3B8A-4BBC-AB30-E9313AD95E1E/data/Containers/Bundle/Application/225274C8-EB99-476A-88A3-6F9981948220/Test App.app/Test App
Reason: image not found
Here is Bit of Code
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
registerForPushNotifications(application)
spinnerInitialization();
//STRIPE CONFIGURATION
Stripe.setDefaultPublishableKey("pk_test_YdACg6uENGmWrSWwAy00gWUx")
return true
}
Go to project select General and add your framework to Embedded Binaries section
I followed all the steps correctly to install Firebase to my iOS App and it still doesn't work. In the application method, I added FIRApp.configure() like so:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
FIRApp.configure()
return true
}
And I keep receiving NSException errors. Firebase seems to work on my Android Project, what's the deal with iOS?
I believe this is some sort of Swift 3 issue, because I encountered a similar problem. After looking over the internet, I believe that Firebase 3 hasn't updated to recent Swift Syntax located in Swift 3. Many other developers are having trouble with it as well. As an alternative, you could switch back from Xcode 8 and into 7, which would allow you to create your application which will work with current IOS, and when Firebase updates, it will be easy for you to migrate to Swift 3.
Hope this helps,
Morgan Gallant
I tried with CocoaPods and wound up with this issue after trying for hours and figured it was CocoaPods. Uninstalled CocoaPods and installed the SDK manually and wound up with the same issue.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
GAI.sharedInstance().trackerWithTrackingId("UA-XXXX-Y");
return true
}
This results in the error Use of unresolved identifier "GAI". I have a bridging header that imports the appropriate header files and all the required libraries included in my Build Phases. Please help!
Apparently I just needed to clear my derived data and restart Xcode. Xcode sucks sometimes. Ha. Thank you Björn Ro.