https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

Christian Sousa

04/03/2020, 11:40 AM
Hello guys, I’m trying to get the
GoogleTagManager
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:
Copy code
#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:
Copy code
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:
Copy code
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 🙂
👍 1
k

Kris Wong

04/03/2020, 1:14 PM
i am not familiar with
modules
in a DEF files, i've always told it where the headers are. you'll also likely need a header filter.
2 Views