klaviyo / klaviyo-react-native-sdk

MIT License
5 stars 5 forks source link

Fixed Xcode-generated header file import #132

Closed ajaysubra closed 8 months ago

ajaysubra commented 8 months ago

Description

Fixed the issue where certain developers who were importing our SDK as a framework (over cocoapods default of static library) were facing issues with the Xcode-generated header file.

This was happening mainly for folks using firebase as it instructs developers to add a line to you pod file that in turn updates all the pods to be pulled in as frameworks. On inspection we found this apple doc that suggests using different header import syntax when importing a framework. It doesn't talk about libraries but we think that the syntax when our SDK is pulled in as a library (static or dynamic) is different.

As a fix, we included importing both formats to accommodate users pulling in our SDK as a framework and library by adding a conditional . The solution is similar to what was proposed in #78 but includes support for library import.

Check List

Changelog / Code Overview

Just a simple change but took forever to reproduce internally since our test apps were not using frameworks and importing our SDK as a library.

Test Plan

Related Issues/Tickets

https://github.com/klaviyo/klaviyo-react-native-sdk/issues/94 https://github.com/klaviyo/klaviyo-react-native-sdk/pull/78/files https://github.com/klaviyo/klaviyo-react-native-sdk/issues/129