Christian Sousa
04/03/2020, 11:40 AMGoogleTagManager
DataLayer in a kotlin multiplatform project, and I got it working for the Android easily.
Problem is with iOS, following their guide I need to use the GoogleTagManager cocoapod: https://developers.google.com/tag-manager/ios/v3/swift
I also needed to create a BridgingHeader as their tutorial says.
What I did was:
Create a BridgingHeader.framework myself, with the following headers that are here: https://github.com/jigish/GoogleTagManager/tree/master/GoogleTagManager/Library plus a BridgingHeader-umbrella.h as follows:
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "TAGManager.h"
#import "TAGContainer.h"
#import "TAGContainerOpener.h"
#import "TAGDataLayer.h"
#import "TAGLogger.h"
Added a module.modulemap like so:
framework module BridgingHeader {
export *
umbrella header "BridgingHeader-umbrella.h"
header "TAGContainer.h"
header "TAGContainerOpener.h"
header "TAGContainerOpener.h"
header "TAGDataLayer.h"
header "TAGLogger.h"
header "TAGManager.h"
}
And my BridgingHeader.def is:
language = Objective-C
modules = BridgingHeader
compilerOpts = -framework BridgingHeader
linkerOpts = -framework BridgingHeader
But it doesn’t seem right. Anyone had something similar like this that could provide some insight?
Also, thanks to @magnumrocha for his help with this issue before 🙂Kris Wong
04/03/2020, 1:14 PMmodules
in a DEF files, i've always told it where the headers are. you'll also likely need a header filter.