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
Are you changing anything with the public API? ⛔
Are your changes backwards compatible with previous SDK Versions? ⛔
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
Tested in - example app in this repo, internal test app and also tested on various older versions of react native using an internal automated script.
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