This guide helps to migrate from the 3.X version to the 4.X version

Modify the Podfile

Modify the Podfile dependencies:

  • The sources are now available on forge.herow.io
  • Replace the AdtagLocationBeacon dependency by the HerowLocationDetection
 source 'https://github.com/CocoaPods/Specs.git'
 source 'https://forge.adtag.eu/pub/Specs'

 platform :ios, '9.0'

 target 'yourApp' do
     use_frameworks!
     pod "HerowLocationDetection", '4.1'
 end

Update the code

Renaming

All dependecies and objects starting with "Adtag" starts now with "Herow"

These changes mainly impact the following packages:

  • AdtagConnection -> HerowConnection
  • AdtagLocationBeacon -> HerowLocationDetection
  • AdtagAnalytics -> HerowAnalytics
  • AdtagScanProximity -> HerowScanProximity

These changes mainly impact the following Objects:

  • AdtagInitializer -> HerowInitializer
  • AdtagBeaconManager -> HerowDetectionManager

Detecting foreground / background state

The SDK now detects automatically the foreground and background state.

  • You must remove from the AppDelegate the call to the onAppInBackground and onAppInForeground methods from the Adtag/HerowInitializer

Switch to Swift

- (void) applicationWillResignActive:(UIApplication *)application {
    //To be removed
    [adtagInitializer onAppInBackground];
}
func applicationWillResignActive(_ application: UIApplication) {
    //To be removed
    adtagInitializer?.onAppInBackground()
}

Switch to Swift
<!--{.btn-switch.swift}-->

```objectivec
- (void) applicationDidBecomeActive:(UIApplication *)application {
    //To be removed
    [adtagInitializer onAppInForeground];
}
func applicationDidBecomeActive(_ application: UIApplication) {
     //To be removed
     adtagInitializer?.onAppInForeground()
}

Configuring the Notification Analytics

From iOs 10 and later, the SDK now detects automatically the opening of the notification.

Do not call anymore the didReceivePlaceNotification method of the Adtag/HerowInitializer in your UNUserNotificationCenterDelegate.

Otherwise, your opening notification statistic will be duplicated.

Nevertheless, be sure to register your UNUserNotificationCenterDelegate before the call of the HerowInitializer.synchronize method.

Connecting to the Adtag platform

The url types to connect to the Adtag platform are now preProdAdtag and prodAdtag.

Think to update the url type when initializing the SDK.

If you are not sure if your application still have to connect to the prod platform or the prod Adtag platform, please contact our support team.