Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Xcode-generated header file import #132

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

ajaysubra
Copy link
Collaborator

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

  • 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.

Related Issues/Tickets

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

@ajaysubra ajaysubra requested a review from a team as a code owner March 7, 2024 18:28
@ajaysubra ajaysubra requested review from evan-masseau and removed request for a team March 7, 2024 18:28
@@ -1,5 +1,10 @@
#import "KlaviyoReactNativeSdk.h"
#import <klaviyo_react_native_sdk-Swift.h>
#if __has_include(<klaviyo_react_native_sdk/klaviyo_react_native_sdk-Swift.h>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@evan-masseau evan-masseau requested review from a team and kennyklaviyo and removed request for a team March 8, 2024 17:33
@ajaysubra ajaysubra merged commit a8d1086 into master Mar 8, 2024
5 checks passed
@ajaysubra ajaysubra deleted the as/chnl-6305-swift-header-issue branch March 8, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants