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
Copy file name to clipboardExpand all lines: versioned_docs/version-3.0/flutter-present-onboardings.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,13 +110,38 @@ class MainActivity : FlutterFragmentActivity() {
110
110
111
111
## Loader during onboarding
112
112
113
-
By default, between the splash screen and onboarding, you will see the loading screen until the onboarding is fully loaded. However, if you want to make the transition smoother, you can override this in your Flutter app:
113
+
When presenting an onboarding, you may notice a short loading screen between your splash screen and the onboarding while the underlying view is being initialized. You can handle this in different ways depending on your needs.
114
114
115
-
- To customize the native loader on iOS, add `AdaptyOnboardingPlaceholderView.xib` to your Xcode project.
116
-
- For full control, overlay your own widget above `AdaptyUIOnboardingPlatformView` and hide it on `onDidFinishLoading`.
117
-
- To customize the native loader on Android, create `adapty_onboarding_placeholder_view.xml` in `res/layout` and define a placeholder there.
115
+
#### Control splash screen using onDidFinishLoading
118
116
119
-
This helps create seamless transitions and custom loading experiences.
117
+
:::note
118
+
This approach is only available when embedding the onboarding as a widget. It is not available for standalone screen presentation.
119
+
:::
120
+
121
+
The recommended cross-platform approach is to keep your splash screen or custom overlay visible until the onboarding is fully loaded, then hide it manually.
122
+
123
+
When using the embedded widget, overlay your own widget above it and hide the overlay when `onDidFinishLoading` fires:
124
+
125
+
```dart showLineNumbers title="Flutter"
126
+
AdaptyUIOnboardingPlatformView(
127
+
onboarding: onboarding,
128
+
onDidFinishLoading: (meta) {
129
+
// Hide your custom splash screen or overlay here
130
+
},
131
+
// ... other callbacks
132
+
)
133
+
```
134
+
135
+
### Customize native loader
136
+
137
+
:::important
138
+
This approach is platform-specific and requires maintaining native UI code. It's not recommended unless you already maintain separate native layers in your app.
139
+
:::
140
+
141
+
If you need to customize the default loader itself, you can replace it with platform-specific layouts. This approach requires separate implementations for Android and iOS:
142
+
143
+
-**iOS**: Add `AdaptyOnboardingPlaceholderView.xib` to your Xcode project
144
+
-**Android**: Create `adapty_onboarding_placeholder_view.xml` in `res/layout` and define a placeholder there
Copy file name to clipboardExpand all lines: versioned_docs/version-3.0/react-native-present-onboardings.md
+94Lines changed: 94 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,100 @@ try {
160
160
}
161
161
```
162
162
163
+
## Loader during onboarding
164
+
165
+
When presenting an onboarding in React Native, you may notice a short white flash or loading screen before the onboarding appears. This happens while the underlying native view is being initialized. You can handle this in different ways depending on your needs and your workflow.
166
+
167
+
#### Control splash screen using onFinishedLoading
168
+
169
+
:::note
170
+
This approach is only available when using the React component. It is not available for modal presentation.
171
+
:::
172
+
173
+
The recommended approach for React Native is to keep your splash screen or a custom overlay visible until the onboarding is fully loaded, then hide it manually.
174
+
175
+
When using the React component (`AdaptyOnboardingView`), wait for the `onFinishedLoading` event before hiding your splash screen or overlay:
176
+
177
+
<TabsgroupId="version"queryString>
178
+
<TabItemvalue="new"label="SDK version 3.14 or later"default>
Expo does not support placing custom native layouts (e.g., `res/layout` on Android). For Expo apps, controlling the splash screen or using a React Native overlay is the only viable solution.
244
+
:::
245
+
246
+
You can replace the native loader using platform-specific layouts on Android and iOS. However, this approach is usually less convenient for React Native apps:
247
+
248
+
- Requires separate Android and iOS implementations
249
+
- Not compatible with Expo (Expo doesn't allow adding custom native layouts)
250
+
- Higher maintenance cost
251
+
252
+
Define a placeholder for each platform:
253
+
254
+
-**iOS**: Add `AdaptyOnboardingPlaceholderView.xib` to your Xcode project
255
+
-**Android**: Create `adapty_onboarding_placeholder_view.xml` in `res/layout` and define a placeholder there
0 commit comments