You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* removed registeration of sdks
* Update expo.md with expo to support CNG with static frameworks configuration
* addressed review comments and made relevant changes in read me
* Added a note for Expo support in Installation Guide.
---------
Co-authored-by: akhiljain1907 <[email protected]>
The Adobe Experience Platform Mobile SDK for React Native is compatible with the latest stable version of Expo. Using the most recent version of Expo is recommended to avoid any issues.
4
-
5
3
-[Guide for Expo apps](#guide-for-expo-apps)
6
4
-[Guide for bare React Native apps using Expo modules](#guide-for-bare-react-native-apps-using-expo-modules)
7
5
8
6
# Guide for Expo apps
9
7
10
-
> [!NOTE]
11
-
> A simplified solution for SDK integrated with Expo is currently in development and expected to be available in the next couple of months. You may proceed with the current steps or choose to wait for the updated version if you prefer a more streamlined setup.
12
-
13
8
## Overview
14
-
Expo projects can use both third-party React Native libraries with native code and custom native code. Creating a development build with Expo CLI allows inclusion of specific native dependencies and customizations.
15
-
16
-
Initializing the Adobe Mobile SDK requires native code implementation. In Expo projects, Continuous Native Generation (CNG) is enabled by default, meaning the `Android` and `iOS` directories for native code and configuration are not included. To integrate the Mobile SDK, CNG must be disabled, and the `Android` and `iOS` directories must be generated and managed manually.
9
+
With the release of the simplification SDK support, Expo projects now support Continuous Native Generation (CNG) without requiring native code modifications. The SDK extensions are now registered through Mobile Core's initialize API, eliminating the need to disable CNG or manually manage native directories.
17
10
18
11
## Installation
19
12
20
-
To generate these directories, run
21
-
```bash
22
-
npx expo prebuild
23
-
```
24
-
Alternatively, compile the app locally:
25
-
```bash
26
-
# Build your native Android project
27
-
npx expo run:android
28
-
# Build your native iOS project
29
-
npx expo run:ios
30
-
```
31
-
32
-
## Install Adobe Mobile SDKs
33
-
34
-
Refer to the [Installation Guide](../README.md#Installation) to install Adobe SDKs after the android and ios directories are generated.
35
-
36
-
## Initialize Adobe Mobile SDKs
37
-
Initializing the Mobile SDK involves implementing native code. The following code snippets show how to install and register the Mobile Core and Edge Network extensions. Documentation on how to initialize each extension can be found in _./packages/{extension}/README.md_.
13
+
### Prerequisites
14
+
To prevent C++ module import errors during the iOS build process, we need to configure useFrameworks: "static" using the expo-build-properties package. This is a required step for proper Adobe SDK integration with Expo.
38
15
39
-
##### **iOS**
40
-
41
-
Create a separate header and Objective-C file to handle the Adobe SDK setup, then import this file into the `AppDelegate` to initialize the SDK when the app launches.
42
-
43
-
AdobeBridge.h
44
-
```objective-c
45
-
#import<UIKit/UIKit.h>
46
-
#import<Foundation/Foundation.h>
47
-
@interfaceAdobeBridge : NSObject
48
-
+ (void)configure: (UIApplicationState)state;
49
-
+ (void)lifecycleStart;
50
-
+ (void)lifecyclePause;
51
-
@end
16
+
#### Install the required package:
17
+
```bash
18
+
npx expo install expo-build-properties
52
19
```
53
20
54
-
AdobeBridge.m
55
-
```objective-c
56
-
#import "AdobeBridge.h"
57
-
#import <UIKit/UIKit.h>
58
-
59
-
@import AEPCore;
60
-
@import AEPLifecycle;
61
-
@import AEPEdge;
62
-
@import AEPEdgeIdentity;
63
-
@import AEPEdgeConsent;
64
-
@import AEPServices;
65
-
66
-
@implementation AdobeBridge
67
-
68
-
+ (void)configure: (UIApplicationState)appState
21
+
#### Configuration
22
+
Add the following plugin configuration to your `app.json` or `app.config.json`:
> To support Expo CNG and use Mobile Core's initialize API (simplification SDK support), All aep sdks should have 7.x versions except places should have 7.0.1 version or higher.
Extensions are now registered through Mobile Core's initialize API (no native code required). Refer to the [Initialization Guide](../README.md#initializing) to initialize Adobe SDKs.
123
49
124
-
// Setup for Lifecycle Start when entering background
To apply these build properties and include the installed SDKs in your native projects, run:
53
+
```bash
54
+
npx expo prebuild
131
55
```
132
56
133
-
> For further details on Lifecycle implementation, please refer to the [Lifecycle API documentation](https://github.com/adobe/aepsdk-react-native/tree/main/packages/core#lifecycle).
57
+
This will generate the native iOS and Android projects with the configured build properties and SDKs.
134
58
135
-
> [!TIP]
136
-
> If the following build error occurs when running the iOS application after Mobile SDK installation:
137
-
>
138
-
> ```
139
-
> ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
140
-
> ```
141
-
>
142
-
> This is because the Mobile SDK now requires the app to use Swift interfaces. Adding a placeholder `.swift` file to the project embeds the Swift standard libraries. See the SampleApp in this repository for an example.
59
+
After generating the native projects, you can build and run the app:
143
60
144
-
##### **Android:** _(Kotlin)_
145
-
146
-
Please refer to the [Android section](../README.md#kotlin) for initialization code.
61
+
```bash
62
+
# Build and run on Android
63
+
npx expo run:android
64
+
# Build and run on iOS
65
+
npx expo run:ios
66
+
```
147
67
148
68
# Guide for bare React Native apps using Expo modules
149
-
150
69
## Overview
151
70
Bare React Native workflows can be integrated with Expo SDKs by using the `install-expo-modules` command. This allows you to use Expo modules in your app.
152
71
153
72
To use Expo modules in an app, installation and configuration of the `expo` package is required. The `expo` package has a small footprint; it includes only a minimal set of packages needed in nearly every app and the module and autolinking infrastructure that other Expo SDK packages are built with. After the `expo` package is installed and configured in the project, `npx expo install` can be used to add any other Expo module from the SDK.
154
73
155
-
156
74
## Installation
157
75
- To install and use Expo modules, the easiest way to get up and running is with the `install-expo-modules` command.
- If the command fails, please follow the manual installation [instructions](https://docs.expo.dev/bare/installing-expo-modules/#manual-installation).
162
80
163
81
## Install Adobe Mobile SDKs
164
-
165
82
Refer to the [Installation Guide](../README.md#Installation) to install Adobe SDKs.
166
83
167
84
## Initialize Adobe Mobile SDKs
168
-
169
-
Refer to the [Initialization Guide](../README.md#initializing) to initialize Adobe SDKs.
85
+
Extensions are now registered through Mobile Core's initialize API (no native code required). Refer to the [Initialization Guide](../README.md#initializing) to initialize Adobe SDKs.
170
86
171
87
# Troubleshooting and Known Issues
172
-
1.`Import of C++ module` error when building on iOS
88
+
## iOS Build Issues (Legacy)
89
+
The following issues are automatically resolved when using the `expo-build-properties` plugin with `useFrameworks: "static"` as described in the [Prerequisites](../README.md#prerequisites) section:
173
90
174
-
When facing the following error:
91
+
### 1. `Import of C++ module` error when building on iOS
92
+
**Note**: This error is automatically resolved with the static frameworks configuration.
93
+
94
+
For legacy projects not using the recommended configuration, the error appears as:
175
95
```xcode
176
96
error: import of C++ module 'Foundation' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]
177
97
```
178
-
**Fix**: In XCode, select your app target, go to **Build Settings** and under `Apple CLang - Custom Compiler Flags`, locate `Other C++ Flags`, and add:
98
+
**Legacy Fix**: In XCode, select your app target, go to **Build Settings** and under `Apple CLang - Custom Compiler Flags`, locate `Other C++ Flags`, and add:
179
99
```bash
180
100
-Wno-module-import-in-extern-c
181
101
```
182
102
<imgwidth="936"alt="Xcode Screenshot"src="./resources/xcode c++ flag screenshot.png">
183
103
184
-
2.`Use of undeclared identifier 'AEPMobileCore'` error when building on iOS
104
+
### 2. `Use of undeclared identifier 'AEPMobileCore'` error when building on iOS
105
+
**Note**: This error is automatically resolved with the static frameworks configuration.
185
106
186
-
When facing the following error:
187
-
```xcode
188
-
error: Use of undeclared identifier 'AEPMobileCore'
189
-
```
190
-
Refer to the solution [here](https://github.com/adobe/aepsdk-react-native/issues/346#issuecomment-2109949661).
107
+
For legacy projects, refer to the solution [here](https://github.com/adobe/aepsdk-react-native/issues/346#issuecomment-2109949661).
191
108
192
109
## Other known issues with React Native
193
-
Refer to [Troubleshooting and Known Issues](../README.md#troubleshooting-and-known-issues) for other known issues with React Native integration.
110
+
Refer to [Troubleshooting and Known Issues](../README.md#troubleshooting-and-known-issues) for other known issues with React Native integration.
0 commit comments