Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods iOS - [!] Google has been deprecated - How to get rid of the warning?

Tags:

ios

cocoapods

Steps I did:

  1. pod repo remove master

  2. pod setup

  3. pod update --verbose (Just to check the progress especially when updating the Google SDKs, took so long to finish).

And there, I got the warning. In my logs, Google SDKs were updated successfully:

-> Installing Google 3.1.0 (was 3.0.3)

-> Installing GoogleMaps 2.3.0 (was 2.2.0)

Podfile:

target 'MyProj' do

    ...
    pod 'Google/Analytics'
    pod 'GoogleMaps'
    ...
    target 'MyProjTests' do
        inherit! :search_paths
    end

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
    end
end

enter image description here

I would like to know how to get rid of this warning.

like image 395
Glenn Posadas Avatar asked Jun 14 '17 07:06

Glenn Posadas


2 Answers

Change pod 'Google/Analytics' to pod 'GoogleAnalytics' removing the slash.

like image 113
Paul Beusterien Avatar answered Nov 04 '22 18:11

Paul Beusterien


Extending on Paul Beusterien answer:

First, remove old import from your bridging header:

#import <Google/Analytics.h>

Then, add the following to the bridging header instead:

#import "GAI.h"
#import "GAIDictionaryBuilder.h"
#import "GAIEcommerceFields.h"
#import "GAIEcommerceProduct.h"
#import "GAIEcommerceProductAction.h"
#import "GAIEcommercePromotion.h"
#import "GAIFields.h"
#import "GAILogger.h"
#import "GAITrackedViewController.h"
#import "GAITracker.h"

Finally you might want to recheck: https://developers.google.com/analytics/devguides/collection/ios/v3/

You don't need GGLContext line anymore.

Hope this helps.

like image 43
agfa555 Avatar answered Nov 04 '22 18:11

agfa555