Google Analytics Track Screen(UIViewController) inside Pod Library - ios

I have integrated MWPhotoBrowser in my app using CocaPods. I am using Google Analytics V3 and I have to track if user visit images open by MWPhotoBrowser. I can not import following files in Cocoa pods library file MWPhotoBrowser.m
#import "GAIFields.h"
#import "GAIFields.h"
#import "GAIDictionaryBuilder.h"
Any workaround for this?

The easiest workaround would probably be to subclass MWPhotoBrowser inside of your project and add the Google Analytics tracking there instead of in MWPhotoBrowser.m directly.

Related

App can't import bridging header and find Google/Analytics.h when running in Release Configuration

So I'm trying to set up the debug/release configurations in the app I'm working on. When trying to test the Release configuration, the app won't build. Says: Can't import bridging header and 'Google/Analytics.h' file not found. But this is only when running in release.
Any ideas on what could be the problem?
Another option you could try replacing the header with these lines:
#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>
#import <GoogleAnalytics/GAIFields.h>
Found it from their reference sample app: Google Analytics iOS Quickstart app

Can't add Google Analytics iOS SDK without cocoa pods to my project

I would like to add the Google Analytics iOS SDK to my project but unfortunately it doesn't work. I'm not using Cocoa Pods, maybe that's the problem because Google says use it in the tutorial, but I can't use it in this project because of other reasons.
So that's how I tried:
I created the configuration file
I've added the GoogleService-info.plist
I've added the GoogleAnalytics/Library folder to my project and the libGoogleAnalyticsServices.a file
Then I added this to my AppDelegate.m
#import <Google/Analytics.h>
//...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Configure tracker from GoogleService-Info.plist.
NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, #"Error configuring Google services: %#", configureError);
return YES;
}
It's exactly from the tutorial, but when I try to run it I get an error that Google/Analytics.h file not found. I would really appreciate if somebody could tell me what's the problem, or somebody could explain me how can I setup the whole thing without cocoa pods (which files should I add from the zip.)
I was looking for the exact same thing just now. I found this very simple tutorial, it worked for me. Let me know if you need more help on this.
Following the tutorial posted by AntonyG won't do the trick unless you also add the following to your application target's linked libraries, as required by Google here:
CoreData.framework
SystemConfiguration.framework
libz.dylib
libsqlite3.dylib
#import <Google/Analytics.h> is only working if you use Cocoa Pods...
Try:
#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIFields.h"
#import "GAILogger.h"
Take a look at the link #AntonyG is giving! It will give you a step by step tutorial how to use Google Analytics without Cocoa Pods!

Can't use FBSDK

I'm writing login via Facebook in Swift app. I downloaded FacebookSDK, linked libs and created bridge header and added it to Objective-C bridging headers. Imported libraries in it:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
I tried to use classes, but have errors.
In AppDelegate.swift:
FBLoginView.self
Error: "use of unresolved identifier 'FBLoginView'"
Help me plz(
Try doing:
"import FBSDKCoreKit"
"import FBSDKLoginKit"
"import FBSDKShareKit"
at the top of your AppDelegate.swift
I hope that helps
Here is an example project using Facebook Login

Google Admob integration error

i use the latest version of SDK for iphone integration but it give me this error.
Remove the AdMob Framework from your project, clean your project, and import the AdMob Framework again.
and Download the Framework here enter link description here
#import <GoogleMobileAds/GADBannerView.h>
#import <GoogleMobileAds/GADRequest.h>
As it's now a Framework. You have to include it like this : #import GoogleMobileAds;

Google AdMob error in iOS 7

I've integrated AdMob in my iOS project but it gives me the following error.
module 'GoogleMobileAds' not found
I have already imported the AdMob SDK into my project and added the following import.
#import GoogleMobileAds;
In the Build Settings of you project set the Define Modules to YES. Then, remove the AdMob Framework from your project, clean your project, and import the AdMob Framework again.
Change the import calls:
#import GoogleMobileAds
to this
#import <GoogleMobileAds/GoogleMobileAds.h>

Resources