@namiml/expo-sdk 3.4.12-dev.202609251647 → 3.4.12-dev.202609252349
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +19 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/adapters/expo-device.adapter.ts +19 -1
package/dist/index.cjs
CHANGED
|
@@ -172,6 +172,24 @@ class ExpoDeviceAdapter {
|
|
|
172
172
|
return v.toString(16);
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Foreground = `AppState` going `active` after the app was in the `background` — Apple's
|
|
177
|
+
* `willEnterForeground`. A transient `inactive` (Control Center, an incoming call banner)
|
|
178
|
+
* that never reached `background` is not a resume.
|
|
179
|
+
*/
|
|
180
|
+
onAppForeground(listener) {
|
|
181
|
+
let wasBackgrounded = false;
|
|
182
|
+
const subscription = reactNative.AppState.addEventListener('change', (next) => {
|
|
183
|
+
if (next === 'background') {
|
|
184
|
+
wasBackgrounded = true;
|
|
185
|
+
}
|
|
186
|
+
else if (next === 'active' && wasBackgrounded) {
|
|
187
|
+
wasBackgrounded = false;
|
|
188
|
+
listener();
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
return () => subscription.remove();
|
|
192
|
+
}
|
|
175
193
|
getScreenInfo() {
|
|
176
194
|
const { width, height, scale } = reactNative.Dimensions.get('window');
|
|
177
195
|
return { width, height, scale };
|