0) {
129 | println "android.packagingOptions.$prop += $options ($options.length)"
130 | // Ex: android.packagingOptions.pickFirsts += '**/SCCS/**'
131 | options.each {
132 | android.packagingOptions[prop] += it
133 | }
134 | }
135 | }
136 |
137 | dependencies {
138 | // The version of react-native is set by the React Native Gradle Plugin
139 | implementation("com.facebook.react:react-android")
140 |
141 | def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
142 | def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
143 | def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
144 | def frescoVersion = rootProject.ext.frescoVersion
145 |
146 | // If your app supports Android versions before Ice Cream Sandwich (API level 14)
147 | if (isGifEnabled || isWebpEnabled) {
148 | implementation("com.facebook.fresco:fresco:${frescoVersion}")
149 | implementation("com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}")
150 | }
151 |
152 | if (isGifEnabled) {
153 | // For animated gif support
154 | implementation("com.facebook.fresco:animated-gif:${frescoVersion}")
155 | }
156 |
157 | if (isWebpEnabled) {
158 | // For webp support
159 | implementation("com.facebook.fresco:webpsupport:${frescoVersion}")
160 | if (isWebpAnimatedEnabled) {
161 | // Animated webp support
162 | implementation("com.facebook.fresco:animated-webp:${frescoVersion}")
163 | }
164 | }
165 |
166 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
167 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
168 | exclude group:'com.squareup.okhttp3', module:'okhttp'
169 | }
170 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
171 |
172 | if (hermesEnabled.toBoolean()) {
173 | implementation("com.facebook.react:hermes-android")
174 | } else {
175 | implementation jscFlavor
176 | }
177 | }
178 |
179 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
180 | applyNativeModulesAppBuildGradle(project)
181 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # react-native-reanimated
11 | -keep class com.swmansion.reanimated.** { *; }
12 | -keep class com.facebook.react.turbomodule.** { *; }
13 |
14 | # Add any project specific keep options here:
15 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/expo/modules/foregroundactions/example/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package expo.modules.foregroundactions.example;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
21 | import com.facebook.react.ReactInstanceEventListener;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | /**
28 | * Class responsible of loading Flipper inside your React Native application. This is the debug
29 | * flavor of it. Here you can add your own plugins and customize the Flipper setup.
30 | */
31 | public class ReactNativeFlipper {
32 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
33 | if (FlipperUtils.shouldEnableFlipper(context)) {
34 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
35 |
36 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
37 | client.addPlugin(new DatabasesFlipperPlugin(context));
38 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
39 | client.addPlugin(CrashReporterPlugin.getInstance());
40 |
41 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
42 | NetworkingModule.setCustomClientBuilder(
43 | new NetworkingModule.CustomClientBuilder() {
44 | @Override
45 | public void apply(OkHttpClient.Builder builder) {
46 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
47 | }
48 | });
49 | client.addPlugin(networkFlipperPlugin);
50 | client.start();
51 |
52 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
53 | // Hence we run if after all native modules have been initialized
54 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
55 | if (reactContext == null) {
56 | reactInstanceManager.addReactInstanceEventListener(
57 | new ReactInstanceEventListener() {
58 | @Override
59 | public void onReactContextInitialized(ReactContext reactContext) {
60 | reactInstanceManager.removeReactInstanceEventListener(this);
61 | reactContext.runOnNativeModulesQueueThread(
62 | new Runnable() {
63 | @Override
64 | public void run() {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | });
68 | }
69 | });
70 | } else {
71 | client.addPlugin(new FrescoFlipperPlugin());
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/expo/modules/foregroundactions/example/MainActivity.java:
--------------------------------------------------------------------------------
1 | package expo.modules.foregroundactions.example;
2 |
3 | import android.os.Build;
4 | import android.os.Bundle;
5 |
6 | import com.facebook.react.ReactActivity;
7 | import com.facebook.react.ReactActivityDelegate;
8 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
9 | import com.facebook.react.defaults.DefaultReactActivityDelegate;
10 |
11 | import expo.modules.ReactActivityDelegateWrapper;
12 |
13 | public class MainActivity extends ReactActivity {
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | // Set the theme to AppTheme BEFORE onCreate to support
17 | // coloring the background, status bar, and navigation bar.
18 | // This is required for expo-splash-screen.
19 | setTheme(R.style.AppTheme);
20 | super.onCreate(null);
21 | }
22 |
23 | /**
24 | * Returns the name of the main component registered from JavaScript.
25 | * This is used to schedule rendering of the component.
26 | */
27 | @Override
28 | protected String getMainComponentName() {
29 | return "main";
30 | }
31 |
32 | /**
33 | * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
34 | * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
35 | * (aka React 18) with two boolean flags.
36 | */
37 | @Override
38 | protected ReactActivityDelegate createReactActivityDelegate() {
39 | return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(
40 | this,
41 | getMainComponentName(),
42 | // If you opted-in for the New Architecture, we enable the Fabric Renderer.
43 | DefaultNewArchitectureEntryPoint.getFabricEnabled()));
44 | }
45 |
46 | /**
47 | * Align the back button behavior with Android S
48 | * where moving root activities to background instead of finishing activities.
49 | * @see onBackPressed
50 | */
51 | @Override
52 | public void invokeDefaultOnBackPressed() {
53 | if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
54 | if (!moveTaskToBack(false)) {
55 | // For non-root activities, use the default implementation to finish them.
56 | super.invokeDefaultOnBackPressed();
57 | }
58 | return;
59 | }
60 |
61 | // Use the default back button implementation on Android S
62 | // because it's doing more than {@link Activity#moveTaskToBack} in fact.
63 | super.invokeDefaultOnBackPressed();
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/expo/modules/foregroundactions/example/MainApplication.java:
--------------------------------------------------------------------------------
1 | package expo.modules.foregroundactions.example;
2 |
3 | import android.app.Application;
4 | import android.content.res.Configuration;
5 | import androidx.annotation.NonNull;
6 |
7 | import com.facebook.react.PackageList;
8 | import com.facebook.react.ReactApplication;
9 | import com.facebook.react.ReactNativeHost;
10 | import com.facebook.react.ReactPackage;
11 | import com.facebook.react.config.ReactFeatureFlags;
12 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
13 | import com.facebook.react.defaults.DefaultReactNativeHost;
14 | import com.facebook.soloader.SoLoader;
15 |
16 | import expo.modules.ApplicationLifecycleDispatcher;
17 | import expo.modules.ReactNativeHostWrapper;
18 |
19 | import java.util.List;
20 |
21 | public class MainApplication extends Application implements ReactApplication {
22 |
23 | private final ReactNativeHost mReactNativeHost =
24 | new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
25 | @Override
26 | public boolean getUseDeveloperSupport() {
27 | return BuildConfig.DEBUG;
28 | }
29 |
30 | @Override
31 | protected List getPackages() {
32 | @SuppressWarnings("UnnecessaryLocalVariable")
33 | List packages = new PackageList(this).getPackages();
34 | // Packages that cannot be autolinked yet can be added manually here, for example:
35 | // packages.add(new MyReactNativePackage());
36 | return packages;
37 | }
38 |
39 | @Override
40 | protected String getJSMainModuleName() {
41 | return ".expo/.virtual-metro-entry";
42 | }
43 |
44 | @Override
45 | protected boolean isNewArchEnabled() {
46 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
47 | }
48 |
49 | @Override
50 | protected Boolean isHermesEnabled() {
51 | return BuildConfig.IS_HERMES_ENABLED;
52 | }
53 | });
54 |
55 | @Override
56 | public ReactNativeHost getReactNativeHost() {
57 | return mReactNativeHost;
58 | }
59 |
60 | @Override
61 | public void onCreate() {
62 | super.onCreate();
63 | SoLoader.init(this, /* native exopackage */ false);
64 | if (!BuildConfig.REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS) {
65 | ReactFeatureFlags.unstable_useRuntimeSchedulerAlways = false;
66 | }
67 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
68 | // If you opted-in for the New Architecture, we load the native entry point for this app.
69 | DefaultNewArchitectureEntryPoint.load();
70 | }
71 | ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
72 | ApplicationLifecycleDispatcher.onApplicationCreate(this);
73 | }
74 |
75 | @Override
76 | public void onConfigurationChanged(@NonNull Configuration newConfig) {
77 | super.onConfigurationChanged(newConfig);
78 | ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-hdpi/splashscreen_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/drawable-hdpi/splashscreen_image.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-mdpi/splashscreen_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/drawable-mdpi/splashscreen_image.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/drawable-xhdpi/splashscreen_image.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
21 |
22 |
23 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/splashscreen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #ffffff
3 | #ffffff
4 | #023c69
5 | #ffffff
6 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | expo-foreground-actions-example
3 | contain
4 | false
5 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
17 |
--------------------------------------------------------------------------------
/example/android/app/src/release/java/expo/modules/foregroundactions/example/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package expo.modules.foregroundactions.example;
8 |
9 | import android.content.Context;
10 | import com.facebook.react.ReactInstanceManager;
11 |
12 | /**
13 | * Class responsible of loading Flipper inside your React Native application. This is the release
14 | * flavor of it so it's empty as we don't want to load Flipper.
15 | */
16 | public class ReactNativeFlipper {
17 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
18 | // Do nothing as we don't want to initialize Flipper on Release.
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'
6 | minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
7 | compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '33')
8 | targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')
9 | kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'
10 | frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'
11 |
12 | // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
13 | ndkVersion = "23.1.7779620"
14 | }
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | dependencies {
20 | classpath('com.android.tools.build:gradle:7.4.2')
21 | classpath('com.facebook.react:react-native-gradle-plugin')
22 | }
23 | }
24 |
25 | allprojects {
26 | repositories {
27 | maven {
28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
29 | url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
30 | }
31 | maven {
32 | // Android JSC is installed from npm
33 | url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist'))
34 | }
35 |
36 | google()
37 | mavenCentral()
38 | maven { url 'https://www.jitpack.io' }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 |
25 | # Automatically convert third-party libraries to use AndroidX
26 | android.enableJetifier=true
27 |
28 | # Version of flipper SDK to use with React Native
29 | FLIPPER_VERSION=0.182.0
30 |
31 | # Use this property to specify which architecture you want to build.
32 | # You can also override it from the CLI using
33 | # ./gradlew -PreactNativeArchitectures=x86_64
34 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
35 |
36 | # Use this property to enable support to the new architecture.
37 | # This will allow you to use TurboModules and the Fabric render in
38 | # your application. You should enable this flag either if you want
39 | # to write custom TurboModules/Fabric components OR use libraries that
40 | # are providing them.
41 | newArchEnabled=false
42 |
43 | # Use this property to enable or disable the Hermes JS engine.
44 | # If set to false, you will be using JSC instead.
45 | hermesEnabled=true
46 |
47 | # Enable GIF support in React Native images (~200 B increase)
48 | expo.gif.enabled=true
49 | # Enable webp support in React Native images (~85 KB increase)
50 | expo.webp.enabled=true
51 | # Enable animated webp support (~3.4 MB increase)
52 | # Disabled by default because iOS doesn't support animated webp
53 | expo.webp.animated=false
54 |
55 | # Enable network inspector
56 | EX_DEV_CLIENT_NETWORK_INSPECTOR=true
57 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | #
21 | # Gradle start up script for POSIX generated by Gradle.
22 | #
23 | # Important for running:
24 | #
25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
26 | # noncompliant, but you have some other compliant shell such as ksh or
27 | # bash, then to run this script, type that shell name before the whole
28 | # command line, like:
29 | #
30 | # ksh Gradle
31 | #
32 | # Busybox and similar reduced shells will NOT work, because this script
33 | # requires all of these POSIX shell features:
34 | # * functions;
35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37 | # * compound commands having a testable exit status, especially «case»;
38 | # * various built-in commands including «command», «set», and «ulimit».
39 | #
40 | # Important for patching:
41 | #
42 | # (2) This script targets any POSIX shell, so it avoids extensions provided
43 | # by Bash, Ksh, etc; in particular arrays are avoided.
44 | #
45 | # The "traditional" practice of packing multiple parameters into a
46 | # space-separated string is a well documented source of bugs and security
47 | # problems, so this is (mostly) avoided, by progressively accumulating
48 | # options in "$@", and eventually passing that to Java.
49 | #
50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
52 | # see the in-line comments for details.
53 | #
54 | # There are tweaks for specific operating systems such as AIX, CygWin,
55 | # Darwin, MinGW, and NonStop.
56 | #
57 | # (3) This script is generated from the Groovy template
58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59 | # within the Gradle project.
60 | #
61 | # You can find Gradle at https://github.com/gradle/gradle/.
62 | #
63 | ##############################################################################
64 |
65 | # Attempt to set APP_HOME
66 |
67 | # Resolve links: $0 may be a link
68 | app_path=$0
69 |
70 | # Need this for daisy-chained symlinks.
71 | while
72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73 | [ -h "$app_path" ]
74 | do
75 | ls=$( ls -ld "$app_path" )
76 | link=${ls#*' -> '}
77 | case $link in #(
78 | /*) app_path=$link ;; #(
79 | *) app_path=$APP_HOME$link ;;
80 | esac
81 | done
82 |
83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84 |
85 | APP_NAME="Gradle"
86 | APP_BASE_NAME=${0##*/}
87 |
88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137 |
138 | Please set the JAVA_HOME variable in your environment to match the
139 | location of your Java installation."
140 | fi
141 |
142 | # Increase the maximum file descriptors if we can.
143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144 | case $MAX_FD in #(
145 | max*)
146 | MAX_FD=$( ulimit -H -n ) ||
147 | warn "Could not query maximum file descriptor limit"
148 | esac
149 | case $MAX_FD in #(
150 | '' | soft) :;; #(
151 | *)
152 | ulimit -n "$MAX_FD" ||
153 | warn "Could not set maximum file descriptor limit to $MAX_FD"
154 | esac
155 | fi
156 |
157 | # Collect all arguments for the java command, stacking in reverse order:
158 | # * args from the command line
159 | # * the main class name
160 | # * -classpath
161 | # * -D...appname settings
162 | # * --module-path (only if needed)
163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
164 |
165 | # For Cygwin or MSYS, switch paths to Windows format before running java
166 | if "$cygwin" || "$msys" ; then
167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
169 |
170 | JAVACMD=$( cygpath --unix "$JAVACMD" )
171 |
172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
173 | for arg do
174 | if
175 | case $arg in #(
176 | -*) false ;; # don't mess with options #(
177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
178 | [ -e "$t" ] ;; #(
179 | *) false ;;
180 | esac
181 | then
182 | arg=$( cygpath --path --ignore --mixed "$arg" )
183 | fi
184 | # Roll the args list around exactly as many times as the number of
185 | # args, so each arg winds up back in the position where it started, but
186 | # possibly modified.
187 | #
188 | # NB: a `for` loop captures its iteration list before it begins, so
189 | # changing the positional parameters here affects neither the number of
190 | # iterations, nor the values presented in `arg`.
191 | shift # remove old arg
192 | set -- "$@" "$arg" # push replacement arg
193 | done
194 | fi
195 |
196 | # Collect all arguments for the java command;
197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198 | # shell script including quotes and variable substitutions, so put them in
199 | # double quotes to make sure that they get re-expanded; and
200 | # * put everything else in single quotes, so that it's not re-expanded.
201 |
202 | set -- \
203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
204 | -classpath "$CLASSPATH" \
205 | org.gradle.wrapper.GradleWrapperMain \
206 | "$@"
207 |
208 | # Stop when "xargs" is not available.
209 | if ! command -v xargs >/dev/null 2>&1
210 | then
211 | die "xargs is not available"
212 | fi
213 |
214 | # Use "xargs" to parse quoted args.
215 | #
216 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
217 | #
218 | # In Bash we could simply go:
219 | #
220 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
221 | # set -- "${ARGS[@]}" "$@"
222 | #
223 | # but POSIX shell has neither arrays nor command substitution, so instead we
224 | # post-process each arg (as a line of input to sed) to backslash-escape any
225 | # character that might be a shell metacharacter, then use eval to reverse
226 | # that process (while maintaining the separation between arguments), and wrap
227 | # the whole thing up as a single "set" statement.
228 | #
229 | # This will of course break if any of these variables contains a newline or
230 | # an unmatched quote.
231 | #
232 |
233 | eval "set -- $(
234 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
235 | xargs -n1 |
236 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
237 | tr '\n' ' '
238 | )" '"$@"'
239 |
240 | exec "$JAVACMD" "$@"
241 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if %ERRORLEVEL% equ 0 goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if %ERRORLEVEL% equ 0 goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | set EXIT_CODE=%ERRORLEVEL%
84 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
85 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
86 | exit /b %EXIT_CODE%
87 |
88 | :mainEnd
89 | if "%OS%"=="Windows_NT" endlocal
90 |
91 | :omega
92 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'expo-foreground-actions-example'
2 |
3 | apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
4 | useExpoModules()
5 |
6 | apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
7 | applyNativeModulesSettingsGradle(settings)
8 |
9 | include ':app'
10 | includeBuild(new File(["node", "--print", "require.resolve('@react-native/gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile())
11 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "expo": {
3 | "scheme": "myapp",
4 | "plugins": [
5 | [
6 | "./plugins/expo-foreground-actions"
7 | ]
8 | ],
9 | "name": "expo-foreground-actions-example",
10 | "slug": "expo-foreground-actions-example",
11 | "version": "1.0.0",
12 | "orientation": "portrait",
13 | "icon": "./assets/icon.png",
14 | "userInterfaceStyle": "light",
15 | "splash": {
16 | "image": "./assets/splash.png",
17 | "resizeMode": "contain",
18 | "backgroundColor": "#ffffff"
19 | },
20 | "assetBundlePatterns": [
21 | "**/*"
22 | ],
23 | "ios": {
24 | "supportsTablet": true,
25 | "bundleIdentifier": "expo.modules.foregroundactions.example"
26 | },
27 | "android": {
28 | "permissions": [
29 | "FOREGROUND_SERVICE",
30 | "WAKE_LOCK",
31 | "POST_NOTIFICATIONS"
32 | ],
33 | "adaptiveIcon": {
34 | "foregroundImage": "./assets/adaptive-icon.png",
35 | "backgroundColor": "#ffffff"
36 | },
37 | "package": "expo.modules.foregroundactions.example"
38 | },
39 | "web": {
40 | "favicon": "./assets/favicon.png"
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/example/assets/adaptive-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/assets/adaptive-icon.png
--------------------------------------------------------------------------------
/example/assets/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/assets/favicon.png
--------------------------------------------------------------------------------
/example/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/assets/icon.png
--------------------------------------------------------------------------------
/example/assets/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/assets/splash.png
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | module.exports = function (api) {
3 | api.cache(true);
4 | return {
5 | presets: ['babel-preset-expo'],
6 | plugins: [
7 | [
8 | 'module-resolver',
9 | {
10 | extensions: ['.tsx', '.ts', '.js', '.json'],
11 | alias: {
12 | // For development, we want to alias the library to the source
13 | 'expo-foreground-actions': path.join(__dirname, '..', 'src', 'index.ts'),
14 | },
15 | },
16 | ],
17 | ],
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 | .xcode.env.local
25 |
26 | # Bundle artifacts
27 | *.jsbundle
28 |
29 | # CocoaPods
30 | /Pods/
31 |
--------------------------------------------------------------------------------
/example/ios/.xcode.env:
--------------------------------------------------------------------------------
1 | # This `.xcode.env` file is versioned and is used to source the environment
2 | # used when running script phases inside Xcode.
3 | # To customize your local environment, you can create an `.xcode.env.local`
4 | # file that is not versioned.
5 |
6 | # NODE_BINARY variable contains the PATH to the node executable.
7 | #
8 | # Customize the NODE_BINARY variable here.
9 | # For example, to use nvm with brew, add the following line
10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use
11 | export NODE_BINARY=$(command -v node)
12 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
2 | require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
3 |
4 | require 'json'
5 | podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
6 |
7 | ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
8 | ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
9 |
10 | platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
11 | install! 'cocoapods',
12 | :deterministic_uuids => false
13 |
14 | prepare_react_native_project!
15 |
16 | # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
17 | # because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
18 | # you can also exclude `react-native-flipper` in `react-native.config.js`
19 | #
20 | # ```js
21 | # module.exports = {
22 | # dependencies: {
23 | # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
24 | # }
25 | # }
26 | # ```
27 | flipper_config = FlipperConfiguration.disabled
28 | if ENV['NO_FLIPPER'] == '1' then
29 | # Explicitly disabled through environment variables
30 | flipper_config = FlipperConfiguration.disabled
31 | elsif podfile_properties.key?('ios.flipper') then
32 | # Configure Flipper in Podfile.properties.json
33 | if podfile_properties['ios.flipper'] == 'true' then
34 | flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
35 | elsif podfile_properties['ios.flipper'] != 'false' then
36 | flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
37 | end
38 | end
39 |
40 | target 'expoforegroundactionsexample' do
41 | use_expo_modules!
42 | config = use_native_modules!
43 |
44 | use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
45 | use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
46 |
47 | # Flags change depending on the env values.
48 | flags = get_default_flags()
49 |
50 | use_react_native!(
51 | :path => config[:reactNativePath],
52 | :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
53 | :fabric_enabled => flags[:fabric_enabled],
54 | # An absolute path to your application root.
55 | :app_path => "#{Pod::Config.instance.installation_root}/..",
56 | # Note that if you have use_frameworks! enabled, Flipper will not work if enabled
57 | :flipper_configuration => flipper_config
58 | )
59 |
60 | post_install do |installer|
61 | react_native_post_install(
62 | installer,
63 | config[:reactNativePath],
64 | :mac_catalyst_enabled => false
65 | )
66 | __apply_Xcode_12_5_M1_post_install_workaround(installer)
67 |
68 | # This is necessary for Xcode 14, because it signs resource bundles by default
69 | # when building for devices.
70 | installer.target_installation_results.pod_target_installation_results
71 | .each do |pod_name, target_installation_result|
72 | target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
73 | resource_bundle_target.build_configurations.each do |config|
74 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
75 | end
76 | end
77 | end
78 | end
79 |
80 | post_integrate do |installer|
81 | begin
82 | expo_patch_react_imports!(installer)
83 | rescue => e
84 | Pod::UI.warn e
85 | end
86 | end
87 | end
88 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost (1.76.0)
3 | - DoubleConversion (1.1.6)
4 | - EXApplication (5.3.1):
5 | - ExpoModulesCore
6 | - EXConstants (14.4.2):
7 | - ExpoModulesCore
8 | - EXFileSystem (15.4.4):
9 | - ExpoModulesCore
10 | - EXFont (11.4.0):
11 | - ExpoModulesCore
12 | - Expo (49.0.15):
13 | - ExpoModulesCore
14 | - ExpoDevice (5.4.0):
15 | - ExpoModulesCore
16 | - ExpoForegroundActions (0.1.0):
17 | - ExpoModulesCore
18 | - ExpoKeepAwake (12.3.0):
19 | - ExpoModulesCore
20 | - ExpoModulesCore (1.5.11):
21 | - RCT-Folly (= 2021.07.22.00)
22 | - React-Core
23 | - React-NativeModulesApple
24 | - React-RCTAppDelegate
25 | - ReactCommon/turbomodule/core
26 | - EXSplashScreen (0.20.5):
27 | - ExpoModulesCore
28 | - RCT-Folly (= 2021.07.22.00)
29 | - React-Core
30 | - FBLazyVector (0.72.6)
31 | - FBReactNativeSpec (0.72.6):
32 | - RCT-Folly (= 2021.07.22.00)
33 | - RCTRequired (= 0.72.6)
34 | - RCTTypeSafety (= 0.72.6)
35 | - React-Core (= 0.72.6)
36 | - React-jsi (= 0.72.6)
37 | - ReactCommon/turbomodule/core (= 0.72.6)
38 | - fmt (6.2.1)
39 | - glog (0.3.5)
40 | - hermes-engine (0.72.6):
41 | - hermes-engine/Pre-built (= 0.72.6)
42 | - hermes-engine/Pre-built (0.72.6)
43 | - libevent (2.1.12)
44 | - RCT-Folly (2021.07.22.00):
45 | - boost
46 | - DoubleConversion
47 | - fmt (~> 6.2.1)
48 | - glog
49 | - RCT-Folly/Default (= 2021.07.22.00)
50 | - RCT-Folly/Default (2021.07.22.00):
51 | - boost
52 | - DoubleConversion
53 | - fmt (~> 6.2.1)
54 | - glog
55 | - RCT-Folly/Futures (2021.07.22.00):
56 | - boost
57 | - DoubleConversion
58 | - fmt (~> 6.2.1)
59 | - glog
60 | - libevent
61 | - RCTRequired (0.72.6)
62 | - RCTTypeSafety (0.72.6):
63 | - FBLazyVector (= 0.72.6)
64 | - RCTRequired (= 0.72.6)
65 | - React-Core (= 0.72.6)
66 | - React (0.72.6):
67 | - React-Core (= 0.72.6)
68 | - React-Core/DevSupport (= 0.72.6)
69 | - React-Core/RCTWebSocket (= 0.72.6)
70 | - React-RCTActionSheet (= 0.72.6)
71 | - React-RCTAnimation (= 0.72.6)
72 | - React-RCTBlob (= 0.72.6)
73 | - React-RCTImage (= 0.72.6)
74 | - React-RCTLinking (= 0.72.6)
75 | - React-RCTNetwork (= 0.72.6)
76 | - React-RCTSettings (= 0.72.6)
77 | - React-RCTText (= 0.72.6)
78 | - React-RCTVibration (= 0.72.6)
79 | - React-callinvoker (0.72.6)
80 | - React-Codegen (0.72.6):
81 | - DoubleConversion
82 | - FBReactNativeSpec
83 | - glog
84 | - hermes-engine
85 | - RCT-Folly
86 | - RCTRequired
87 | - RCTTypeSafety
88 | - React-Core
89 | - React-jsi
90 | - React-jsiexecutor
91 | - React-NativeModulesApple
92 | - React-rncore
93 | - ReactCommon/turbomodule/bridging
94 | - ReactCommon/turbomodule/core
95 | - React-Core (0.72.6):
96 | - glog
97 | - hermes-engine
98 | - RCT-Folly (= 2021.07.22.00)
99 | - React-Core/Default (= 0.72.6)
100 | - React-cxxreact
101 | - React-hermes
102 | - React-jsi
103 | - React-jsiexecutor
104 | - React-perflogger
105 | - React-runtimeexecutor
106 | - React-utils
107 | - SocketRocket (= 0.6.1)
108 | - Yoga
109 | - React-Core/CoreModulesHeaders (0.72.6):
110 | - glog
111 | - hermes-engine
112 | - RCT-Folly (= 2021.07.22.00)
113 | - React-Core/Default
114 | - React-cxxreact
115 | - React-hermes
116 | - React-jsi
117 | - React-jsiexecutor
118 | - React-perflogger
119 | - React-runtimeexecutor
120 | - React-utils
121 | - SocketRocket (= 0.6.1)
122 | - Yoga
123 | - React-Core/Default (0.72.6):
124 | - glog
125 | - hermes-engine
126 | - RCT-Folly (= 2021.07.22.00)
127 | - React-cxxreact
128 | - React-hermes
129 | - React-jsi
130 | - React-jsiexecutor
131 | - React-perflogger
132 | - React-runtimeexecutor
133 | - React-utils
134 | - SocketRocket (= 0.6.1)
135 | - Yoga
136 | - React-Core/DevSupport (0.72.6):
137 | - glog
138 | - hermes-engine
139 | - RCT-Folly (= 2021.07.22.00)
140 | - React-Core/Default (= 0.72.6)
141 | - React-Core/RCTWebSocket (= 0.72.6)
142 | - React-cxxreact
143 | - React-hermes
144 | - React-jsi
145 | - React-jsiexecutor
146 | - React-jsinspector (= 0.72.6)
147 | - React-perflogger
148 | - React-runtimeexecutor
149 | - React-utils
150 | - SocketRocket (= 0.6.1)
151 | - Yoga
152 | - React-Core/RCTActionSheetHeaders (0.72.6):
153 | - glog
154 | - hermes-engine
155 | - RCT-Folly (= 2021.07.22.00)
156 | - React-Core/Default
157 | - React-cxxreact
158 | - React-hermes
159 | - React-jsi
160 | - React-jsiexecutor
161 | - React-perflogger
162 | - React-runtimeexecutor
163 | - React-utils
164 | - SocketRocket (= 0.6.1)
165 | - Yoga
166 | - React-Core/RCTAnimationHeaders (0.72.6):
167 | - glog
168 | - hermes-engine
169 | - RCT-Folly (= 2021.07.22.00)
170 | - React-Core/Default
171 | - React-cxxreact
172 | - React-hermes
173 | - React-jsi
174 | - React-jsiexecutor
175 | - React-perflogger
176 | - React-runtimeexecutor
177 | - React-utils
178 | - SocketRocket (= 0.6.1)
179 | - Yoga
180 | - React-Core/RCTBlobHeaders (0.72.6):
181 | - glog
182 | - hermes-engine
183 | - RCT-Folly (= 2021.07.22.00)
184 | - React-Core/Default
185 | - React-cxxreact
186 | - React-hermes
187 | - React-jsi
188 | - React-jsiexecutor
189 | - React-perflogger
190 | - React-runtimeexecutor
191 | - React-utils
192 | - SocketRocket (= 0.6.1)
193 | - Yoga
194 | - React-Core/RCTImageHeaders (0.72.6):
195 | - glog
196 | - hermes-engine
197 | - RCT-Folly (= 2021.07.22.00)
198 | - React-Core/Default
199 | - React-cxxreact
200 | - React-hermes
201 | - React-jsi
202 | - React-jsiexecutor
203 | - React-perflogger
204 | - React-runtimeexecutor
205 | - React-utils
206 | - SocketRocket (= 0.6.1)
207 | - Yoga
208 | - React-Core/RCTLinkingHeaders (0.72.6):
209 | - glog
210 | - hermes-engine
211 | - RCT-Folly (= 2021.07.22.00)
212 | - React-Core/Default
213 | - React-cxxreact
214 | - React-hermes
215 | - React-jsi
216 | - React-jsiexecutor
217 | - React-perflogger
218 | - React-runtimeexecutor
219 | - React-utils
220 | - SocketRocket (= 0.6.1)
221 | - Yoga
222 | - React-Core/RCTNetworkHeaders (0.72.6):
223 | - glog
224 | - hermes-engine
225 | - RCT-Folly (= 2021.07.22.00)
226 | - React-Core/Default
227 | - React-cxxreact
228 | - React-hermes
229 | - React-jsi
230 | - React-jsiexecutor
231 | - React-perflogger
232 | - React-runtimeexecutor
233 | - React-utils
234 | - SocketRocket (= 0.6.1)
235 | - Yoga
236 | - React-Core/RCTSettingsHeaders (0.72.6):
237 | - glog
238 | - hermes-engine
239 | - RCT-Folly (= 2021.07.22.00)
240 | - React-Core/Default
241 | - React-cxxreact
242 | - React-hermes
243 | - React-jsi
244 | - React-jsiexecutor
245 | - React-perflogger
246 | - React-runtimeexecutor
247 | - React-utils
248 | - SocketRocket (= 0.6.1)
249 | - Yoga
250 | - React-Core/RCTTextHeaders (0.72.6):
251 | - glog
252 | - hermes-engine
253 | - RCT-Folly (= 2021.07.22.00)
254 | - React-Core/Default
255 | - React-cxxreact
256 | - React-hermes
257 | - React-jsi
258 | - React-jsiexecutor
259 | - React-perflogger
260 | - React-runtimeexecutor
261 | - React-utils
262 | - SocketRocket (= 0.6.1)
263 | - Yoga
264 | - React-Core/RCTVibrationHeaders (0.72.6):
265 | - glog
266 | - hermes-engine
267 | - RCT-Folly (= 2021.07.22.00)
268 | - React-Core/Default
269 | - React-cxxreact
270 | - React-hermes
271 | - React-jsi
272 | - React-jsiexecutor
273 | - React-perflogger
274 | - React-runtimeexecutor
275 | - React-utils
276 | - SocketRocket (= 0.6.1)
277 | - Yoga
278 | - React-Core/RCTWebSocket (0.72.6):
279 | - glog
280 | - hermes-engine
281 | - RCT-Folly (= 2021.07.22.00)
282 | - React-Core/Default (= 0.72.6)
283 | - React-cxxreact
284 | - React-hermes
285 | - React-jsi
286 | - React-jsiexecutor
287 | - React-perflogger
288 | - React-runtimeexecutor
289 | - React-utils
290 | - SocketRocket (= 0.6.1)
291 | - Yoga
292 | - React-CoreModules (0.72.6):
293 | - RCT-Folly (= 2021.07.22.00)
294 | - RCTTypeSafety (= 0.72.6)
295 | - React-Codegen (= 0.72.6)
296 | - React-Core/CoreModulesHeaders (= 0.72.6)
297 | - React-jsi (= 0.72.6)
298 | - React-RCTBlob
299 | - React-RCTImage (= 0.72.6)
300 | - ReactCommon/turbomodule/core (= 0.72.6)
301 | - SocketRocket (= 0.6.1)
302 | - React-cxxreact (0.72.6):
303 | - boost (= 1.76.0)
304 | - DoubleConversion
305 | - glog
306 | - hermes-engine
307 | - RCT-Folly (= 2021.07.22.00)
308 | - React-callinvoker (= 0.72.6)
309 | - React-debug (= 0.72.6)
310 | - React-jsi (= 0.72.6)
311 | - React-jsinspector (= 0.72.6)
312 | - React-logger (= 0.72.6)
313 | - React-perflogger (= 0.72.6)
314 | - React-runtimeexecutor (= 0.72.6)
315 | - React-debug (0.72.6)
316 | - React-hermes (0.72.6):
317 | - DoubleConversion
318 | - glog
319 | - hermes-engine
320 | - RCT-Folly (= 2021.07.22.00)
321 | - RCT-Folly/Futures (= 2021.07.22.00)
322 | - React-cxxreact (= 0.72.6)
323 | - React-jsi
324 | - React-jsiexecutor (= 0.72.6)
325 | - React-jsinspector (= 0.72.6)
326 | - React-perflogger (= 0.72.6)
327 | - React-jsi (0.72.6):
328 | - boost (= 1.76.0)
329 | - DoubleConversion
330 | - glog
331 | - hermes-engine
332 | - RCT-Folly (= 2021.07.22.00)
333 | - React-jsiexecutor (0.72.6):
334 | - DoubleConversion
335 | - glog
336 | - hermes-engine
337 | - RCT-Folly (= 2021.07.22.00)
338 | - React-cxxreact (= 0.72.6)
339 | - React-jsi (= 0.72.6)
340 | - React-perflogger (= 0.72.6)
341 | - React-jsinspector (0.72.6)
342 | - React-logger (0.72.6):
343 | - glog
344 | - React-NativeModulesApple (0.72.6):
345 | - hermes-engine
346 | - React-callinvoker
347 | - React-Core
348 | - React-cxxreact
349 | - React-jsi
350 | - React-runtimeexecutor
351 | - ReactCommon/turbomodule/bridging
352 | - ReactCommon/turbomodule/core
353 | - React-perflogger (0.72.6)
354 | - React-RCTActionSheet (0.72.6):
355 | - React-Core/RCTActionSheetHeaders (= 0.72.6)
356 | - React-RCTAnimation (0.72.6):
357 | - RCT-Folly (= 2021.07.22.00)
358 | - RCTTypeSafety (= 0.72.6)
359 | - React-Codegen (= 0.72.6)
360 | - React-Core/RCTAnimationHeaders (= 0.72.6)
361 | - React-jsi (= 0.72.6)
362 | - ReactCommon/turbomodule/core (= 0.72.6)
363 | - React-RCTAppDelegate (0.72.6):
364 | - RCT-Folly
365 | - RCTRequired
366 | - RCTTypeSafety
367 | - React-Core
368 | - React-CoreModules
369 | - React-hermes
370 | - React-NativeModulesApple
371 | - React-RCTImage
372 | - React-RCTNetwork
373 | - React-runtimescheduler
374 | - ReactCommon/turbomodule/core
375 | - React-RCTBlob (0.72.6):
376 | - hermes-engine
377 | - RCT-Folly (= 2021.07.22.00)
378 | - React-Codegen (= 0.72.6)
379 | - React-Core/RCTBlobHeaders (= 0.72.6)
380 | - React-Core/RCTWebSocket (= 0.72.6)
381 | - React-jsi (= 0.72.6)
382 | - React-RCTNetwork (= 0.72.6)
383 | - ReactCommon/turbomodule/core (= 0.72.6)
384 | - React-RCTImage (0.72.6):
385 | - RCT-Folly (= 2021.07.22.00)
386 | - RCTTypeSafety (= 0.72.6)
387 | - React-Codegen (= 0.72.6)
388 | - React-Core/RCTImageHeaders (= 0.72.6)
389 | - React-jsi (= 0.72.6)
390 | - React-RCTNetwork (= 0.72.6)
391 | - ReactCommon/turbomodule/core (= 0.72.6)
392 | - React-RCTLinking (0.72.6):
393 | - React-Codegen (= 0.72.6)
394 | - React-Core/RCTLinkingHeaders (= 0.72.6)
395 | - React-jsi (= 0.72.6)
396 | - ReactCommon/turbomodule/core (= 0.72.6)
397 | - React-RCTNetwork (0.72.6):
398 | - RCT-Folly (= 2021.07.22.00)
399 | - RCTTypeSafety (= 0.72.6)
400 | - React-Codegen (= 0.72.6)
401 | - React-Core/RCTNetworkHeaders (= 0.72.6)
402 | - React-jsi (= 0.72.6)
403 | - ReactCommon/turbomodule/core (= 0.72.6)
404 | - React-RCTSettings (0.72.6):
405 | - RCT-Folly (= 2021.07.22.00)
406 | - RCTTypeSafety (= 0.72.6)
407 | - React-Codegen (= 0.72.6)
408 | - React-Core/RCTSettingsHeaders (= 0.72.6)
409 | - React-jsi (= 0.72.6)
410 | - ReactCommon/turbomodule/core (= 0.72.6)
411 | - React-RCTText (0.72.6):
412 | - React-Core/RCTTextHeaders (= 0.72.6)
413 | - React-RCTVibration (0.72.6):
414 | - RCT-Folly (= 2021.07.22.00)
415 | - React-Codegen (= 0.72.6)
416 | - React-Core/RCTVibrationHeaders (= 0.72.6)
417 | - React-jsi (= 0.72.6)
418 | - ReactCommon/turbomodule/core (= 0.72.6)
419 | - React-rncore (0.72.6)
420 | - React-runtimeexecutor (0.72.6):
421 | - React-jsi (= 0.72.6)
422 | - React-runtimescheduler (0.72.6):
423 | - glog
424 | - hermes-engine
425 | - RCT-Folly (= 2021.07.22.00)
426 | - React-callinvoker
427 | - React-debug
428 | - React-jsi
429 | - React-runtimeexecutor
430 | - React-utils (0.72.6):
431 | - glog
432 | - RCT-Folly (= 2021.07.22.00)
433 | - React-debug
434 | - ReactCommon/turbomodule/bridging (0.72.6):
435 | - DoubleConversion
436 | - glog
437 | - hermes-engine
438 | - RCT-Folly (= 2021.07.22.00)
439 | - React-callinvoker (= 0.72.6)
440 | - React-cxxreact (= 0.72.6)
441 | - React-jsi (= 0.72.6)
442 | - React-logger (= 0.72.6)
443 | - React-perflogger (= 0.72.6)
444 | - ReactCommon/turbomodule/core (0.72.6):
445 | - DoubleConversion
446 | - glog
447 | - hermes-engine
448 | - RCT-Folly (= 2021.07.22.00)
449 | - React-callinvoker (= 0.72.6)
450 | - React-cxxreact (= 0.72.6)
451 | - React-jsi (= 0.72.6)
452 | - React-logger (= 0.72.6)
453 | - React-perflogger (= 0.72.6)
454 | - SocketRocket (0.6.1)
455 | - Yoga (1.14.0)
456 |
457 | DEPENDENCIES:
458 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
459 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
460 | - EXApplication (from `../node_modules/expo-application/ios`)
461 | - EXConstants (from `../node_modules/expo-constants/ios`)
462 | - EXFileSystem (from `../node_modules/expo-file-system/ios`)
463 | - EXFont (from `../node_modules/expo-font/ios`)
464 | - Expo (from `../node_modules/expo`)
465 | - ExpoDevice (from `../node_modules/expo-device/ios`)
466 | - ExpoForegroundActions (from `../../ios`)
467 | - ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`)
468 | - ExpoModulesCore (from `../node_modules/expo-modules-core`)
469 | - EXSplashScreen (from `../node_modules/expo-splash-screen/ios`)
470 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
471 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
472 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
473 | - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
474 | - libevent (~> 2.1.12)
475 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
476 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
477 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
478 | - React (from `../node_modules/react-native/`)
479 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
480 | - React-Codegen (from `build/generated/ios`)
481 | - React-Core (from `../node_modules/react-native/`)
482 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
483 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
484 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
485 | - React-debug (from `../node_modules/react-native/ReactCommon/react/debug`)
486 | - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
487 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
488 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
489 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
490 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`)
491 | - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
492 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
493 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
494 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
495 | - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`)
496 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
497 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
498 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
499 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
500 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
501 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
502 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
503 | - React-rncore (from `../node_modules/react-native/ReactCommon`)
504 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
505 | - React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
506 | - React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
507 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
508 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
509 |
510 | SPEC REPOS:
511 | trunk:
512 | - fmt
513 | - libevent
514 | - SocketRocket
515 |
516 | EXTERNAL SOURCES:
517 | boost:
518 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
519 | DoubleConversion:
520 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
521 | EXApplication:
522 | :path: "../node_modules/expo-application/ios"
523 | EXConstants:
524 | :path: "../node_modules/expo-constants/ios"
525 | EXFileSystem:
526 | :path: "../node_modules/expo-file-system/ios"
527 | EXFont:
528 | :path: "../node_modules/expo-font/ios"
529 | Expo:
530 | :path: "../node_modules/expo"
531 | ExpoDevice:
532 | :path: "../node_modules/expo-device/ios"
533 | ExpoForegroundActions:
534 | :path: "../../ios"
535 | ExpoKeepAwake:
536 | :path: "../node_modules/expo-keep-awake/ios"
537 | ExpoModulesCore:
538 | :path: "../node_modules/expo-modules-core"
539 | EXSplashScreen:
540 | :path: "../node_modules/expo-splash-screen/ios"
541 | FBLazyVector:
542 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
543 | FBReactNativeSpec:
544 | :path: "../node_modules/react-native/React/FBReactNativeSpec"
545 | glog:
546 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
547 | hermes-engine:
548 | :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
549 | :tag: hermes-2023-08-07-RNv0.72.4-813b2def12bc9df02654b3e3653ae4a68d0572e0
550 | RCT-Folly:
551 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
552 | RCTRequired:
553 | :path: "../node_modules/react-native/Libraries/RCTRequired"
554 | RCTTypeSafety:
555 | :path: "../node_modules/react-native/Libraries/TypeSafety"
556 | React:
557 | :path: "../node_modules/react-native/"
558 | React-callinvoker:
559 | :path: "../node_modules/react-native/ReactCommon/callinvoker"
560 | React-Codegen:
561 | :path: build/generated/ios
562 | React-Core:
563 | :path: "../node_modules/react-native/"
564 | React-CoreModules:
565 | :path: "../node_modules/react-native/React/CoreModules"
566 | React-cxxreact:
567 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
568 | React-debug:
569 | :path: "../node_modules/react-native/ReactCommon/react/debug"
570 | React-hermes:
571 | :path: "../node_modules/react-native/ReactCommon/hermes"
572 | React-jsi:
573 | :path: "../node_modules/react-native/ReactCommon/jsi"
574 | React-jsiexecutor:
575 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
576 | React-jsinspector:
577 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
578 | React-logger:
579 | :path: "../node_modules/react-native/ReactCommon/logger"
580 | React-NativeModulesApple:
581 | :path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
582 | React-perflogger:
583 | :path: "../node_modules/react-native/ReactCommon/reactperflogger"
584 | React-RCTActionSheet:
585 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
586 | React-RCTAnimation:
587 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
588 | React-RCTAppDelegate:
589 | :path: "../node_modules/react-native/Libraries/AppDelegate"
590 | React-RCTBlob:
591 | :path: "../node_modules/react-native/Libraries/Blob"
592 | React-RCTImage:
593 | :path: "../node_modules/react-native/Libraries/Image"
594 | React-RCTLinking:
595 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
596 | React-RCTNetwork:
597 | :path: "../node_modules/react-native/Libraries/Network"
598 | React-RCTSettings:
599 | :path: "../node_modules/react-native/Libraries/Settings"
600 | React-RCTText:
601 | :path: "../node_modules/react-native/Libraries/Text"
602 | React-RCTVibration:
603 | :path: "../node_modules/react-native/Libraries/Vibration"
604 | React-rncore:
605 | :path: "../node_modules/react-native/ReactCommon"
606 | React-runtimeexecutor:
607 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
608 | React-runtimescheduler:
609 | :path: "../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler"
610 | React-utils:
611 | :path: "../node_modules/react-native/ReactCommon/react/utils"
612 | ReactCommon:
613 | :path: "../node_modules/react-native/ReactCommon"
614 | Yoga:
615 | :path: "../node_modules/react-native/ReactCommon/yoga"
616 |
617 | SPEC CHECKSUMS:
618 | boost: 57d2868c099736d80fcd648bf211b4431e51a558
619 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
620 | EXApplication: 042aa2e3f05258a16962ea1a9914bf288db9c9a1
621 | EXConstants: ce5bbea779da8031ac818c36bea41b10e14d04e1
622 | EXFileSystem: 2b826a3bf1071a4b80a8457e97124783d1ac860e
623 | EXFont: 738c44c390953ebcbab075a4848bfbef025fd9ee
624 | Expo: 4ddd44075a2e7c7c63a0f5b1e05223be74d48bc6
625 | ExpoDevice: 1c1b0c9cad96c292c1de73948649cfd654b2b3c0
626 | ExpoForegroundActions: 6f9604f631b179d13901ad6da99e5ad04a901ba4
627 | ExpoKeepAwake: be4cbd52d9b177cde0fd66daa1913afa3161fc1d
628 | ExpoModulesCore: 51cb2e7ab4c8da14be3f40b66d54c1781002e99d
629 | EXSplashScreen: c0e7f2d4a640f3b875808ed0b88575538daf6d82
630 | FBLazyVector: 748c0ef74f2bf4b36cfcccf37916806940a64c32
631 | FBReactNativeSpec: 966f29e4e697de53a3b366355e8f57375c856ad9
632 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
633 | glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
634 | hermes-engine: 8057e75cfc1437b178ac86c8654b24e7fead7f60
635 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
636 | RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
637 | RCTRequired: 28469809442eb4eb5528462705f7d852948c8a74
638 | RCTTypeSafety: e9c6c409fca2cc584e5b086862d562540cb38d29
639 | React: 769f469909b18edfe934f0539fffb319c4c61043
640 | React-callinvoker: e48ce12c83706401251921896576710d81e54763
641 | React-Codegen: a136b8094d39fd071994eaa935366e6be2239cb1
642 | React-Core: e548a186fb01c3a78a9aeeffa212d625ca9511bf
643 | React-CoreModules: d226b22d06ea1bc4e49d3c073b2c6cbb42265405
644 | React-cxxreact: 44a3560510ead6633b6e02f9fbbdd1772fb40f92
645 | React-debug: 238501490155574ae9f3f8dd1c74330eba30133e
646 | React-hermes: 46e66dc854124d7645c20bfec0a6be9542826ecd
647 | React-jsi: fbdaf4166bae60524b591b18c851b530c8cdb90c
648 | React-jsiexecutor: 3bf18ff7cb03cd8dfdce08fbbc0d15058c1d71ae
649 | React-jsinspector: 194e32c6aab382d88713ad3dd0025c5f5c4ee072
650 | React-logger: cebf22b6cf43434e471dc561e5911b40ac01d289
651 | React-NativeModulesApple: 02e35e9a51e10c6422f04f5e4076a7c02243fff2
652 | React-perflogger: e3596db7e753f51766bceadc061936ef1472edc3
653 | React-RCTActionSheet: 17ab132c748b4471012abbcdcf5befe860660485
654 | React-RCTAnimation: c8bbaab62be5817d2a31c36d5f2571e3f7dcf099
655 | React-RCTAppDelegate: af1c7dace233deba4b933cd1d6491fe4e3584ad1
656 | React-RCTBlob: 1bcf3a0341eb8d6950009b1ddb8aefaf46996b8c
657 | React-RCTImage: 670a3486b532292649b1aef3ffddd0b495a5cee4
658 | React-RCTLinking: bd7ab853144aed463903237e615fd91d11b4f659
659 | React-RCTNetwork: be86a621f3e4724758f23ad1fdce32474ab3d829
660 | React-RCTSettings: 4f3a29a6d23ffa639db9701bc29af43f30781058
661 | React-RCTText: adde32164a243103aaba0b1dc7b0a2599733873e
662 | React-RCTVibration: 6bd85328388ac2e82ae0ca11afe48ad5555b483a
663 | React-rncore: fda7b1ae5918fa7baa259105298a5487875a57c8
664 | React-runtimeexecutor: 57d85d942862b08f6d15441a0badff2542fd233c
665 | React-runtimescheduler: f23e337008403341177fc52ee4ca94e442c17ede
666 | React-utils: fa59c9a3375fb6f4aeb66714fd3f7f76b43a9f16
667 | ReactCommon: dd03c17275c200496f346af93a7b94c53f3093a4
668 | SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
669 | Yoga: b76f1acfda8212aa16b7e26bcce3983230c82603
670 |
671 | PODFILE CHECKSUM: a0b87fcc096214c12593be885f6d03f64c786ee1
672 |
673 | COCOAPODS: 1.12.1
674 |
--------------------------------------------------------------------------------
/example/ios/Podfile.properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "expo.jsEngine": "hermes",
3 | "EX_DEV_CLIENT_NETWORK_INSPECTOR": "true"
4 | }
5 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
11 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
13 | 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
14 | 96905EF65AED1B983A6B3ABC /* libPods-expoforegroundactionsexample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoforegroundactionsexample.a */; };
15 | B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
16 | BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
17 | D3CE75C5A6BB407DA2D0082A /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF37465B5D7744CCBEC80351 /* noop-file.swift */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXFileReference section */
21 | 13B07F961A680F5B00A75B9A /* expoforegroundactionsexample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = expoforegroundactionsexample.app; sourceTree = BUILT_PRODUCTS_DIR; };
22 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = expoforegroundactionsexample/AppDelegate.h; sourceTree = ""; };
23 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = expoforegroundactionsexample/AppDelegate.mm; sourceTree = ""; };
24 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = expoforegroundactionsexample/Images.xcassets; sourceTree = ""; };
25 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = expoforegroundactionsexample/Info.plist; sourceTree = ""; };
26 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = expoforegroundactionsexample/main.m; sourceTree = ""; };
27 | 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoforegroundactionsexample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-expoforegroundactionsexample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
28 | 6C2E3173556A471DD304B334 /* Pods-expoforegroundactionsexample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-expoforegroundactionsexample.debug.xcconfig"; path = "Target Support Files/Pods-expoforegroundactionsexample/Pods-expoforegroundactionsexample.debug.xcconfig"; sourceTree = ""; };
29 | 7A4D352CD337FB3A3BF06240 /* Pods-expoforegroundactionsexample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-expoforegroundactionsexample.release.xcconfig"; path = "Target Support Files/Pods-expoforegroundactionsexample/Pods-expoforegroundactionsexample.release.xcconfig"; sourceTree = ""; };
30 | AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = expoforegroundactionsexample/SplashScreen.storyboard; sourceTree = ""; };
31 | BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = ""; };
32 | C53F33DBB4254E22AD83E801 /* expoforegroundactionsexample-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "expoforegroundactionsexample-Bridging-Header.h"; path = "expoforegroundactionsexample/expoforegroundactionsexample-Bridging-Header.h"; sourceTree = ""; };
33 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
34 | EF37465B5D7744CCBEC80351 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "expoforegroundactionsexample/noop-file.swift"; sourceTree = ""; };
35 | FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-expoforegroundactionsexample/ExpoModulesProvider.swift"; sourceTree = ""; };
36 | /* End PBXFileReference section */
37 |
38 | /* Begin PBXFrameworksBuildPhase section */
39 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
40 | isa = PBXFrameworksBuildPhase;
41 | buildActionMask = 2147483647;
42 | files = (
43 | 96905EF65AED1B983A6B3ABC /* libPods-expoforegroundactionsexample.a in Frameworks */,
44 | );
45 | runOnlyForDeploymentPostprocessing = 0;
46 | };
47 | /* End PBXFrameworksBuildPhase section */
48 |
49 | /* Begin PBXGroup section */
50 | 13B07FAE1A68108700A75B9A /* expoforegroundactionsexample */ = {
51 | isa = PBXGroup;
52 | children = (
53 | BB2F792B24A3F905000567C9 /* Supporting */,
54 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
55 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */,
56 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
57 | 13B07FB61A68108700A75B9A /* Info.plist */,
58 | 13B07FB71A68108700A75B9A /* main.m */,
59 | AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
60 | EF37465B5D7744CCBEC80351 /* noop-file.swift */,
61 | C53F33DBB4254E22AD83E801 /* expoforegroundactionsexample-Bridging-Header.h */,
62 | );
63 | name = expoforegroundactionsexample;
64 | sourceTree = "";
65 | };
66 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
67 | isa = PBXGroup;
68 | children = (
69 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
70 | 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-expoforegroundactionsexample.a */,
71 | );
72 | name = Frameworks;
73 | sourceTree = "";
74 | };
75 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
76 | isa = PBXGroup;
77 | children = (
78 | );
79 | name = Libraries;
80 | sourceTree = "";
81 | };
82 | 83CBB9F61A601CBA00E9B192 = {
83 | isa = PBXGroup;
84 | children = (
85 | 13B07FAE1A68108700A75B9A /* expoforegroundactionsexample */,
86 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
87 | 83CBBA001A601CBA00E9B192 /* Products */,
88 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
89 | D65327D7A22EEC0BE12398D9 /* Pods */,
90 | D7E4C46ADA2E9064B798F356 /* ExpoModulesProviders */,
91 | );
92 | indentWidth = 2;
93 | sourceTree = "";
94 | tabWidth = 2;
95 | usesTabs = 0;
96 | };
97 | 83CBBA001A601CBA00E9B192 /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 13B07F961A680F5B00A75B9A /* expoforegroundactionsexample.app */,
101 | );
102 | name = Products;
103 | sourceTree = "";
104 | };
105 | 92DBD88DE9BF7D494EA9DA96 /* expoforegroundactionsexample */ = {
106 | isa = PBXGroup;
107 | children = (
108 | FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */,
109 | );
110 | name = expoforegroundactionsexample;
111 | sourceTree = "";
112 | };
113 | BB2F792B24A3F905000567C9 /* Supporting */ = {
114 | isa = PBXGroup;
115 | children = (
116 | BB2F792C24A3F905000567C9 /* Expo.plist */,
117 | );
118 | name = Supporting;
119 | path = expoforegroundactionsexample/Supporting;
120 | sourceTree = "";
121 | };
122 | D65327D7A22EEC0BE12398D9 /* Pods */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 6C2E3173556A471DD304B334 /* Pods-expoforegroundactionsexample.debug.xcconfig */,
126 | 7A4D352CD337FB3A3BF06240 /* Pods-expoforegroundactionsexample.release.xcconfig */,
127 | );
128 | path = Pods;
129 | sourceTree = "";
130 | };
131 | D7E4C46ADA2E9064B798F356 /* ExpoModulesProviders */ = {
132 | isa = PBXGroup;
133 | children = (
134 | 92DBD88DE9BF7D494EA9DA96 /* expoforegroundactionsexample */,
135 | );
136 | name = ExpoModulesProviders;
137 | sourceTree = "";
138 | };
139 | /* End PBXGroup section */
140 |
141 | /* Begin PBXNativeTarget section */
142 | 13B07F861A680F5B00A75B9A /* expoforegroundactionsexample */ = {
143 | isa = PBXNativeTarget;
144 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "expoforegroundactionsexample" */;
145 | buildPhases = (
146 | 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */,
147 | FD10A7F022414F080027D42C /* Start Packager */,
148 | BE7F4975C09E60A980EA3E64 /* [Expo] Configure project */,
149 | 13B07F871A680F5B00A75B9A /* Sources */,
150 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
151 | 13B07F8E1A680F5B00A75B9A /* Resources */,
152 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
153 | 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */,
154 | 61E0C4BFAF2F60B42F04103E /* [CP] Embed Pods Frameworks */,
155 | );
156 | buildRules = (
157 | );
158 | dependencies = (
159 | );
160 | name = expoforegroundactionsexample;
161 | productName = expoforegroundactionsexample;
162 | productReference = 13B07F961A680F5B00A75B9A /* expoforegroundactionsexample.app */;
163 | productType = "com.apple.product-type.application";
164 | };
165 | /* End PBXNativeTarget section */
166 |
167 | /* Begin PBXProject section */
168 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
169 | isa = PBXProject;
170 | attributes = {
171 | LastUpgradeCheck = 1130;
172 | TargetAttributes = {
173 | 13B07F861A680F5B00A75B9A = {
174 | LastSwiftMigration = 1250;
175 | };
176 | };
177 | };
178 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "expoforegroundactionsexample" */;
179 | compatibilityVersion = "Xcode 3.2";
180 | developmentRegion = en;
181 | hasScannedForEncodings = 0;
182 | knownRegions = (
183 | en,
184 | Base,
185 | );
186 | mainGroup = 83CBB9F61A601CBA00E9B192;
187 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
188 | projectDirPath = "";
189 | projectRoot = "";
190 | targets = (
191 | 13B07F861A680F5B00A75B9A /* expoforegroundactionsexample */,
192 | );
193 | };
194 | /* End PBXProject section */
195 |
196 | /* Begin PBXResourcesBuildPhase section */
197 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
198 | isa = PBXResourcesBuildPhase;
199 | buildActionMask = 2147483647;
200 | files = (
201 | BB2F792D24A3F905000567C9 /* Expo.plist in Resources */,
202 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
203 | 3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */,
204 | );
205 | runOnlyForDeploymentPostprocessing = 0;
206 | };
207 | /* End PBXResourcesBuildPhase section */
208 |
209 | /* Begin PBXShellScriptBuildPhase section */
210 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
211 | isa = PBXShellScriptBuildPhase;
212 | buildActionMask = 2147483647;
213 | files = (
214 | );
215 | inputPaths = (
216 | );
217 | name = "Bundle React Native code and images";
218 | outputPaths = (
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | shellPath = /bin/sh;
222 | shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT=\"$PROJECT_DIR\"/..\n\nif [[ \"$CONFIGURATION\" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z \"$ENTRY_FILE\" ]]; then\n # Set the entry JS file using the bundler's entry resolution.\n export ENTRY_FILE=\"$(\"$NODE_BINARY\" -e \"require('expo/scripts/resolveAppEntry')\" \"$PROJECT_ROOT\" ios relative | tail -n 1)\"\nfi\n\nif [[ -z \"$CLI_PATH\" ]]; then\n # Use Expo CLI\n export CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require.resolve('@expo/cli')\")\"\nfi\nif [[ -z \"$BUNDLE_COMMAND\" ]]; then\n # Default Expo CLI command for bundling\n export BUNDLE_COMMAND=\"export:embed\"\nfi\n\n`\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/react-native-xcode.sh'\"`\n\n";
223 | };
224 | 08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */ = {
225 | isa = PBXShellScriptBuildPhase;
226 | buildActionMask = 2147483647;
227 | files = (
228 | );
229 | inputFileListPaths = (
230 | );
231 | inputPaths = (
232 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
233 | "${PODS_ROOT}/Manifest.lock",
234 | );
235 | name = "[CP] Check Pods Manifest.lock";
236 | outputFileListPaths = (
237 | );
238 | outputPaths = (
239 | "$(DERIVED_FILE_DIR)/Pods-expoforegroundactionsexample-checkManifestLockResult.txt",
240 | );
241 | runOnlyForDeploymentPostprocessing = 0;
242 | shellPath = /bin/sh;
243 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
244 | showEnvVarsInLog = 0;
245 | };
246 | 61E0C4BFAF2F60B42F04103E /* [CP] Embed Pods Frameworks */ = {
247 | isa = PBXShellScriptBuildPhase;
248 | buildActionMask = 2147483647;
249 | files = (
250 | );
251 | inputPaths = (
252 | "${PODS_ROOT}/Target Support Files/Pods-expoforegroundactionsexample/Pods-expoforegroundactionsexample-frameworks.sh",
253 | "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
254 | );
255 | name = "[CP] Embed Pods Frameworks";
256 | outputPaths = (
257 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
258 | );
259 | runOnlyForDeploymentPostprocessing = 0;
260 | shellPath = /bin/sh;
261 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-expoforegroundactionsexample/Pods-expoforegroundactionsexample-frameworks.sh\"\n";
262 | showEnvVarsInLog = 0;
263 | };
264 | 800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = {
265 | isa = PBXShellScriptBuildPhase;
266 | buildActionMask = 2147483647;
267 | files = (
268 | );
269 | inputPaths = (
270 | "${PODS_ROOT}/Target Support Files/Pods-expoforegroundactionsexample/Pods-expoforegroundactionsexample-resources.sh",
271 | "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
272 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
273 | );
274 | name = "[CP] Copy Pods Resources";
275 | outputPaths = (
276 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
277 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
278 | );
279 | runOnlyForDeploymentPostprocessing = 0;
280 | shellPath = /bin/sh;
281 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-expoforegroundactionsexample/Pods-expoforegroundactionsexample-resources.sh\"\n";
282 | showEnvVarsInLog = 0;
283 | };
284 | BE7F4975C09E60A980EA3E64 /* [Expo] Configure project */ = {
285 | isa = PBXShellScriptBuildPhase;
286 | alwaysOutOfDate = 1;
287 | buildActionMask = 2147483647;
288 | files = (
289 | );
290 | inputFileListPaths = (
291 | );
292 | inputPaths = (
293 | );
294 | name = "[Expo] Configure project";
295 | outputFileListPaths = (
296 | );
297 | outputPaths = (
298 | );
299 | runOnlyForDeploymentPostprocessing = 0;
300 | shellPath = /bin/sh;
301 | shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-expoforegroundactionsexample/expo-configure-project.sh\"\n";
302 | };
303 | FD10A7F022414F080027D42C /* Start Packager */ = {
304 | isa = PBXShellScriptBuildPhase;
305 | buildActionMask = 2147483647;
306 | files = (
307 | );
308 | inputFileListPaths = (
309 | );
310 | inputPaths = (
311 | );
312 | name = "Start Packager";
313 | outputFileListPaths = (
314 | );
315 | outputPaths = (
316 | );
317 | runOnlyForDeploymentPostprocessing = 0;
318 | shellPath = /bin/sh;
319 | shellScript = "if [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\n source \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\n source \"$PODS_ROOT/../.xcode.env.local\"\nfi\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > `$NODE_BINARY --print \"require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'\"`\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open `$NODE_BINARY --print \"require('path').dirname(require.resolve('expo/package.json')) + '/scripts/launchPackager.command'\"` || echo \"Can't start packager automatically\"\n fi\nfi\n";
320 | showEnvVarsInLog = 0;
321 | };
322 | /* End PBXShellScriptBuildPhase section */
323 |
324 | /* Begin PBXSourcesBuildPhase section */
325 | 13B07F871A680F5B00A75B9A /* Sources */ = {
326 | isa = PBXSourcesBuildPhase;
327 | buildActionMask = 2147483647;
328 | files = (
329 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
330 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
331 | B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */,
332 | D3CE75C5A6BB407DA2D0082A /* noop-file.swift in Sources */,
333 | );
334 | runOnlyForDeploymentPostprocessing = 0;
335 | };
336 | /* End PBXSourcesBuildPhase section */
337 |
338 | /* Begin XCBuildConfiguration section */
339 | 13B07F941A680F5B00A75B9A /* Debug */ = {
340 | isa = XCBuildConfiguration;
341 | baseConfigurationReference = 6C2E3173556A471DD304B334 /* Pods-expoforegroundactionsexample.debug.xcconfig */;
342 | buildSettings = {
343 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
344 | CLANG_ENABLE_MODULES = YES;
345 | CODE_SIGN_ENTITLEMENTS = expoforegroundactionsexample/expoforegroundactionsexample.entitlements;
346 | CURRENT_PROJECT_VERSION = 1;
347 | ENABLE_BITCODE = NO;
348 | GCC_PREPROCESSOR_DEFINITIONS = (
349 | "$(inherited)",
350 | "FB_SONARKIT_ENABLED=1",
351 | );
352 | INFOPLIST_FILE = expoforegroundactionsexample/Info.plist;
353 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
355 | MARKETING_VERSION = 1.0;
356 | OTHER_LDFLAGS = (
357 | "$(inherited)",
358 | "-ObjC",
359 | "-lc++",
360 | );
361 | OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
362 | PRODUCT_BUNDLE_IDENTIFIER = expo.modules.foregroundactions.example;
363 | PRODUCT_NAME = expoforegroundactionsexample;
364 | SWIFT_OBJC_BRIDGING_HEADER = "expoforegroundactionsexample/expoforegroundactionsexample-Bridging-Header.h";
365 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
366 | SWIFT_VERSION = 5.0;
367 | TARGETED_DEVICE_FAMILY = "1,2";
368 | VERSIONING_SYSTEM = "apple-generic";
369 | };
370 | name = Debug;
371 | };
372 | 13B07F951A680F5B00A75B9A /* Release */ = {
373 | isa = XCBuildConfiguration;
374 | baseConfigurationReference = 7A4D352CD337FB3A3BF06240 /* Pods-expoforegroundactionsexample.release.xcconfig */;
375 | buildSettings = {
376 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
377 | CLANG_ENABLE_MODULES = YES;
378 | CODE_SIGN_ENTITLEMENTS = expoforegroundactionsexample/expoforegroundactionsexample.entitlements;
379 | CURRENT_PROJECT_VERSION = 1;
380 | INFOPLIST_FILE = expoforegroundactionsexample/Info.plist;
381 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
382 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
383 | MARKETING_VERSION = 1.0;
384 | OTHER_LDFLAGS = (
385 | "$(inherited)",
386 | "-ObjC",
387 | "-lc++",
388 | );
389 | OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
390 | PRODUCT_BUNDLE_IDENTIFIER = expo.modules.foregroundactions.example;
391 | PRODUCT_NAME = expoforegroundactionsexample;
392 | SWIFT_OBJC_BRIDGING_HEADER = "expoforegroundactionsexample/expoforegroundactionsexample-Bridging-Header.h";
393 | SWIFT_VERSION = 5.0;
394 | TARGETED_DEVICE_FAMILY = "1,2";
395 | VERSIONING_SYSTEM = "apple-generic";
396 | };
397 | name = Release;
398 | };
399 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
400 | isa = XCBuildConfiguration;
401 | buildSettings = {
402 | ALWAYS_SEARCH_USER_PATHS = NO;
403 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
404 | CLANG_CXX_LANGUAGE_STANDARD = "c++17";
405 | CLANG_CXX_LIBRARY = "libc++";
406 | CLANG_ENABLE_MODULES = YES;
407 | CLANG_ENABLE_OBJC_ARC = YES;
408 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
409 | CLANG_WARN_BOOL_CONVERSION = YES;
410 | CLANG_WARN_COMMA = YES;
411 | CLANG_WARN_CONSTANT_CONVERSION = YES;
412 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
414 | CLANG_WARN_EMPTY_BODY = YES;
415 | CLANG_WARN_ENUM_CONVERSION = YES;
416 | CLANG_WARN_INFINITE_RECURSION = YES;
417 | CLANG_WARN_INT_CONVERSION = YES;
418 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
419 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
420 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
421 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
422 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
423 | CLANG_WARN_STRICT_PROTOTYPES = YES;
424 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
425 | CLANG_WARN_UNREACHABLE_CODE = YES;
426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
427 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
428 | COPY_PHASE_STRIP = NO;
429 | ENABLE_STRICT_OBJC_MSGSEND = YES;
430 | ENABLE_TESTABILITY = YES;
431 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
432 | GCC_C_LANGUAGE_STANDARD = gnu99;
433 | GCC_DYNAMIC_NO_PIC = NO;
434 | GCC_NO_COMMON_BLOCKS = YES;
435 | GCC_OPTIMIZATION_LEVEL = 0;
436 | GCC_PREPROCESSOR_DEFINITIONS = (
437 | "DEBUG=1",
438 | "$(inherited)",
439 | _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
440 | );
441 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
442 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
443 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
444 | GCC_WARN_UNDECLARED_SELECTOR = YES;
445 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
446 | GCC_WARN_UNUSED_FUNCTION = YES;
447 | GCC_WARN_UNUSED_VARIABLE = YES;
448 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
449 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
450 | LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
451 | MTL_ENABLE_DEBUG_INFO = YES;
452 | ONLY_ACTIVE_ARCH = YES;
453 | OTHER_CFLAGS = "$(inherited)";
454 | OTHER_CPLUSPLUSFLAGS = "$(inherited)";
455 | OTHER_LDFLAGS = (
456 | "$(inherited)",
457 | " ",
458 | );
459 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
460 | SDKROOT = iphoneos;
461 | };
462 | name = Debug;
463 | };
464 | 83CBBA211A601CBA00E9B192 /* Release */ = {
465 | isa = XCBuildConfiguration;
466 | buildSettings = {
467 | ALWAYS_SEARCH_USER_PATHS = NO;
468 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
469 | CLANG_CXX_LANGUAGE_STANDARD = "c++17";
470 | CLANG_CXX_LIBRARY = "libc++";
471 | CLANG_ENABLE_MODULES = YES;
472 | CLANG_ENABLE_OBJC_ARC = YES;
473 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
474 | CLANG_WARN_BOOL_CONVERSION = YES;
475 | CLANG_WARN_COMMA = YES;
476 | CLANG_WARN_CONSTANT_CONVERSION = YES;
477 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
478 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
479 | CLANG_WARN_EMPTY_BODY = YES;
480 | CLANG_WARN_ENUM_CONVERSION = YES;
481 | CLANG_WARN_INFINITE_RECURSION = YES;
482 | CLANG_WARN_INT_CONVERSION = YES;
483 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
484 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
485 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
486 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
487 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
488 | CLANG_WARN_STRICT_PROTOTYPES = YES;
489 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
490 | CLANG_WARN_UNREACHABLE_CODE = YES;
491 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
492 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
493 | COPY_PHASE_STRIP = YES;
494 | ENABLE_NS_ASSERTIONS = NO;
495 | ENABLE_STRICT_OBJC_MSGSEND = YES;
496 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
497 | GCC_C_LANGUAGE_STANDARD = gnu99;
498 | GCC_NO_COMMON_BLOCKS = YES;
499 | GCC_PREPROCESSOR_DEFINITIONS = (
500 | "$(inherited)",
501 | _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
502 | );
503 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
504 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
505 | GCC_WARN_UNDECLARED_SELECTOR = YES;
506 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
507 | GCC_WARN_UNUSED_FUNCTION = YES;
508 | GCC_WARN_UNUSED_VARIABLE = YES;
509 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
510 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
511 | LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
512 | MTL_ENABLE_DEBUG_INFO = NO;
513 | OTHER_CFLAGS = "$(inherited)";
514 | OTHER_CPLUSPLUSFLAGS = "$(inherited)";
515 | OTHER_LDFLAGS = (
516 | "$(inherited)",
517 | " ",
518 | );
519 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
520 | SDKROOT = iphoneos;
521 | VALIDATE_PRODUCT = YES;
522 | };
523 | name = Release;
524 | };
525 | /* End XCBuildConfiguration section */
526 |
527 | /* Begin XCConfigurationList section */
528 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "expoforegroundactionsexample" */ = {
529 | isa = XCConfigurationList;
530 | buildConfigurations = (
531 | 13B07F941A680F5B00A75B9A /* Debug */,
532 | 13B07F951A680F5B00A75B9A /* Release */,
533 | );
534 | defaultConfigurationIsVisible = 0;
535 | defaultConfigurationName = Release;
536 | };
537 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "expoforegroundactionsexample" */ = {
538 | isa = XCConfigurationList;
539 | buildConfigurations = (
540 | 83CBBA201A601CBA00E9B192 /* Debug */,
541 | 83CBBA211A601CBA00E9B192 /* Release */,
542 | );
543 | defaultConfigurationIsVisible = 0;
544 | defaultConfigurationName = Release;
545 | };
546 | /* End XCConfigurationList section */
547 | };
548 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
549 | }
550 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample.xcodeproj/xcshareddata/xcschemes/expoforegroundactionsexample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 |
5 | @interface AppDelegate : EXAppDelegateWrapper
6 |
7 | @end
8 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/AppDelegate.mm:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 | #import
5 |
6 | @implementation AppDelegate
7 |
8 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
9 | {
10 | self.moduleName = @"main";
11 |
12 | // You can add your custom initial props in the dictionary below.
13 | // They will be passed down to the ViewController used by React Native.
14 | self.initialProps = @{};
15 |
16 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
17 | }
18 |
19 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
20 | {
21 | #if DEBUG
22 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"];
23 | #else
24 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
25 | #endif
26 | }
27 |
28 | // Linking API
29 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options {
30 | return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
31 | }
32 |
33 | // Universal Links
34 | - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler {
35 | BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
36 | return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
37 | }
38 |
39 | // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
40 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
41 | {
42 | return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
43 | }
44 |
45 | // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
46 | - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
47 | {
48 | return [super application:application didFailToRegisterForRemoteNotificationsWithError:error];
49 | }
50 |
51 | // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
52 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
53 | {
54 | return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
55 | }
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/ios/expoforegroundactionsexample/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "filename": "App-Icon-1024x1024@1x.png",
5 | "idiom": "universal",
6 | "platform": "ios",
7 | "size": "1024x1024"
8 | }
9 | ],
10 | "info": {
11 | "version": 1,
12 | "author": "expo"
13 | }
14 | }
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "expo"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/SplashScreen.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "idiom": "universal",
5 | "filename": "image.png",
6 | "scale": "1x"
7 | },
8 | {
9 | "idiom": "universal",
10 | "scale": "2x"
11 | },
12 | {
13 | "idiom": "universal",
14 | "scale": "3x"
15 | }
16 | ],
17 | "info": {
18 | "version": 1,
19 | "author": "expo"
20 | }
21 | }
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/SplashScreen.imageset/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/ios/expoforegroundactionsexample/Images.xcassets/SplashScreen.imageset/image.png
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/SplashScreenBackground.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "idiom": "universal",
5 | "filename": "image.png",
6 | "scale": "1x"
7 | },
8 | {
9 | "idiom": "universal",
10 | "scale": "2x"
11 | },
12 | {
13 | "idiom": "universal",
14 | "scale": "3x"
15 | }
16 | ],
17 | "info": {
18 | "version": 1,
19 | "author": "expo"
20 | }
21 | }
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Images.xcassets/SplashScreenBackground.imageset/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Acetyld/expo-foreground-actions/9c1f35716aadcbc5f13a3605c37b767f55c4d8c0/example/ios/expoforegroundactionsexample/Images.xcassets/SplashScreenBackground.imageset/image.png
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CADisableMinimumFrameDurationOnPhone
6 |
7 | CFBundleDevelopmentRegion
8 | $(DEVELOPMENT_LANGUAGE)
9 | CFBundleDisplayName
10 | expo-foreground-actions-example
11 | CFBundleExecutable
12 | $(EXECUTABLE_NAME)
13 | CFBundleIdentifier
14 | $(PRODUCT_BUNDLE_IDENTIFIER)
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | $(PRODUCT_NAME)
19 | CFBundlePackageType
20 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
21 | CFBundleShortVersionString
22 | 1.0.0
23 | CFBundleSignature
24 | ????
25 | CFBundleURLTypes
26 |
27 |
28 | CFBundleURLSchemes
29 |
30 | expo.modules.foregroundactions.example
31 |
32 |
33 |
34 | CFBundleVersion
35 | 1
36 | LSRequiresIPhoneOS
37 |
38 | NSAppTransportSecurity
39 |
40 | NSAllowsArbitraryLoads
41 |
42 | NSExceptionDomains
43 |
44 | localhost
45 |
46 | NSExceptionAllowsInsecureHTTPLoads
47 |
48 |
49 |
50 |
51 | UILaunchStoryboardName
52 | SplashScreen
53 | UIRequiredDeviceCapabilities
54 |
55 | armv7
56 |
57 | UIRequiresFullScreen
58 |
59 | UIStatusBarStyle
60 | UIStatusBarStyleDefault
61 | UISupportedInterfaceOrientations
62 |
63 | UIInterfaceOrientationPortrait
64 | UIInterfaceOrientationPortraitUpsideDown
65 |
66 | UISupportedInterfaceOrientations~ipad
67 |
68 | UIInterfaceOrientationPortrait
69 | UIInterfaceOrientationPortraitUpsideDown
70 | UIInterfaceOrientationLandscapeLeft
71 | UIInterfaceOrientationLandscapeRight
72 |
73 | UIUserInterfaceStyle
74 | Light
75 | UIViewControllerBasedStatusBarAppearance
76 |
77 |
78 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/SplashScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/Supporting/Expo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | EXUpdatesCheckOnLaunch
6 | ALWAYS
7 | EXUpdatesEnabled
8 |
9 | EXUpdatesLaunchWaitMs
10 | 0
11 | EXUpdatesSDKVersion
12 | 49.0.0
13 |
14 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/expoforegroundactionsexample-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/expoforegroundactionsexample.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/expoforegroundactionsexample/noop-file.swift:
--------------------------------------------------------------------------------
1 | //
2 | // @generated
3 | // A blank Swift file must be created for native modules with Swift files to work correctly.
4 | //
5 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | // Learn more https://docs.expo.io/guides/customizing-metro
2 | const { getDefaultConfig } = require('expo/metro-config');
3 | const path = require('path');
4 |
5 | const config = getDefaultConfig(__dirname);
6 |
7 | // npm v7+ will install ../node_modules/react-native because of peerDependencies.
8 | // To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native,
9 | // excludes the one from the parent folder when bundling.
10 | config.resolver.blockList = [
11 | ...Array.from(config.resolver.blockList ?? []),
12 | new RegExp(path.resolve('..', 'node_modules', 'react-native')),
13 | ];
14 |
15 | config.resolver.nodeModulesPaths = [
16 | path.resolve(__dirname, './node_modules'),
17 | path.resolve(__dirname, '../node_modules'),
18 | ];
19 |
20 | config.watchFolders = [path.resolve(__dirname, '..')];
21 |
22 | config.transformer.getTransformOptions = async () => ({
23 | transform: {
24 | experimentalImportSupport: false,
25 | inlineRequires: true,
26 | },
27 | });
28 |
29 | module.exports = config;
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "expo-foreground-actions-example",
3 | "version": "1.0.0",
4 | "main": "node_modules/expo/AppEntry.js",
5 | "scripts": {
6 | "start": "expo start",
7 | "android": "expo run:android",
8 | "ios": "expo run:ios",
9 | "web": "expo start --web"
10 | },
11 | "dependencies": {
12 | "expo": "~49.0.15",
13 | "expo-device": "~5.4.0",
14 | "expo-splash-screen": "~0.20.5",
15 | "expo-status-bar": "~1.6.0",
16 | "react": "18.2.0",
17 | "react-native": "0.72.6"
18 | },
19 | "devDependencies": {
20 | "@babel/core": "^7.20.0",
21 | "@types/react": "~18.2.14",
22 | "typescript": "^5.1.3"
23 | },
24 | "private": true,
25 | "expo": {
26 | "autolinking": {
27 | "nativeModulesDir": ".."
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/example/plugins/expo-foreground-actions.js:
--------------------------------------------------------------------------------
1 | const { withAndroidManifest, AndroidConfig } = require("expo/config-plugins");
2 | const { getMainApplicationOrThrow } = AndroidConfig.Manifest;
3 |
4 | module.exports = function withBackgroundActions(config) {
5 | return withAndroidManifest(config, async (config) => {
6 | const application = getMainApplicationOrThrow(config.modResults);
7 | const service = application.service ? application.service : [];
8 |
9 | config.modResults = {
10 | manifest: {
11 | ...config.modResults.manifest,
12 | application: [
13 | {
14 | ...application,
15 | service: [
16 | ...service,
17 | {
18 | $: {
19 | "android:name":
20 | "expo.modules.foregroundactions.ExpoForegroundActionsService",
21 | },
22 | },
23 | ],
24 | },
25 | ],
26 | },
27 | };
28 |
29 | return config;
30 | });
31 | };
32 |
--------------------------------------------------------------------------------
/example/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
EXPO-FOREGROUND-ACTIONS EXAMPLE
5 |
6 |
7 | ---
8 |
9 | ## 📍 How to run?
10 | - Run yarn
11 | - Run yarn ios or yarn android
12 |
--------------------------------------------------------------------------------
/example/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "expo/tsconfig.base",
3 | "compilerOptions": {
4 | "strict": true,
5 | "paths": {
6 | "expo-foreground-actions": ["../src/index"],
7 | "expo-foreground-actions/*": ["../src/*"]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/example/webpack.config.js:
--------------------------------------------------------------------------------
1 | const createConfigAsync = require('@expo/webpack-config');
2 | const path = require('path');
3 |
4 | module.exports = async (env, argv) => {
5 | const config = await createConfigAsync(
6 | {
7 | ...env,
8 | babel: {
9 | dangerouslyAddModulePathsToTranspile: ['expo-foreground-actions'],
10 | },
11 | },
12 | argv
13 | );
14 | config.resolve.modules = [
15 | path.resolve(__dirname, './node_modules'),
16 | path.resolve(__dirname, '../node_modules'),
17 | ];
18 |
19 | return config;
20 | };
21 |
--------------------------------------------------------------------------------
/expo-module.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "platforms": ["ios", "android"],
3 | "ios": {
4 | "modules": ["ExpoForegroundActionsModule"]
5 | },
6 | "android": {
7 | "modules": ["expo.modules.foregroundactions.ExpoForegroundActionsModule"]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ios/ExpoForegroundActions.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'ExpoForegroundActions'
7 | s.version = package['version']
8 | s.summary = package['description']
9 | s.description = package['description']
10 | s.license = package['license']
11 | s.author = package['author']
12 | s.homepage = package['homepage']
13 | s.platform = :ios, '13.0'
14 | s.swift_version = '5.4'
15 | s.source = { git: 'https://github.com/Acetyld/expo-foreground-actions' }
16 | s.static_framework = true
17 |
18 | s.dependency 'ExpoModulesCore'
19 |
20 | # Swift/Objective-C compatibility
21 | s.pod_target_xcconfig = {
22 | 'DEFINES_MODULE' => 'YES',
23 | 'SWIFT_COMPILATION_MODE' => 'wholemodule'
24 | }
25 |
26 | s.source_files = "**/*.{h,m,swift}"
27 | end
28 |
--------------------------------------------------------------------------------
/ios/ExpoForegroundActionsModule.swift:
--------------------------------------------------------------------------------
1 | import ExpoModulesCore
2 | let ON_EXPIRATION_EVENT = "onExpirationEvent"
3 |
4 | public class ExpoForegroundActionsModule: Module {
5 | var backgroundTaskIdentifiers: [UIBackgroundTaskIdentifier] = []
6 |
7 | // Each module class must implement the definition function. The definition consists of components
8 | // that describes the module's functionality and behavior.
9 | // See https://docs.expo.dev/modules/module-api for more details about available components.
10 | public func definition() -> ModuleDefinition {
11 | Events(ON_EXPIRATION_EVENT)
12 |
13 | // Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
14 | // Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
15 | // The module will be accessible from `requireNativeModule('ExpoForegroundActions')` in JavaScript.
16 | Name("ExpoForegroundActions")
17 |
18 | AsyncFunction("startForegroundAction") { (promise: Promise) in
19 |
20 | var backgroundTaskIdentifier: UIBackgroundTaskIdentifier = .invalid
21 |
22 | backgroundTaskIdentifier = UIApplication.shared.beginBackgroundTask {
23 | // Expiration block, perform cleanup including endBackgroundTask
24 | self.onExpiration(amount: UIApplication.shared.backgroundTimeRemaining, identifier:backgroundTaskIdentifier);
25 | UIApplication.shared.endBackgroundTask(backgroundTaskIdentifier)
26 | }
27 | backgroundTaskIdentifiers.append(backgroundTaskIdentifier)
28 | print(backgroundTaskIdentifier.rawValue);
29 | promise.resolve(backgroundTaskIdentifier.rawValue)
30 |
31 | }
32 | AsyncFunction("stopForegroundAction") { (taskIdentifier: Int, promise: Promise) in
33 | let backgroundTaskID = UIBackgroundTaskIdentifier.init(rawValue: taskIdentifier);
34 |
35 | if backgroundTaskID == .invalid {
36 | print("Background task with identifier \(taskIdentifier) does not exist or has already been ended")
37 | promise.resolve()
38 | return
39 | }
40 |
41 | if let index = backgroundTaskIdentifiers.firstIndex(where: {$0.rawValue == taskIdentifier}) {
42 | backgroundTaskIdentifiers.remove(at: index)
43 | }
44 | UIApplication.shared.endBackgroundTask(backgroundTaskID)
45 |
46 | promise.resolve()
47 | }
48 |
49 | AsyncFunction("forceStopAllForegroundActions") { (promise: Promise) in
50 | for identifier in backgroundTaskIdentifiers {
51 | print("Stopping identifier:",identifier.rawValue)
52 | UIApplication.shared.endBackgroundTask(identifier)
53 | }
54 | backgroundTaskIdentifiers.removeAll()
55 | promise.resolve()
56 | }
57 |
58 |
59 | AsyncFunction("getBackgroundTimeRemaining") { (promise: Promise) in
60 | promise.resolve(UIApplication.shared.backgroundTimeRemaining)
61 | }
62 |
63 | AsyncFunction("getForegroundIdentifiers") { (promise: Promise) in
64 | let identifierValues = backgroundTaskIdentifiers.map { $0.rawValue }
65 | promise.resolve(identifierValues)
66 | }
67 |
68 | }
69 |
70 | @objc
71 | private func onExpiration(amount:Double,identifier:UIBackgroundTaskIdentifier) {
72 | sendEvent(ON_EXPIRATION_EVENT, [
73 | "remaining": amount,
74 | "identifier": identifier.rawValue
75 | ])
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "expo-foreground-actions",
3 | "version": "0.4.3",
4 | "description": "My new module",
5 | "main": "build/index.js",
6 | "types": "build/index.d.ts",
7 | "scripts": {
8 | "build": "expo-module build",
9 | "clean": "expo-module clean",
10 | "lint": "expo-module lint",
11 | "test": "expo-module test",
12 | "prepare": "expo-module prepare",
13 | "prepublishOnly": "expo-module prepublishOnly",
14 | "expo-module": "expo-module",
15 | "open:ios": "open -a \"Xcode\" example/ios",
16 | "open:android": "open -a \"Android Studio\" example/android"
17 | },
18 | "keywords": [
19 | "react-native",
20 | "expo",
21 | "expo-modules-api",
22 | "expo-modules",
23 | "expo-foreground-actions",
24 | "ExpoForegroundActions"
25 | ],
26 | "repository": "https://github.com/Acetyld/expo-foreground-actions",
27 | "bugs": {
28 | "url": "https://github.com/Acetyld/expo-foreground-actions/issues"
29 | },
30 | "author": "Dion ()",
31 | "license": "MIT",
32 | "homepage": "https://github.com/Acetyld/expo-foreground-actions#readme",
33 | "devDependencies": {
34 | "@types/react": "^18.0.25",
35 | "@types/react-native": "^0.61.17",
36 | "expo-device": "^5.6.0",
37 | "expo-module-scripts": "^3.0.11",
38 | "expo-modules-core": "^1.5.11",
39 | "react-native": "^0.62.3"
40 | },
41 | "peerDependencies": {
42 | "expo": "*",
43 | "expo-device": "*",
44 | "react": "*",
45 | "react-native": "*"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/plugins/expo-foreground-actions.js:
--------------------------------------------------------------------------------
1 | const { withAndroidManifest, AndroidConfig } = require("expo/config-plugins");
2 | const { getMainApplicationOrThrow } = AndroidConfig.Manifest;
3 |
4 | module.exports = function withBackgroundActions(config) {
5 | return withAndroidManifest(config, async (config) => {
6 | const application = getMainApplicationOrThrow(config.modResults);
7 | const service = application.service ? application.service : [];
8 |
9 | config.modResults = {
10 | manifest: {
11 | ...config.modResults.manifest,
12 | application: [
13 | {
14 | ...application,
15 | service: [
16 | ...service,
17 | {
18 | $: {
19 | "android:name":
20 | "expo.modules.foregroundactions.ExpoForegroundActionsService",
21 | },
22 | },
23 | ],
24 | },
25 | ],
26 | },
27 | };
28 |
29 | return config;
30 | });
31 | };
32 |
--------------------------------------------------------------------------------
/src/ExpoForegroundActions.types.ts:
--------------------------------------------------------------------------------
1 | export type ExpireEventPayload = {
2 | remaining: number;
3 | identifier: number;
4 | };
5 |
6 | export interface AndroidSettings {
7 | headlessTaskName: string;
8 | notificationTitle: string;
9 | notificationDesc: string;
10 | notificationColor: string;
11 | notificationIconName: string;
12 | notificationIconType: string;
13 | notificationProgress: number;
14 | notificationMaxProgress: number;
15 | notificationIndeterminate: boolean;
16 | linkingURI: string;
17 | }
18 |
19 | export interface Settings {
20 | events?: {
21 | onIdentifier?: (identifier: number) => void;
22 | }
23 | runInJS?: boolean,
24 | }
25 |
26 | export interface ForegroundApi {
27 | headlessTaskName: string;
28 | identifier: number;
29 | }
30 |
31 | export type ForegroundAction = (params: Params, api: ForegroundApi) => Promise;
32 |
--------------------------------------------------------------------------------
/src/ExpoForegroundActionsModule.ts:
--------------------------------------------------------------------------------
1 | import { requireNativeModule } from "expo-modules-core";
2 |
3 | // It loads the native module object from the JSI or falls back to
4 | // the bridge module (from NativeModulesProxy) if the remote debugger is on.
5 | export default requireNativeModule("ExpoForegroundActions");
6 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import {
2 | NativeModulesProxy,
3 | EventEmitter,
4 | Subscription,
5 | Platform
6 | } from "expo-modules-core";
7 | import { platformApiLevel } from "expo-device";
8 | import {
9 | ExpireEventPayload,
10 | AndroidSettings,
11 | ForegroundApi, Settings
12 | } from "./ExpoForegroundActions.types";
13 | import ExpoForegroundActionsModule from "./ExpoForegroundActionsModule";
14 | import { AppRegistry, AppState } from "react-native";
15 |
16 | const emitter = new EventEmitter(
17 | ExpoForegroundActionsModule ?? NativeModulesProxy.ExpoForegroundActions
18 | );
19 |
20 | let ranTaskCount: number = 0;
21 | let jsIdentifier: number = 0;
22 |
23 |
24 | export class NotForegroundedError extends Error {
25 | constructor(message: string) {
26 | super(message); // (1)
27 | this.name = "NotForegroundedError"; // (2)
28 | }
29 | }
30 |
31 | const startForegroundAction = async (options?: AndroidSettings): Promise => {
32 | if (Platform.OS === "android" && !options) {
33 | throw new Error("Foreground action options cannot be null on android");
34 | }
35 | if (Platform.OS === "android") {
36 | return ExpoForegroundActionsModule.startForegroundAction(options);
37 | } else {
38 | return ExpoForegroundActionsModule.startForegroundAction();
39 | }
40 | };
41 |
42 |
43 | // Get the native constant value.
44 | export const runForegroundedAction = async (act: (api: ForegroundApi) => Promise, androidSettings: AndroidSettings, settings: Settings = { runInJS: false }): Promise => {
45 | if (!androidSettings) {
46 | throw new Error("Foreground action options cannot be null");
47 | }
48 |
49 | if (AppState.currentState === "background") {
50 | throw new NotForegroundedError("Foreground actions can only be run in the foreground");
51 | }
52 |
53 | if (Platform.OS === "android" && platformApiLevel && platformApiLevel < 26) {
54 | settings.runInJS = true;
55 | }
56 |
57 | const headlessTaskName = `${androidSettings.headlessTaskName}${ranTaskCount}`;
58 |
59 | const initOptions = { ...androidSettings, headlessTaskName };
60 | const action = async (identifier: number) => {
61 | if (AppState.currentState === "background") {
62 | throw new NotForegroundedError("Foreground actions can only be run in the foreground");
63 | }
64 | await act({
65 | headlessTaskName,
66 | identifier
67 | });
68 | };
69 | if (Platform.OS !== "ios" && Platform.OS !== "android") {
70 | throw new Error("Unsupported platform, currently only ios and android are supported");
71 | }
72 |
73 | try {
74 |
75 | ranTaskCount++;
76 |
77 | if (settings.runInJS === true) {
78 | await runJS(action, settings);
79 | return;
80 | }
81 | if (Platform.OS === "android") {
82 | /*On android we wrap the headless task in a promise so we can "await" the starter*/
83 | await runAndroid(action, initOptions, settings);
84 | return;
85 | }
86 | if (Platform.OS === "ios") {
87 | await runIos(action, settings);
88 | return;
89 | }
90 | return;
91 | } catch (e) {
92 | throw e;
93 | }
94 | };
95 |
96 |
97 | const runJS = async (action: (identifier: number) => Promise, settings: Settings) => {
98 | jsIdentifier++;
99 | settings?.events?.onIdentifier?.(jsIdentifier);
100 | await action(jsIdentifier);
101 | jsIdentifier = 0;
102 | };
103 |
104 | const runIos = async (action: (identifier: number) => Promise, settings: Settings) => {
105 | const identifier = await startForegroundAction();
106 | settings?.events?.onIdentifier?.(identifier);
107 | try {
108 | await action(identifier);
109 | } catch (e) {
110 | throw e;
111 | } finally {
112 | await stopForegroundAction(identifier);
113 | }
114 | };
115 |
116 | const runAndroid = async (action: (identifier: number) => Promise, options: AndroidSettings, settings: Settings) => new Promise(async (resolve, reject) => {
117 | try {
118 | /*First we register the headless task so we can run it from the Foreground service*/
119 | AppRegistry.registerHeadlessTask(options.headlessTaskName, () => async (taskdata: { notificationId: number }) => {
120 | const { notificationId } = taskdata;
121 | /*Then we start the actuall foreground action, we all do this in the headless task, without touching UI, we can still update UI be using something like Realm for example*/
122 | try {
123 | settings?.events?.onIdentifier?.(notificationId);
124 | await action(notificationId);
125 | await stopForegroundAction(notificationId);
126 | resolve();
127 | } catch (e) {
128 | /*We do this to make sure its ALWAYS stopped*/
129 | await stopForegroundAction(notificationId);
130 | throw e;
131 | }
132 | });
133 | await startForegroundAction(options);
134 |
135 | } catch (e) {
136 | reject(e);
137 | throw e;
138 | }
139 | });
140 |
141 | export const updateForegroundedAction = async (id: number, options: AndroidSettings) => {
142 | if (Platform.OS !== "android") return;
143 | return ExpoForegroundActionsModule.updateForegroundedAction(id, options);
144 | };
145 |
146 | // noinspection JSUnusedGlobalSymbols
147 | export const stopForegroundAction = async (id: number): Promise => {
148 | await ExpoForegroundActionsModule.stopForegroundAction(id);
149 | };
150 |
151 | // noinspection JSUnusedGlobalSymbols
152 | export const forceStopAllForegroundActions = async (): Promise => {
153 | await ExpoForegroundActionsModule.forceStopAllForegroundActions();
154 | };
155 |
156 | // noinspection JSUnusedGlobalSymbols
157 | export const getForegroundIdentifiers = async (): Promise => ExpoForegroundActionsModule.getForegroundIdentifiers();
158 | // noinspection JSUnusedGlobalSymbols
159 | export const getRanTaskCount = () => ranTaskCount;
160 |
161 | export const getBackgroundTimeRemaining = async (): Promise => {
162 | if (Platform.OS !== "ios") return -1;
163 | return await ExpoForegroundActionsModule.getBackgroundTimeRemaining();
164 | };
165 |
166 |
167 | export function addExpirationListener(
168 | listener: (event: ExpireEventPayload) => void
169 | ): Subscription {
170 | return emitter.addListener("onExpirationEvent", listener);
171 | }
172 |
173 | export { ExpireEventPayload };
174 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | // @generated by expo-module-scripts
2 | {
3 | "extends": "expo-module-scripts/tsconfig.base",
4 | "compilerOptions": {
5 | "outDir": "./build"
6 | },
7 | "include": ["./src"],
8 | "exclude": ["**/__mocks__/*", "**/__tests__/*"]
9 | }
10 |
--------------------------------------------------------------------------------