Skip to content

Commit d62d1f4

Browse files
Fixed iOS Build Issues with Static Frameworks (#1195)
1 parent f06fdd1 commit d62d1f4

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

example/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ RUBY VERSION
113113
ruby 2.6.10p210
114114

115115
BUNDLED WITH
116-
1.17.2
116+
2.6.9

ios/A0Auth0.mm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@
22

33
#import <React/RCTUtils.h>
44

5-
#import "A0Auth0-Swift.h"
5+
/**
6+
* This preprocessor directive resolves the static linking issue by ensuring
7+
* the correct import of the Swift header file generated for the A0Auth0 module.
8+
* It checks for the presence of the header file in different locations:
9+
* 1. If the header is available in the framework's module path (<A0Auth0/A0Auth0-Swift.h>),
10+
* it imports it from there.
11+
* 2. As a fallback, it imports the header from the local path to ensure compatibility.
12+
*/
13+
#if __has_include(<A0Auth0/A0Auth0-Swift.h>)
14+
#import <A0Auth0/A0Auth0-Swift.h>
15+
#else
16+
#import "A0Auth0-Swift.h"
17+
#endif
18+
619
#define ERROR_CANCELLED @{@"error": @"a0.session.user_cancelled",@"error_description": @"User cancelled the Auth"}
720
#define ERROR_FAILED_TO_LOAD @{@"error": @"a0.session.failed_load",@"error_description": @"Failed to load url"}
821

0 commit comments

Comments
 (0)