Problem in updating Google-Mobile-Ads-SDK for iOS - ios

I want to update the Google-Mobile-Ads-SDK pod for removing the instances of UIWebView, but according to the documentation link, there needs to be a GADApplicationIdentifier that has to be added to the Info.plist file in order to initialise the SDK properly. I don't have an admob account, I only use Ad-Manager for showing native ads in the app. Is there any other way to update the SDK without adding the GADApplicationIdentifier in Info.plist

Got the solution for this:
If you don't have an AdMob account and you are showing the ads using AdManager, then you can add the following key GADIsAdManagerApp to YES in your Info.plist, to initialise the Ads SDK properly with the latest version

Related

Does Google AdMob Require Info.plist exactly?

I am trying to set up Google AdMobs on a project that I have already set Firebase up in. I have been trying to follow the Update your info.plist section of the AdMob documentation here: https://developers.google.com/admob/ios/quick-start#swift
but I keep getting the "reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions at https://googlemobileadssdk.page.link/admob-ios-update-plist to set a valid application ID. Google Ad Manager publishers, follow instructions at https://googlemobileadssdk.page.link/ad-manager-ios-update-plist." Error.
I am wondering if it is because my plist is named GoogleService-Info.plist rather than Info.plist (This is the name given by default when I first began using Firebase). If I try to rename the file to just Info.plist, the firestore part of my project breaks. Does AdMob require Info.plist to be named exactly that?
I found that it does matter what plist I add Google AdMob to. XCode 13 got rid of the Info.plist but you can manually create an info.plist by following this guide: https://betterprogramming.pub/info-plist-is-missing-in-xcode-13-heres-how-to-get-it-back-1a7abf3e2514
Pasting to info.plist solved the issue for me.
I would recommend you to dig more about Info.plist. See this official docs and this medium blog.
First, Info.plist and GoogleService-Info.plist are used for different purposes. If you rename those files some of the service will break surely.
Second, Even if XCode 13, there is Info.plist(though you can't see in project navigator for fresh project). See this medium blog how to configure Info.plist for XCode 13

Swift youtube ios helper podfile 'sharedApplication' is unavailable: not available on iOS (App Extension)

After adding OneSignal to the project I get the following errors. I have tried Require Only AppExtension-Safe API to No in this pod file's settings and build successed but youtube pod file's functionality has broken, it does not open youtube videos after setting to no.
Could anyone give advice on how to solve this error? Thanks.
OneSignal target build phases.
It looks like you are building both an app and an app extension. An app extension is standalone, it doesn’t have access for example to the app delegate. Solution: Don’t try to use the app delegate. It won’t compile. Check what files you include in your app extension target. Don’t include files that use the app delegate.

Crash when adding AdMob to Firebase project

I've got an iOS project using Firebase, it's working fine. However, when I try to add AdMob, the app crashes when launching:
"'GADInvalidInitializationException', reason: 'The Google Mobile Ads
SDK was initialized incorrectly. Google AdMob publishers should follow
instructions here:
https://googlemobileadssdk.page.link/admob-ios-update-plist to include
the AppMeasurement framework, set the -ObjC linker flag, and set
GADApplicationIdentifier with a valid App ID. Google Ad Manager
publishers should follow instructions here:
https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'"
Just by adding pod 'Firebase/AdMob' to the Podfile already produces this crash.
Then I added GADApplicationIdentifier to the GoogleService-Info.plist:
<key>GADApplicationIdentifier</key>
<string>APP_KEY</string>
Same thing, crash.
The app is linked to Firebase in the AdMob app site.
Anybody has any tips on this? Google's docs don't seem to be up to date, making a lot of confusion about AdMob implementation with/without Firebase.
Update the app's Info.plist - the file set in the INFOPLIST_FILE Build Setting - not GoogleService-Info.plist.
Info.plist add following line not GoogleService-Info.plist.
<key>GADIsAdManagerApp</key>
<true/>
also add key of Google Ads Mob
<key>GADApplicationIdentifier</key>
<string>key-value</string>

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.

iOS 9 canOpenURL error for ADAL login

This just stopped working in XCode 7.2.1 building against 9.2.1.
I'm using Microsoft ADAL from cocoapods.
This is the error:
canOpenURL: failed for URL: "msauth://broker" - error: "(null)"
I've already added msauth to my Info.plist file under LSApplicationQueriesSchemes.
I think I am going to downgrade to XCode 7 to see if that works.
Edit: I added the LSApplicationQueriesSchemes item to the MS ADAL cocoapod and now it's returning data but still giving the same error.
It appears that for libraries within your iOS projects, the library's Info.plist needs to be updated to handle any custom URL schemes that the library may call canOpenUrl for. So if you have this issue, add the custom scheme to LSApplicationQueriesSchemes in the library's Info.plist, not the application's Info.plist.
On a real device it works, it's just weird output of the simulator.
Because it not able get some property settings on simulator.Please check on real device.

Resources