Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow

iOS 18.5 Video Thumbnail Permission Error in Expo

$
0
0

I’m trying to generate a thumbnail from a local video on iOS 18.5 (iPhone 11 Pro) using expo-media-library and expo-video-thumbnails.

Here’s the relevant code:

// Get asset infoconst assetInfo = await MediaLibrary.getAssetInfoAsync(asset.id);let videoUri = assetInfo.localUri || '';if (!videoUri) {  return null;}const thumbnail = await VideoThumbnails.getThumbnailAsync(videoUri, {  time: 0,  quality: 0.6,});

I get the following log:

Media library permission status: trueassetInfo============ { ... , localUri: "file:///var/mobile/Media/DCIM/100APPLE/IMG_0131.MOV#..." }Direct thumbnail generation failed, trying export method: The file couldn’t be opened because you don’t have permission to view it.

Media library permission is already granted (true).The localUri looks correct.If I preview the video in the app first, then try generating the thumbnail, it works — but not before.

I found that if I tried to play my local videos on my APP, it reported "The file couldn’t be opened because you don’t have permission to view it.", too.

Has anyone experienced this on iOS 18+? Is there a known workaround for accessing local videos directly for thumbnail generation?

Thanks in advance!

find a way to solve the problem without having to make a backup.


How to add a margin to an expandable calendar while keeping the content centered ReactNative

$
0
0

I have an expandable calendar, and I am trying to add margin to its not fully on the sides of the screen, however, the calendar contents seem to not adjust and get cut off by the loss of space due to the margin. Is there any way to fix it? I have tried alignItems, alignSelf, justifyContent, but still nothing seems to work. Here is the code for my calendar. It is in a safeAreaView, does that have something to do with it?:

return (<CalendarProvider  date={selectedDate}  onDateChanged={handleDayPress}  style={styles.container}><SafeAreaView style={{ flex: 1 }}><View style={{marginHorizontal: 20, justifyContent: "center", alignItems: "center", textAlign: "center",}}><ExpandableCalendar      onDayPress={handleDayPress}      markedDates={markedDates}      initialPosition="open"      hideKnob={false}      allowShadow={true}      closeOnDayPress={false}      theme={{        calendarBackground: colors.white,        todayTextColor: '#36C0EA',        dayTextColor: colors.black,        monthTextColor: colors.black,        textSectionTitleColor: colors.black,        selectedDayBackgroundColor: colors.basicButton,        selectedDotColor: colors.basicButton,        dotColor: colors.redCircle,        contentStyle: {          paddingHorizontal: 20,        },      }}    /></View><ScrollView style={styles.selectedDateContainer}><Text style={styles.selectedDateText}>        {selectedDateText ? `${selectedDateText}` : "Select a date"}</Text>      {diagnosticStatus ? (<View style={styles.diagnosticContainer}><Text            style={styles.diagnosticText}            onPress={() => navigation.navigate('DiagnosticScreen')}>            {diagnosticStatus}</Text></View>      ) : null}      {items[selectedDate] ? (        items[selectedDate].map((lesson, index) => (<View key={index} style={styles.lessonItem}><Text style={styles.lessonText}>{lesson.name}</Text><Text style={styles.lessonStatusText}>              {getLessonStatus(lesson.id)}</Text></View>        ))      ) : (<Text style={styles.noLessonText}>No lessons scheduled for today!</Text>      )}</ScrollView></SafeAreaView></CalendarProvider>

Reanimated Mismatch between JavaScript part and native part of Reanimated 3.0.0-rc.9 vs. undefined

$
0
0

I am trying to show a react native screen from my native(swift code) UIViewController using RCTRootView. I keep getting this mismatch error that I think is related to expo, I have tried re-registering the component in various ways, as well as setting jsCodeLocation straight to local host with no avail

Error Message.

error message

Index.js.index.js

babel-config jsbabel-config js

ViewControllerViewController

AWS Cognito Identity Pool: InvalidIdentityPoolConfigurationException when using Google ID token from React Native iOS app

$
0
0

I’m trying to authenticate users via Google in my React Native iOS app, then verify the ID token in AWS Cognito to assume a role and access AWS resources.

Here’s my setup:

  1. Google OAuth 2.0 Clients:

One for Web

One for iOS

  1. Cognito Identity Pool:

Authentication provider: accounts.google.com

iOS client ID configured in Client ID field

Role selection: default role

Claim mapping: Default mappings

IAM Role Trust Policy:

{"Version": "2012-10-17","Statement": [        {"Effect": "Allow","Principal": {"Federated": "cognito-identity.amazonaws.com"            },"Action": "sts:AssumeRoleWithWebIdentity","Condition": {"StringEquals": {"cognito-identity.amazonaws.com:aud": "us-east-1:<Cognito Identity Pool Id>"                },"ForAnyValue:StringLike": {"cognito-identity.amazonaws.com:amr": "authenticated"                }            }        }    ]}
  1. ID Token from React Native iOS app (decoded):
{"iss": "https://accounts.google.com","azp": "<iosClientId>","aud": "<webClientId>","sub": "xxxxxxx","email": "xxxxx@gmail.com","email_verified": true,"at_hash": "xxxxxx","nonce": "xxxxx","name": "xxxxx","picture": "https://lh3.googleusercontent.com/a/xxxx","given_name": "xxx","family_name": "xxx","iat": 1756173447,"exp": 1756177047}
  1. Testing with AWS CLI:
aws cognito-identity get-credentials-for-identity \    --identity-id us-east-1:<google-identity-id-under-identity-browser> \    --logins "accounts.google.com=<google idToken>"

Observed behavior:

A new Cognito Identity is created in the console when run above cli but fails with:

An error occurred (InvalidIdentityPoolConfigurationException) when calling the GetCredentialsForIdentity operation: Invalid identity pool configuration. Check assigned IAM roles for this pool.

Question:What could cause InvalidIdentityPoolConfigurationException in this scenario? Request help resolving this. Thank you in advance.

React Native RNPickerSelect doesn't open on iOS

$
0
0

All works fine on android but in iOS my picker doesn't open.I have tried to change style, remove style, but nothing works.

My picker :

<View style={[styles.pickerWrapper, styles.marge]}><RNPickerSelect                                    placeholder={{}}                                    onValueChange={(itemValue) => setSelectedTypeTest(itemValue)}                                    items={Constants.getTypeTest().map((test) => ({                                        label: t(test.label),                                        value: test.value,                                    }))}                                    style={{                                        inputAndroid: styles.inputAndroid,                                        inputIOS: styles.inputIOS,                                        viewContainer: styles.viewContainer,                                    }}                                    value={selectedTypePlanet}                                    useNativeAndroidPickerStyle={false}                                    doneText="OK"                                /></View>

Style for iOS :

inputIOS: {    height: 30,    paddingTop: 0,    paddingBottom: 0,    justifyContent: 'center',    alignItems: 'center',    textAlign: 'center',    backgroundColor: '#074183',    color: 'aliceblue',    borderRadius: 50,    borderWidth: 1,    borderColor: 'aliceblue',    paddingHorizontal: 10,    lineHeight: 15,    width: width * 0.4,    fontWeight: 500,},

Style for container:

 viewContainer: {    flex: 1,    justifyContent: 'center',    alignItems: 'center',    height: 50,    width: '100%',},

I have seen on other topics: "overflow: 'hidden'" can resolve it, but don't change something for me.

React Native ios build : Can't find node

$
0
0

I have a prototype ready to go and the project is jammed with build:

error: Can't find 'node' binary to build React Native bundle If you have non-standard nodejs installation, select your project in Xcode, find 'Build Phases' - 'Bundle React Native code and images' and change NODE_BINARY to absolute path to your node executable (you can find it by invoking 'which node' in the terminal)

this feedback is helpless for me, i do have node with nvm. is this something related to bash?

React Native Dynamic Link being added to sendSignInLinkToEmail even with different url/linkDomain passed in actionCodeSettings

$
0
0

I have been using sendSignInLinkToEmail for Firebase Authentication to send link to login to email. Recently Dynamic Link URLs got deprecated. Hence I have switched to PROJECT_NAME.firbaseapp.com for linkDomain and use https://PROJECT_NAME.firbaseapp.com for sendSignInLinkToEmailactionCodeSettings value in @react-native-firebase/auth plugin.

But, instead of using the sent actionCodeSettings Object, it uses Dynamic Link within the project.

To verify, I created a new project and used the default domain and GoogleService-Info file for iOS. It works fine with the same setup.

Why is the old project forcing the Dynamic link to be added to the link in the email?

How can I make the old project send the link with PROJECT_NAME.firbaseapp.com instead of the old dynamic link?

I have tried to use actionCodeSettings as follows, but it fails:

const actionCodeSettings = {    handleCodeInApp: true,    url: "https://PROJECT_NAME.firbaseapp.com",    iOS: {"com.project.bundleid",    },    linkDomain: "PROJECT_NAME.firbaseapp.com"}

I created a new project, hosted the default domain and it works as expected.

How to enable/disable Hermes based on Android/iOS Environment Variables in React Native?

$
0
0

Due to compatibility issues of Hermes (in RN +71.0) with React Native Debugger, I want to disable Hermes on Development and enable it on Production automatically, with Android/iOS specific ENV files.

In gradle.properties:

# Use this property to enable or disable the Hermes JS engine.# If set to false, you will be using JSC instead.hermesEnabled=true

In Podfile:

  use_react_native!(    .....    # Hermes is now enabled by default. Disable by setting this flag to false.    # Upcoming versions of React Native may rely on get_default_flags(), but    # we make it explicit here to aid in the React Native upgrade process.    :hermes_enabled => true,    .....  )

I'm not quite familiar with setting up Android/iOS environment variables, so I was wondering how I can use it to enable/disable Hermes based on my environment?


Having trouble with my iOS simulator not working properly with React Native and Expo

$
0
0

I installed the beta version of Xcode (Xcode 16) to be able to install and use an iOS 26 simulator. The simulator is running with iOS 26 but has no effects when opening a React Native w/ Expo app. I am not using Expo Go to view the app so I am not sure where exactly the problem is. When I open an app I built and ran I cannot even see the basic status bar gradient/blur effect that is shown when scrolling down which should work natively without configuration. When opening any of the preinstalled apps such as settings I do see the effects along with the liquid glass widgets and home dock on the simulator so I know the simulator is running on iOS 26.

To clarify, React Native w/ Expo apps build and run just fine. The issue is that any app I build and run does not get the native status bar gradient/blur effects or the liquid glass tab bar at the bottom which leads me to believe I made a mistake somewhere along the way with my setup/configuration.

Here's a list of the things I've tried but did not work:

  • Made sure reduce transparency is off in the settings
  • Cleaned the root directory and reinstalled everything by running rm -rf .expo && rm -rf node_modules/.cache
  • Cleaned out the iOS/ build directory and rebuilt using both pod install and expo run:ios
  • Installed a fresh sample project provided by the docs using npx create-expo-app@latest NativeTabs --template @bottom-tabs/expo-template that properly displayed the status bar gradient/blur and native liquid glass tab bar on another persons machine and simulator.

Here are my dependencies:

"dependencies": {"@bottom-tabs/react-navigation": "^0.11.0","@expo/vector-icons": "^14.0.4","@react-navigation/native": "^7.1.17","@tanstack/react-query": "^5.84.1","date-fns": "^4.1.0","expo": "~53.0.22","expo-build-properties": "~0.14.8","expo-constants": "~17.1.7","expo-dev-client": "~5.2.4","expo-font": "^13.3.2","expo-linking": "~7.1.7","expo-router": "~5.1.5","expo-splash-screen": "^0.30.10","expo-status-bar": "~2.2.3","react": "19.0.0","react-hook-form": "^7.60.0","react-native": "~0.79.5","react-native-bottom-tabs": "^0.11.0","react-native-gesture-handler": "~2.24.0","react-native-safe-area-context": "5.4.0","react-native-screens": "4.11.1","zod": "^3.25.76"  }

Here is the podfile:

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")require 'json'podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}ENV['RCT_NEW_ARCH_ENABLED'] = '0' if podfile_properties['newArchEnabled'] == 'false'ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'install! 'cocoapods',  :deterministic_uuids => falseprepare_react_native_project!target 'SoundscapeFlow' do  use_expo_modules!  if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'    config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];  else    config_command = ['npx','expo-modules-autolinking','react-native-config','--json','--platform','ios'    ]  end  config = use_native_modules!(config_command)  use_frameworks! :linkage => :static  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']  use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']  use_react_native!(    :path => config[:reactNativePath],    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',    # An absolute path to your application root.    :app_path => "#{Pod::Config.instance.installation_root}/..",    :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',  )  post_install do |installer|    react_native_post_install(      installer,      config[:reactNativePath],      :mac_catalyst_enabled => false,      :ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',    )    # This is necessary for Xcode 14, because it signs resource bundles by default    # when building for devices.    installer.target_installation_results.pod_target_installation_results      .each do |pod_name, target_installation_result|      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|        resource_bundle_target.build_configurations.each do |config|          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'        end      end    end  endend

And these are some warnings I get after running pod install:

Analyzing dependenciesDownloading dependenciesGenerating Pods projectSetting USE_HERMES build settingsSetting REACT_NATIVE_PATH build settingsSetting SWIFT_ACTIVE_COMPILATION_CONDITIONS build settings[Ccache]: Removing Ccache from CC, LD, CXX & LDPLUSPLUS build settings[SPM] Cleaning old SPM dependencies from Pods project[SPM] Adding SPM dependencies to Pods project[Privacy Manifest Aggregation] Appending aggregated reasons to existing PrivacyInfo.xcprivacy file.[Privacy Manifest Aggregation] Reading .xcprivacy files to aggregate all used Required Reason APIs.Setting CLANG_CXX_LANGUAGE_STANDARD to c++20 on /Users/juansaldana/Projects/soundscape-flow-web/apps/mobile/ios/SoundscapeFlow.xcodeproj==================== DEPRECATION NOTICE =====================Calling `pod install` directly is deprecated in React Nativebecause we are moving away from Cocoapods toward alternativesolutions to build the project.* If you are using Expo, please run:`npx expo run:ios`* If you are using the Community CLI, please run:`yarn ios`=============================================================Pod install took 9 [s] to runIntegrating client projectPod installation complete! There are 93 dependencies from the Podfile and 95 total pods installed.[!] Can't merge pod_target_xcconfig for pod targets: ["expo-dev-menu", "Main", "ReactNativeCompatibles", "SafeAreaView", "Vendored"]. Singular build setting DEFINES_MODULE has different values.[!] Can't merge pod_target_xcconfig for pod targets: ["expo-dev-menu", "Main", "ReactNativeCompatibles", "SafeAreaView", "Vendored"]. Singular build setting DEFINES_MODULE has different values.

java.lang.UnsatisfiedLinkError: dlopen failed: library "libreact_featureflagsjni.so" not found

$
0
0

I was manually upgrading a react-native app from 0.67.2 to 0.76.2 (making changes in the required files). I was able to build the android app successfully after a day of debugging here and there. But when I tried to install it and run it, it throws the following runtime error. I've looked into the intermediates folder, but this file is not available. Then I've disabled the new architecture and hermes engin and tried to run. But that throws java.lang.UnsatisfiedLinkError: dlopen failed: library "libjscexecutor.so not found"

Thanks in advance for your help

    java.lang.UnsatisfiedLinkError: dlopen failed: library "libreact_featureflagsjni.so" not found        at java.lang.Runtime.loadLibrary0(Runtime.java:1081)        at java.lang.Runtime.loadLibrary0(Runtime.java:1003)        at java.lang.System.loadLibrary(System.java:1765)        at com.facebook.soloader.nativeloader.SystemDelegate.loadLibrary(SystemDelegate.java:24)        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:52)        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30)        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:869)        at com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsCxxInterop.<clinit>(ReactNativeFeatureFlagsCxxInterop.kt:28)        at com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsCxxAccessor.override(ReactNativeFeatureFlagsCxxAccessor.kt:505)        at com.facebook.react.internal.featureflags.ReactNativeFeatureFlags.override(ReactNativeFeatureFlags.kt:334)        at com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load(DefaultNewArchitectureEntryPoint.kt:46)        at com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load$default(DefaultNewArchitectureEntryPoint.kt:32)        at com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load(Unknown Source:3)        at com.companyId.appId.MainApplication.onCreate(MainApplication.java:73)        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7711)        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2478)        at android.os.Handler.dispatchMessage(Handler.java:106)        at android.os.Looper.loopOnce(Looper.java:230)        at android.os.Looper.loop(Looper.java:319)        at android.app.ActivityThread.main(ActivityThread.java:8919)        at java.lang.reflect.Method.invoke(Native Method)        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Output of npx react-native info

System:  OS: macOS 15.1  CPU: (8) arm64 Apple M1  Memory: 139.67 MB / 8.00 GB  Shell:    version: "5.9"    path: /bin/zshBinaries:  Node:    version: 18.19.0    path: ~/.nvm/versions/node/v18.19.0/bin/node  Yarn:    version: 1.22.22    path: ~/.nvm/versions/node/v18.19.0/bin/yarn  npm:    version: 10.2.3    path: ~/.nvm/versions/node/v18.19.0/bin/npm  Watchman:    version: 2024.11.18.00    path: /opt/homebrew/bin/watchmanManagers:  CocoaPods:    version: 1.16.2    path: /opt/homebrew/bin/podSDKs:  iOS SDK:    Platforms:      - DriverKit 24.1      - iOS 18.1      - macOS 15.1      - tvOS 18.1      - visionOS 2.1      - watchOS 11.1  Android SDK:    API Levels:      - "23"      - "24"      - "27"      - "28"      - "30"      - "31"      - "32"      - "33"      - "34"    Build Tools:      - 28.0.2      - 28.0.3      - 29.0.2      - 30.0.2      - 30.0.3      - 33.0.0      - 33.0.1      - 34.0.0      - 34.0.0    System Images:      - android-31 | Google Play ARM 64 v8a      - android-33 | Google APIs ARM 64 v8a      - android-33 | Google Play ARM 64 v8a    Android NDK: Not FoundIDEs:  Android Studio: 2023.2 AI-232.10300.40.2321.11567975  Xcode:    version: 16.1/16B40    path: /usr/bin/xcodebuildLanguages:  Java:    version: 17.0.13    path: /Users/abibv/.jenv/shims/javac  Ruby:    version: 2.6.10    path: /usr/bin/rubynpmPackages:"@react-native-community/cli":    installed: 15.1.2    wanted: ^15.1.2  react:    installed: 18.2.0    wanted: 18.2.0  react-native:    installed: 0.76.2    wanted: ^0.76.2  react-native-macos: Not FoundnpmGlobalPackages:"*react-native*": Not FoundAndroid:  hermesEnabled: true  newArchEnabled: trueiOS:  hermesEnabled: false  newArchEnabled: true

android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext {        buildToolsVersion = "34.0.0"        minSdkVersion = 31        compileSdkVersion = 34        targetSdkVersion = 34        ndkVersion = "26.1.10909125"        kotlinVersion = "1.9.0"        reactNativeArchitectures = ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]    }    repositories {        google()        mavenCentral()    }    dependencies {        classpath("com.android.tools.build:gradle:8.1.2")        classpath 'com.google.gms:google-services:4.3.15'        classpath("com.facebook.react:react-native-gradle-plugin")        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())allprojects {  configurations.all {      resolutionStrategy {        // Remove this override in 0.66, as a proper fix is included in react-native itself.        force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION        //         force "com.facebook.soloader:soloader:0.10.5"      }    }    repositories {        maven {            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm            url("$rootDir/../node_modules/react-native/android")        }        maven {            // Android JSC is installed from npm            url("$rootDir/../node_modules/jsc-android/dist")        }        mavenCentral {            // We don't want to fetch react-native from Maven Central as there are            // older versions over there.            // content {            //     excludeGroup "com.facebook.react"            // }        }        google()        maven { url 'https://www.jitpack.io' }    }}

android/app/build.gradle

apply plugin: "com.android.application"apply plugin: "com.facebook.react"apply plugin: "com.google.gms.google-services"apply plugin: "com.google.firebase.crashlytics"import com.android.build.OutputFile/** * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ *   // the name of the generated asset file containing your JS bundle *   bundleAssetName: "index.android.bundle", * *   // the entry file for bundle generation. If none specified and *   // "index.android.js" exists, it will be used. Otherwise "index.js" is *   // default. Can be overridden with ENTRY_FILE environment variable. *   entryFile: "index.android.js", * *   // https://reactnative.dev/docs/performance#enable-the-ram-format *   bundleCommand: "ram-bundle", * *   // whether to bundle JS and assets in debug mode *   bundleInDebug: false, * *   // whether to bundle JS and assets in release mode *   bundleInRelease: true, * *   // whether to bundle JS and assets in another build variant (if configured). *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants *   // The configuration property can be in the following formats *   //         'bundleIn${productFlavor}${buildType}' *   //         'bundleIn${buildType}' *   // bundleInFreeDebug: true, *   // bundleInPaidRelease: true, *   // bundleInBeta: true, * *   // whether to disable dev mode in custom build variants (by default only disabled in release) *   // for example: to disable dev mode in the staging build type (if configured) *   devDisabledInStaging: true, *   // The configuration property can be in the following formats *   //         'devDisabledIn${productFlavor}${buildType}' *   //         'devDisabledIn${buildType}' * *   // the root of your project, i.e. where "package.json" lives *   root: "../../", * *   // where to put the JS bundle asset in debug mode *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug", * *   // where to put the JS bundle asset in release mode *   jsBundleDirRelease: "$buildDir/intermediates/assets/release", * *   // where to put drawable resources / React Native assets, e.g. the ones you use via *   // require('./image.png')), in debug mode *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", * *   // where to put drawable resources / React Native assets, e.g. the ones you use via *   // require('./image.png')), in release mode *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release", * *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to *   // date; if you have any other folders that you want to ignore for performance reasons (gradle *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ *   // for example, you might want to remove it from here. *   inputExcludes: ["android/**", "ios/**"], * *   // override which node gets called and with what additional arguments *   nodeExecutableAndArgs: ["node"], * *   // supply additional arguments to the packager *   extraPackagerArgs: [] * ] */project.ext.react = [    enableHermes: true,  // clean and rebuild if changing    hermesCommand: "../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc",    buildCommand: 'ram-bundle',]// apply from: "../../node_modules/@react-native/gradle-plugin/react.gradle"/** * Set this to true to create two separate APKs instead of one: *   - An APK that only works on ARM devices *   - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */def enableSeparateBuildPerCPUArchitecture = true/** * Run Proguard to shrink the Java bytecode in release builds. */def enableProguardInReleaseBuilds = false/** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US.  Note that * this variant is about 6MiB larger per architecture than default. */def jscFlavor = 'org.webkit:android-jsc:+'/** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and that value will be read here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */def enableHermes = project.ext.react.get("enableHermes", true);/* get keystore password from OSX keychain */// def getPassword(String currentUser, String keyChain) {//    def stdout = new ByteArrayOutputStream()//    def stderr = new ByteArrayOutputStream()//    exec {//        commandLine 'security', '-q', 'find-generic-password', '-a', currentUser, '-s', keyChain, '-w'//        standardOutput = stdout//        errorOutput = stderr//        ignoreExitValue true//    }//    //noinspection GroovyAssignabilityCheck//       stdout.toString().trim()// }// get password// def pass = getPassword("appKey","android_keystore")/** * Architectures to build native code for in debug. */def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")android {    namespace 'com.companyId.appId'    ndkVersion rootProject.ext.ndkVersion    compileSdkVersion rootProject.ext.compileSdkVersion    defaultConfig {        applicationId "com.companyId.appId"        minSdkVersion rootProject.ext.minSdkVersion        targetSdkVersion rootProject.ext.targetSdkVersion        versionCode 14        versionName "1.1.1"    }    splits {        abi {            reset()            enable enableSeparateBuildPerCPUArchitecture            universalApk true  // If true, also generate a universal APK            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"        }    }    signingConfigs {        release {            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {                storeFile file(MYAPP_UPLOAD_STORE_FILE)                storePassword MYAPP_UPLOAD_STORE_PASSWORD                keyAlias MYAPP_UPLOAD_KEY_ALIAS                keyPassword MYAPP_UPLOAD_KEY_PASSWORD            }        }        debug {            storeFile file('debug.keystore')            storePassword 'android'            keyAlias 'androiddebugkey'            keyPassword 'android'        }    }    buildTypes {        debug {            signingConfig signingConfigs.debug            if (nativeArchitectures) {                ndk {                    abiFilters nativeArchitectures.split(',')                }            }            resValue "string", "CodePushDeploymentKey", '"<CODEPUSH_DEBUG_DEPLOYMENT_KEY>"'        }        release {            // Caution! In production, you need to generate your own keystore file.            // see https://reactnative.dev/docs/signed-apk-android.            signingConfig signingConfigs.release            minifyEnabled enableProguardInReleaseBuilds            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"            resValue "string", "CodePushDeploymentKey", '"<CODEPUSH_RELEASE_DEPLYOMENT_KEY>"'        }    }    // applicationVariants are e.g. debug, release    applicationVariants.all { variant ->        variant.outputs.each { output ->            // For each separate APK per architecture, set a unique version code as described here:            // https://developer.android.com/studio/build/configure-apk-splits.html            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]            def abi = output.getFilter(OutputFile.ABI)            if (abi != null) {  // null for the universal-debug, universal-release variants                output.versionCodeOverride =                        defaultConfig.versionCode * 1000 + versionCodes.get(abi)            }        }    }    sourceSets {        main {            assets.srcDirs = ['src/main/assets', '../../html']        }    }}dependencies {    // Import the Firebase BoM    implementation platform('com.google.firebase:firebase-bom:32.3.1')    // TODO: Add the dependencies for Firebase products you want to use    // When using the BoM, don't specify versions in Firebase dependencies    implementation 'com.google.firebase:firebase-analytics'    // Add the dependencies for any other desired Firebase products    // https://firebase.google.com/docs/android/setup#available-libraries    implementation fileTree(dir: "libs", include: ["*.jar"])    //noinspection GradleDynamicVersion    // implementation "com.facebook.react:react-native:+"  // From node_modules    implementation("com.facebook.react:react-android")        // Hermes dependency (if using Hermes)    if (hermesEnabled.toBoolean()) {        implementation("com.facebook.react:hermes-android")    }    implementation project(':react-native-video')    react {        // Needed to enable Autolinking - https://github.com/react-native-community/cli/blob/master/docs/autolinking.md       autolinkLibrariesWithApp()    }    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {        exclude group:'com.facebook.fbjni'    }    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {        exclude group:'com.facebook.flipper'        exclude group:'com.squareup.okhttp3', module:'okhttp'    }    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {        exclude group:'com.facebook.flipper'    }    if (enableHermes) {        // def hermesPath = "../../node_modules/hermes-engine/android/";        // debugImplementation files(hermesPath +"hermes-debug.aar")        // releaseImplementation files(hermesPath +"hermes-release.aar")        implementation("com.facebook.react:hermes-android")    } else {        implementation jscFlavor    }}// Run this once to be able to run the application with BUCK// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) {    from configurations.implementation    into 'libs'}task bundleDebugJsAndAssets(type: Exec) {    commandLine 'node', './node_modules/react-native/local-cli/cli.js', 'bundle', '--entry-file', 'index.js', '--platform', 'android', '--dev', 'false', '--bundle-output', "$buildDir/intermediates/assets/debug/index.android.bundle", '--assets-dest', "$buildDir/intermediates/res/debug"}// apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)apply from: '../../node_modules/react-native-code-push/android/codepush.gradle'

settings.gradle

pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }plugins { id("com.facebook.react.settings") }rootProject.name = 'AppName'extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }includeBuild("../node_modules/@react-native/gradle-plugin")apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle")include ':react-native-video'project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')// include ':react-native-vector-icons'// project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')// include ':react-native-splash-screen'// project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')// include ':react-native-webview'// project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')// include ':react-native-image-picker'// project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')// include ':react-native-fbsdk'// project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')// apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)// apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)// include ':app'// includeBuild('../node_modules/@react-native/gradle-plugin')include ':app', ':react-native-code-push'project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

gradle.properties

# AndroidX package structure to make it clearer which packages are bundled with the# Android operating system, and which are packaged with your app's APK# https://developer.android.com/topic/libraries/support-library/androidx-rnandroid.useAndroidX=true# Automatically convert third-party libraries to use AndroidXandroid.enableJetifier=true# Version of flipper SDK to use with React NativeFLIPPER_VERSION=0.99.0reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64newArchEnabled=truehermesEnabled=true

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/distsdistributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zipzipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/dists

MainActivity.java

package com.companyId.appId;import android.os.Bundle;import com.facebook.react.ReactActivity;import org.devio.rn.splashscreen.SplashScreen;import android.widget.TextView;import android.graphics.Typeface;public class MainActivity extends ReactActivity {  /**   * Returns the name of the main component registered from JavaScript. This is used to schedule   * rendering of the component.   */  @Override  protected String getMainComponentName() {    return "AppName";  }  @Override  protected void onCreate(Bundle savedInstanceState) {    SplashScreen.show(this);    super.onCreate(savedInstanceState);  }}

MainApplication.java

package com.companyId.appId;import android.app.Application;import android.content.Context;import com.facebook.react.PackageList;import com.facebook.react.ReactApplication;import com.microsoft.codepush.react.CodePush;import com.oblador.vectoricons.VectorIconsPackage;import org.devio.rn.splashscreen.SplashScreenReactPackage;import com.reactnativecommunity.webview.RNCWebViewPackage;import com.imagepicker.ImagePickerPackage;// import com.facebook.reactnative.androidsdk.FBSDKPackage;import com.facebook.react.ReactInstanceManager;import com.facebook.react.ReactNativeHost;import com.facebook.react.ReactHost;import com.facebook.react.ReactPackage;import com.facebook.react.defaults.DefaultReactNativeHost;import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;import com.facebook.soloader.SoLoader;import java.lang.reflect.InvocationTargetException;import java.util.List;public class MainApplication extends Application implements ReactApplication {  private final ReactNativeHost mReactNativeHost =      new DefaultReactNativeHost(this) {        @Override        public boolean getUseDeveloperSupport() {          return BuildConfig.DEBUG;        }        @Override        protected List<ReactPackage> getPackages() {          @SuppressWarnings("UnnecessaryLocalVariable")          List<ReactPackage> packages = new PackageList(this).getPackages();          // Packages that cannot be autolinked yet can be added manually here, for example:          // packages.add(new MyReactNativePackage());          return packages;        }        @Override        protected String getJSMainModuleName() {          return "index";        }        @Override        protected String getJSBundleFile() {          return CodePush.getJSBundleFile();        }        @Override        protected boolean isNewArchEnabled() {          return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;        }        @Override        protected Boolean isHermesEnabled() {          return BuildConfig.IS_HERMES_ENABLED;        }      };  @Override  public ReactNativeHost getReactNativeHost() {    return mReactNativeHost;  }  @Override  public void onCreate() {    super.onCreate();    SoLoader.init(this, /* native exopackage */ false);    if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {      // If you opted-in for the New Architecture, we load the native entry point for this app.      DefaultNewArchitectureEntryPoint.load();    }    ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());  }  /**   * Loads Flipper in React Native templates. Call this in the onCreate method with something like   * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());   *   * @param context   * @param reactInstanceManager   */  // private static void initializeFlipper(  //     Context context, ReactInstanceManager reactInstanceManager) {  //   if (BuildConfig.DEBUG) {  //     try {  //       /*  //        We use reflection here to pick up the class that initializes Flipper,  //       since Flipper library is not available in release mode  //       */  //       Class<?> aClass = Class.forName("com.companyId.appId.ReactNativeFlipper");  //       aClass  //           .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)  //           .invoke(null, context, reactInstanceManager);  //     } catch (ClassNotFoundException e) {  //       e.printStackTrace();  //     } catch (NoSuchMethodException e) {  //       e.printStackTrace();  //     } catch (IllegalAccessException e) {  //       e.printStackTrace();  //     } catch (InvocationTargetException e) {  //       e.printStackTrace();  //     }  //   }  // }}

main/AndroidManifest.xml

<manifest  xmlns:android="http://schemas.android.com/apk/res/android"  xmlns:tools="http://schemas.android.com/tools"><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.VIBRATE" /><uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/><uses-permission android:name="android.permission.WAKE_LOCK" /><uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/><queries><intent><action android:name="android.intent.action.VIEW" /><data android:scheme="http"/></intent><intent><action android:name="android.intent.action.VIEW" /><data android:scheme="https"/></intent><intent><action android:name="android.intent.action.VIEW" /><data android:scheme="mailto"/></intent></queries><application      android:name=".MainApplication"      android:label="@string/app_name"      android:icon="@mipmap/ic_launcher"      android:roundIcon="@mipmap/ic_launcher_round"      android:allowBackup="false"      android:theme="@style/AppTheme"      android:usesCleartextTraffic="true"><activity        android:name=".MainActivity"        android:label="@string/app_name"        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"        android:launchMode="singleTask"        android:exported="true"        android:windowSoftInputMode="adjustResize"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application></manifest>

How to prevent layout from overlapping with iOS status bar

$
0
0

I am working on tutorial for React Native navigation. I found out that all layout starts loading from top of screen instead of below of the status bar. This causes most layouts to overlap with the status bar. I can fix this by adding a padding to the view when loading them. Is this the actual way to do it? I don' think manually adding padding is an actual way to solve it. Is there a more elegant way to fix this?

import React, { Component } from 'react';import { View, Text, Navigator } from 'react-native';export default class MyScene extends Component {    static get defaultProps() {            return {                    title : 'MyScene'            };      }       render() {            return (<View style={{padding: 20}}> //padding to prevent overlap<Text>Hi! My name is {this.props.title}.</Text></View>             )       }    }

Below shows the screenshots before and after the padding is added.enter image description here

Issue with iOS routing microphone input to speaker/headphones in react native project

$
0
0

I’m building a react native app with expo (unmanaged workflow) to hold a live audio call over a server.

Audio sharing between users is fine but I got a weird issue when using a real iOS device.

The microphone captures my voice and it’s redirected automatically to the output. If I am without headphones it will be redirected to the receiver and if I am with headphones I will hear my own voice over that.

I don’t know what can be causing it. To share the audio I capture the device media using react-native-webrtc like:

const stream = await mediaDevices.getUserMedia({  audio: true,  video: false,});

I read that this could be solved by writing my own native module and marking the audio session as playAndRecord. So I created my custom native module following this expo documentation. In it I do:

let session = AVAudioSession.sharedInstance()try session.setCategory(.playAndRecord, mode: .voiceChat, options: [.allowBluetooth])try session.setActive(true)

Unfortunately the microphone input still gets routed to the output system no matter what. Is there a way to fix this? Is this supposed to happen by default in audio calls over the internet? Any insight is really appreciated 😄

How to detect fake GPS in Expo iOS?

$
0
0

I’m building an Expo app and using expo-location to get the user’s location.

On Android, I can check if the location is mocked using the mocked property see this docs.
enter image description here

But how about iOS?

  • Is there any way to detect if the user is using fake GPS on iOS?
  • If not, what are the best practices to handle this case in Expo apps?

Any suggestions would be appreciated!

After successful logout user is not redirecting back to the app

$
0
0

I am working on a react-native application where have implement Microsoft Entra authentication through react-native-app-auth. Login is working as expected I am facing an issue with logout -From user profile, user clicks on logout and a web browser gets open to pick an account for logout, after choosing an account user see successfully logout message. After this browser should auto close and user should redirected back to the application. Instead, browser remains open with a message "It is good idea to close all browser". Sharing the code snippet and screenshot of issue.

postLogoutRedirectUrl - Same url has been added on azure app registration.

const logoutConfig = {  issuer: MSAL_ISSUER,  clientId: MSAL_CLIENT_ID,  redirectUrl: REDIRECT_URL,};
try {      await logout(logoutConfig, {        idToken: token,        postLogoutRedirectUrl: "com.appId://logout/",      });    } catch (e) {       console.error("Logout error:", e);    }

enter image description here

"Cannot issue sandbox extension for URL" when using React Native Share API

$
0
0

I'm using React Native's built-in Share API to share a remote URL. It works fine on Android and in a clean test app, but not in my main app on iOS.

Error (Xcode console):

Cannot issue sandbox extension for URL:https://www.reeltor.com/redirect?screen=Discover&id=P06489728747Timed out waiting for sync reply for QUERY_PARAMconnection invalidated

Code:

import { Share } from 'react-native';const shareData = async (id) => {  try {    await Share.share({      url: `https://www.reeltor.com/redirect?screen=Discover&id=${id}`,    });  } catch (e) {    console.log("Error: ", e);  }};

Tried:

Both Share and react-native-share

Using message instead of url

Works in a new RN project

Only affects iOS (Android is fine)


Error: Native module RNFBAppModule not found. Re-check module install, linking, configuration, build and install steps., js engine: hermes

$
0
0

Package.json

"dependencies": {"@react-native-async-storage/async-storage": "^2.0.0","@react-native-firebase/app": "^21.4.0","@react-native-firebase/auth": "^21.4.0","@react-native-firebase/firestore": "^21.4.0","@react-navigation/bottom-tabs": "^6.5.0","@react-navigation/native": "^6.1.0","@react-navigation/native-stack": "^6.9.0","axios": "^1.7.7","firebase": "^11.0.1","react": "18.3.1","react-native": "0.75.4","react-native-calendars": "^1.1307.0","react-native-get-random-values": "^1.11.0","react-native-paper": "^5.12.5","react-native-safe-area-context": "^4.11.1","react-native-screens": "^4.0.0","react-native-svg": "^15.8.0","react-native-vector-icons": "^10.2.0","react-native-video": "^6.7.0","react-native-webview": "^13.12.3","uuid": "^11.0.2"  },

Podfile

# Resolve react_native_pods.rb with node to allow for hoistingrequire Pod::Executable.execute_command('node', ['-p','require.resolve("react-native/scripts/react_native_pods.rb",    {paths: [process.argv[1]]},  )', __dir__]).stripplatform :ios, '14.0'prepare_react_native_project!linkage = ENV['USE_FRAMEWORKS']if linkage != nil  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green  use_frameworks! :linkage => linkage.to_symendtarget 'app' do  use_frameworks! :linkage => :static  $RNFirebaseAsStaticFramework = true  config = use_native_modules!  use_modular_headers!  pod 'RNFBApp', path: '../node_modules/@react-native-firebase/app'  pod 'FirebaseCore', :modular_headers => true  pod 'FirebaseCoreExtension', :modular_headers => true  pod 'FirebaseInstallations', :modular_headers => true  pod 'GoogleDataTransport', :modular_headers => true  pod 'GoogleUtilities', :modular_headers => true  pod 'nanopb', :modular_headers => true  use_react_native!(    :path => config[:reactNativePath],    :hermes_enabled => true,    :fabric_enabled => true,    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  target 'apptest' do    inherit! :complete    # Pods for testing  end  post_install do |installer|    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202    react_native_post_install(      installer,      config[:reactNativePath],      :mac_catalyst_enabled => false,    )  endend

I made some additions to my Podfile as recommended on the React Native Firebase website. I noticed that some Firebase files were missing, so I added them. However, despite providing the path for the RNFBApp module, it still appears to be missing. I have tried running pod install --repo-update and deleting the Podfile.lock and Pods directory before reinstalling, but this issue persists.

iOS Safari / Capacitor: Header stretches down when keyboard opens (with StatusBar.setOverlaysWebView({ overlay: true }))

$
0
0

I’m building a React + Capacitor app with a sticky header (position: sticky; top: 0;).On iOS (Safari PWA and Capacitor WebView), when the keyboard opens, the header suddenly stretches down as if safe-area-inset-top increased. When the keyboard closes, the header goes back to normal.

I want the header to remain stable: no stretching down when keyboard opens, but also no ugly black status bar (so I prefer StatusBar.setOverlaysWebView({ overlay: true })).Example Code

CSS:

:root {  --header-height: 56px;  --safe-top: env(safe-area-inset-top);  --header-total: calc(var(--header-height) + var(--safe-top));}.app-header {  position: sticky;  top: 0;  z-index: 40;  height: var(--header-total);  padding-top: var(--safe-top);  background: white;  border-bottom: 1px solid #ddd;}

React Header:

export default function Header() {  return (<header className="app-header"><div style={{ height: 'var(--header-height)' }}><div className="h-full flex items-center justify-between"><button>☰</button><div>LoyalFlow</div><button>⚙</button></div></div></header>  );}

Capacitor init:

import { Capacitor } from '@capacitor/core';async function initNativeUi() {  if (!Capacitor.isNativePlatform()) return;  const { StatusBar, Style } = await import('@capacitor/status-bar');  await StatusBar.setOverlaysWebView({ overlay: true }); // ✅ no black bar  await StatusBar.setStyle({ style: Style.Dark });  await StatusBar.show();}

What I’ve tried

Locking header height with min-height and max-height.

Using translateZ(0) and will-change.

Using visualViewport resize events with a small "poke" (translateY -1px and back).

Switching overlay: false fixes the stretching — but introduces the ugly black bar at the top, which I want to avoid.

How can I prevent the sticky header from stretching down on iOS when the keyboard opens, while keeping StatusBar.setOverlaysWebView({ overlay: true }) (no black bar)?

Is there a reliable pattern to "lock" the safe-area inset on iOS so the header doesn’t move with the keyboard?

Image not showing in iOS push notification using Notification Service Extension in React Native with Firebase

$
0
0

I'm working on a React Native project where I’ve implemented a Notification Service Extension (NSE) to display rich push notifications with images on iOS. I'm using Firebase Cloud Messaging (FCM) to send the push notifications.

The NSE is triggering correctly — I can see that the title is modified with [NSE], which confirms the extension is running. However, the image is not being shown in the notification, even though I'm passing a valid public image URL.

I have added a debugger marker to verify NSE is running this is NotificationService.m Snippet:

#import "NotificationService.h"#import "FirebaseMessaging.h"

@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;

@end

@implementation NotificationService

  • (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {self.contentHandler = contentHandler;self.bestAttemptContent = [request.content mutableCopy];

    // Debug markerself.bestAttemptContent.title = [self.bestAttemptContent.title stringByAppendingString:@" [NSE]"];

    [[FIRMessaging extensionHelper] populateNotificationContent:self.bestAttemptContent withContentHandler:contentHandler];

}

  • (void)serviceExtensionTimeWillExpire {// Called just before the extension will be terminated by the system.// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.self.contentHandler(self.bestAttemptContent);}

@end

The Ios Development Target is also compatibleas you can see

Still I am not able to see the image in notification but NSE is there with Title have a look

Question:

Why is the image not showing in the iOS notification even though the NSE is triggered and the image URL is present?

Is it because I’m testing on the iOS Simulator? Or is there something wrong with my FCM payload or NotificationService.m logic?

Any advice or working examples would be appreciated!

Is there a view/component that goes above all content in React Native?

$
0
0

Is there a view/component/anything that can be used in one place in a react native app that would be placed above all the content - I need it for toast component. I tried using Portals, Root Siblings, Modals etc. but nothing goes above the screen that has presentation: "modal" on iOS.

I specifically want to keep presentation: "modal" for some screens and I need toast messages to be available there. I know I could render couple of instances of toast component including those screens with presentation: "modal", but I am looking for something global - that would be above all the content no matter what.

I know it is possible because I've seen apps like WhatsApp have it (the toast message is literally floating above everything because no matter where you go it persists there, even if you go on screens with presentation: "modal). Of course they use native views like UIWindow with windowLevel (.alert or above) but I was wondering does anything like that exist in react native/expo ecosystem?

If not, how come has no one come to an idea to create an expo module for example that exposes that overlaying view - it would be useful for toasts, modals, sheets, portals etc... (I was thinking about trying to do that myself, but Im not sure how doable that would be for me considering my skill level and the amount of free time)

How to solve internet connection issues with expo go on phone?

$
0
0

When I start npm in VS Code along with the API, everything runs fine in the browser on my computer.However, on my phone, it doesn’t work properly. When I scan the QR code, it takes a long time to load and always shows a message saying that the internet connection is the problem. I tried changing phones and Wi-Fi networks several times, but nothing changed.I even updated the npm version in my environment, but the issue persists — it still won’t open on my phone.

TestFlight apps submitted through eas can't be installed

$
0
0

I have an issue I can't get around.

When I use "eas build --platform ios --profile production --auto-submit" everything checks out on expo.dev just fine, both build and submission.

After this I get the email and click the link to try and install in TestFlight and I get this error:"Could not install app, The requested app is not available or doesnt't exist"

The build is there on App Store connected, the bundle id matches in code and on connect, the email invited through the internal test group matches the one I am logged in with in TestFlight.

Any help or insight is much appreciated. Thanks.

enter image description here

React Native / Expo Prebuild – Local images not showing in TestFlight but work in simulator

$
0
0

I’m having a strange issue with my React Native (Expo prebuilt) iOS app. Everything works perfectly in the simulator, but when I test it via TestFlight, the images and background images do not appear. However, animations (Lottie JSON) and text work fine.

I use require() to import images, like this:

**<ImageBackground  source={require('../assets/images/subscription-bg.jpg')}  style={styles.background}  resizeMode="cover"/>**

What I’ve tried so far:• Added all images to the Copy Bundle Resources section in Xcode.• Ensured images exist in the assets/images/ folder.• Verified image paths are correct and case-sensitive.• Ran npx react-native bundle:npx react-native bundle
--entry-file index.ts
--platform ios
--dev false
--bundle-output ios/main.jsbundle
--assets-dest ios

Rebuilt archive with expo prebuild, pod install, and cleaned Xcode build folder.•   Upgraded Ruby and CocoaPods to solve related errors.

What could be causing this issue? Is there something else I should check to ensure local images are correctly bundled and appear in TestFlight?

Any suggestions or tips would be greatly appreciated!


Pdf file not viewing in document directory of IOS

$
0
0

I am trying to download a file in react native but using library (ReactNativeBlobUtil). for android it is working fine but for IOS the file is going in document directory but not on the desired location. it is going under the several folders and there too it is not accessible.

const downloadReport = async () => {    try {      const { dirs } = ReactNativeBlobUtil.fs;      const dirToSave = LAYOUT.isiOS ? dirs.DocumentDir : dirs.LegacyDownloadDir;      const date = new Date();      const fileName = `download${Math.floor(        date.getDate() + date.getSeconds() / 2      )}.pdf`;      const config = {        fileCache: true,        addAndroidDownloads: {          useDownloadManager: true,          notification: true,          path: `${dirToSave}/${fileName}`,          description: t("downloading"),        },        addIOSDownloads: {          notification: true,          path: `${dirToSave}/${fileName}`,          description: t("downloading"),        },      };      await ReactNativeBlobUtil.config(config)        .fetch("GET", FILE_URL, {})        .then((res) => {          console.log("The file saved to ", res.path());        });      showSuccessMessage(t("fileDownloadedSuccessfully"));    } catch (error) {      showErrorMessage(t("failedToDownloadFile"));    }  };

this is the file location i am getting in the IOS.

/var/mobile/Containers/Data/Application/54A6714F-9875-4612-A0AB-EDC92FA65C15/Documents/ReactNativeBlobUtil_tmp/ReactNativeBlobUtilTmp_mlp7gzc9srh232rrggpngt

and as i am downloading the pdf file but the file extension is not there. The saved file's type is data. which is not desired.

This is my info.plist file where i have added the required permissions.

<key>UIFileSharingEnabled</key><true/><key>CFBundleGetInfoString</key><string></string><key>LSApplicationCategoryType</key><string></string><key>LSSupportsOpeningDocumentsInPlace</key><true/><key> UIFileSharingEnabled</key><true/><key>NSDownloadsFolderUsageDescription</key><true/>

I have tried adding these permissions in info.plist file but nothing worked. Kindly give me some suggestions how to fix this.

React Native + EAS build: TestFlight shows old code even after new build

$
0
0

I’m building a mobile app (iOS & Android) with React Native.
Because I use native modules (e.g. Mapbox, OneSignal), I don’t use Expo Go — instead I build locally with EAS.


Problem

When I publish a new build, the version I get on TestFlight shows old code (UI elements that no longer exist in my codebase, from build 16 or 17).


Details

  • I have bash build & submit scripts with auto-increment build numbers (so I’m sure they’re correct).

  • iOS build command:

    eas build --platform ios --profile staging --local
  • I’ve already tried --clear-cache and also expo prebuild.

  • To submit to TestFlight:

    eas submit --platform ios --profile staging --path <path.ipa>
  • On Android, one colleague once saw the same issue (old version showing), but most of the time it seems specific to iOS/TestFlight.

  • Locally (Metro dev server / simulator), the app always runs with the latest code.

So it looks like the IPA built with EAS contains (or downloads) an old JS bundle.


  • Has anyone already faced this kind of issue with EAS build + React Native?
  • How can I ensure that the IPA always contains the latest JS bundle instead of an old one?

Thanks you !

How do you get a horizontally scrolled container in react native when it is in a page that is vertically scrollable?

$
0
0

enter image description here

This image depicts the current code that was suggested to me by a fried to be able to add this feature. Yet this code only makes the all the tags disappear which shouldn't be happening. It works just fine when the Scroll View isn't there, but for some reason when it's there, the tags vanish?

I tried flexDirection: "row" and flexDirection: "column" with flexWrap: "wrap". These are in the View component that wrap the TAGS.map. In addition, I have tried to set a maxHeight: 120 to that same View just to make sure that the tags weren't being deleted because it wasn't being rendered. That was not the issue. I've tried using Math techniques that resulted in the tags disappearing. Basically, everything I've tried resulted in all of the tags disappearing. I have tried GPT, but that also gives me things that I've already tried and don't work.

This is my first time posting on here, so if there's something that I'm missing, please let me know!

If someone could please assist, that would be awesome! Thank you so much!

I can not link IOS module to React Native CLI

$
0
0

I am creating widget app in react native cli. It is a countdown widget that has 5 backgrounds which the user can pick. And the user can also upload custom image to the background of the widget. When i tried to use NativeModules.RNWidgetModule, it is being null. How can i solve this?

(I am not IOS developer. I wrote ios codes with AI.)

SkinPicker.ts

/* eslint-disable react-native/no-inline-styles */import React from 'react';import {  View,  TouchableOpacity,  StyleSheet,  Text,  BackHandler,  Platform,} from 'react-native';import LinearGradient from 'react-native-linear-gradient';import { NativeModules } from 'react-native';const { WidgetModule } = NativeModules;// Helper to apply skinconst setWidgetSkin = (skinName: string) => {  if (Platform.OS === 'android'&& WidgetModule) {    WidgetModule.setSkin(skinName);  }  if (Platform.OS === 'ios'&& NativeModules.RNWidgetModule) {    NativeModules.RNWidgetModule.setSkin(skinName);    NativeModules.RNWidgetModule.reloadWidgets();  }  if (Platform.OS === 'android') {    BackHandler.exitApp();  }};// Skin definitionsconst skins = [  {    name: 'FIDESZ',    type: 'solid',    color: '#FF6A13',  },  {    name: 'TISZA',    type: 'gradient',    colors: ['#24B573', '#ED4551'],  },  {    name: 'KUTYAPART',    type: 'dots', // two-color split + two red dots    colors: ['#FFFFFF', '#000000'],    dotColor: '#DA0000',  },  {    name: 'DK',    type: 'gradient',    colors: ['#0062A7', '#C50067', '#FFD500', '#2DAAE1'],  },  {    name: 'MI_HAZANK',    type: 'solid',    color: '#678B1D',  },];export default function SkinPicker() {  return (<View><Text style={styles.headerText}>Háttér kiválasztása</Text><View style={styles.row}>        {skins.map(skin => {          if (skin.type === 'solid') {            return (<TouchableOpacity                key={skin.name}                style={[styles.box, { backgroundColor: skin.color }]}                onPress={() => setWidgetSkin(skin.name)}              />            );          } else if (skin.type === 'gradient') {            return (<TouchableOpacity                key={skin.name}                onPress={() => setWidgetSkin(skin.name)}><LinearGradient                  colors={skin.colors!}                  style={styles.box}                  start={{ x: 0, y: 0 }}                  end={{ x: 1, y: 1 }}                /></TouchableOpacity>            );          } else if (skin.type === 'dots') {            // Split box + 2 red dots            return (<TouchableOpacity                key={skin.name}                onPress={() => setWidgetSkin(skin.name)}><View style={[styles.box, { flexDirection: 'row' }]}><View style={{ flex: 1, backgroundColor: skin.colors![0] }} /><View style={{ flex: 1, backgroundColor: skin.colors![1] }} />                  {/* Red dots */}<View                    style={[                      styles.dot,                      { top: 5, left: 5, backgroundColor: skin.dotColor },                    ]}                  /><View                    style={[                      styles.dot,                      { bottom: 5, right: 5, backgroundColor: skin.dotColor },                    ]}                  /></View></TouchableOpacity>            );          }        })}</View></View>  );}const styles = StyleSheet.create({  headerText: {    textAlign: 'center',    fontSize: 20,    marginBottom: 10,  },  row: {    flexDirection: 'row',    justifyContent: 'space-around',    gap: 10,  },  box: {    width: 50,    height: 50,    borderRadius: 8,    borderWidth: 1,    borderColor: '#333',    overflow: 'hidden',  },  dot: {    position: 'absolute',    width: 8,    height: 8,    borderRadius: 4,  },});

RNWidgetModule.m

#import <React/RCTBridgeModule.h>@interface RCT_EXTERN_MODULE(RNWidgetModule, NSObject)RCT_EXTERN_METHOD(setSkin:(NSString *)skinName)RCT_EXTERN_METHOD(setCustomBackground:(NSString *)imageUri                  resolver:(RCTPromiseResolveBlock)resolve                  rejecter:(RCTPromiseRejectBlock)reject)RCT_EXTERN_METHOD(removeCustomBackground)RCT_EXTERN_METHOD(reloadWidgets)@end

RNWidgetModule.swift

import Foundationimport Reactimport WidgetKitimport UIKit@objc(RNWidgetModule)class RNWidgetModule: NSObject {    @objc    static func requiresMainQueueSetup() -> Bool {        return false    }    @objc    func setSkin(_ skinName: String) {        DispatchQueue.main.async {            guard let userDefaults = UserDefaults(suiteName: "group.ittazido") else {                print("Failed to get UserDefaults with suite name")                return            }            userDefaults.set(skinName, forKey: "selectedSkin")            userDefaults.set(false, forKey: "isCustomBackground")            userDefaults.removeObject(forKey: "customBackgroundData")            WidgetCenter.shared.reloadAllTimelines()            userDefaults.synchronize()            print("Skin set to: \(skinName)")            self.reloadWidgets()        }    }    @objc    func setCustomBackground(_ imageUri: String, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {        DispatchQueue.main.async {            guard let url = URL(string: imageUri) else {                rejecter("INVALID_URI", "Invalid image URI", nil)                return            }            // Handle different URI schemes            var imageData: Data?            if imageUri.hasPrefix("ph://") {                // Photo library asset                self.loadPhotoLibraryAsset(url: url) { data in                    if let data = data {                        self.saveCustomBackground(data: data, resolver: resolver, rejecter: rejecter)                    } else {                        rejecter("LOAD_FAILED", "Failed to load image from photo library", nil)                    }                }                return            } else if imageUri.hasPrefix("file://") {                // File system                let filePath = url.path                imageData = NSData(contentsOfFile: filePath) as Data?            } else if imageUri.hasPrefix("data:") {                // Base64 data URI                if let range = imageUri.range(of: ",") {                    let base64String = String(imageUri[range.upperBound...])                    imageData = Data(base64Encoded: base64String)                }            }            guard let data = imageData else {                rejecter("LOAD_FAILED", "Failed to load image data", nil)                return            }            self.saveCustomBackground(data: data, resolver: resolver, rejecter: rejecter)        }    }    private func loadPhotoLibraryAsset(url: URL, completion: @escaping (Data?) -> Void) {        import Photos        let assetId = url.absoluteString.replacingOccurrences(of: "ph://", with: "")        let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: [assetId], options: nil)        guard let asset = fetchResult.firstObject else {            completion(nil)            return        }        let imageManager = PHImageManager.default()        let options = PHImageRequestOptions()        options.isSynchronous = false        options.deliveryMode = .highQualityFormat        imageManager.requestImage(for: asset, targetSize: CGSize(width: 800, height: 400), contentMode: .aspectFill, options: options) { image, _ in            guard let image = image else {                completion(nil)                return            }            completion(image.jpegData(compressionQuality: 0.8))        }    }    private func saveCustomBackground(data: Data, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {        guard let userDefaults = UserDefaults(suiteName: "group.ittazido") else {            rejecter("USERDEFAULTS_ERROR", "Failed to get UserDefaults", nil)            return        }        // Resize image if needed        guard let image = UIImage(data: data) else {            rejecter("INVALID_IMAGE", "Invalid image data", nil)            return        }        let resizedImage = self.resizeImage(image: image, maxWidth: 800, maxHeight: 400)        guard let resizedData = resizedImage.jpegData(compressionQuality: 0.8) else {            rejecter("RESIZE_FAILED", "Failed to resize image", nil)            return        }        userDefaults.set(true, forKey: "isCustomBackground")        userDefaults.set(resizedData, forKey: "customBackgroundData")        userDefaults.synchronize()        self.reloadWidgets()        resolver("Custom background set successfully")    }    @objc    func removeCustomBackground() {        DispatchQueue.main.async {            guard let userDefaults = UserDefaults(suiteName: "group.ittazido") else {                return            }            userDefaults.set(false, forKey: "isCustomBackground")            userDefaults.removeObject(forKey: "customBackgroundData")            userDefaults.synchronize()            self.reloadWidgets()        }    }    @objc    func reloadWidgets() {        DispatchQueue.main.async {            if #available(iOS 14.0, *) {                WidgetCenter.shared.reloadAllTimelines()                print("Widgets reloaded")            }        }    }    private func resizeImage(image: UIImage, maxWidth: CGFloat, maxHeight: CGFloat) -> UIImage {        let size = image.size        if size.width <= maxWidth && size.height <= maxHeight {            return image        }        let widthRatio = maxWidth / size.width        let heightRatio = maxHeight / size.height        let ratio = min(widthRatio, heightRatio)        let newSize = CGSize(width: size.width * ratio, height: size.height * ratio)        UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)        image.draw(in: CGRect(origin: .zero, size: newSize))        let newImage = UIGraphicsGetImageFromCurrentImageContext()        UIGraphicsEndImageContext()        return newImage ?? image    }}// MARK: - React Native Bridgeextension RNWidgetModule: RCTBridgeModule {    static func moduleName() -> String! {        return "RNWidgetModule"    }}

CountdownWidget.swift

import WidgetKitimport SwiftUIimport Foundationstruct CountdownData {    let targetDate: Date    let lastFetchTime: Date}enum WidgetSkin: String, CaseIterable {    case fidesz = "FIDESZ"    case tisza = "TISZA"    case kutyapart = "KUTYAPART"    case dk = "DK"    case miHazank = "MI_HAZANK"}struct CountdownTimelineProvider: TimelineProvider {    typealias Entry = CountdownEntry    func placeholder(in context: Context) -> CountdownEntry {        CountdownEntry(date: Date(), targetDate: getDefaultTargetDate())    }    func getSnapshot(in context: Context, completion: @escaping (CountdownEntry) -> Void) {        let entry = CountdownEntry(date: Date(), targetDate: getTargetDate())        completion(entry)    }    func getTimeline(in context: Context, completion: @escaping (Timeline<CountdownEntry>) -> Void) {        fetchTargetDateFromAPI { targetDate in            var entries: [CountdownEntry] = []            let currentDate = Date()            // Create entries for every second for the next minute            for secondOffset in 0..<60 {                let entryDate = Calendar.current.date(byAdding: .second, value: secondOffset, to: currentDate)!                let entry = CountdownEntry(date: entryDate, targetDate: targetDate)                entries.append(entry)            }            // Update every minute            let timeline = Timeline(entries: entries, policy: .after(Calendar.current.date(byAdding: .minute, value: 1, to: currentDate)!))            completion(timeline)        }    }    private func fetchTargetDateFromAPI(completion: @escaping (Date) -> Void) {        guard let url = URL(string: "https://api.lefiko.hu/time") else {            completion(getDefaultTargetDate())            return        }        URLSession.shared.dataTask(with: url) { data, response, error in            guard let data = data,                  let json = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],                  let timeString = json["time"] as? String else {                completion(getDefaultTargetDate())                return            }            let formatter = DateFormatter()            formatter.dateFormat = "yyyy-MM-dd H:mm:ss"            formatter.timeZone = TimeZone(identifier: "Europe/Budapest")            if let date = formatter.date(from: timeString) {                // Cache the result                UserDefaults(suiteName: "group.ittazido")?.set(date, forKey: "targetDate")                UserDefaults(suiteName: "group.ittazido")?.set(Date(), forKey: "lastFetchTime")                completion(date)            } else {                completion(getDefaultTargetDate())            }        }.resume()    }    private func getTargetDate() -> Date {        guard let userDefaults = UserDefaults(suiteName: "group.ittazido"),              let cachedDate = userDefaults.object(forKey: "targetDate") as? Date,              let lastFetch = userDefaults.object(forKey: "lastFetchTime") as? Date,              Date().timeIntervalSince(lastFetch) < 600 else {            return getDefaultTargetDate()        }        return cachedDate    }    private func getDefaultTargetDate() -> Date {        let formatter = DateFormatter()        formatter.dateFormat = "yyyy-MM-dd H:mm:ss"        formatter.timeZone = TimeZone(identifier: "Europe/Budapest")        return formatter.date(from: "2026-04-12 06:00:00") ?? Date()    }}struct CountdownEntry: TimelineEntry {    let date: Date    let targetDate: Date}struct CountdownWidgetEntryView: View {    var entry: CountdownEntry    @State private var now = Date()    @AppStorage("selectedSkin", store: UserDefaults(suiteName: "group.ittazido"))    private var selectedSkin: String = "DK"    @AppStorage("isCustomBackground", store: UserDefaults(suiteName: "group.ittazido"))    private var isCustomBackground: Bool = false    private var currentSkin: WidgetSkin {        WidgetSkin(rawValue: selectedSkin) ?? .dk    }    private var customBackgroundData: Data? {        UserDefaults(suiteName: "group.ittazido")?.data(forKey: "customBackgroundData")    }    var body: some View {        ZStack {            // Background            if isCustomBackground, let imageData = customBackgroundData, let uiImage = UIImage(data: imageData) {                Image(uiImage: uiImage)                    .resizable()                    .aspectRatio(contentMode: .fill)            } else {                getSkinBackground(for: currentSkin)            }            // Overlay red dots for KUTYAPART            if currentSkin == .kutyapart {                VStack {                    HStack {                        Circle()                            .fill(Color.red)                            .frame(width: 8, height: 8)                        Spacer()                    }                    Spacer()                    HStack {                        Spacer()                        Circle()                            .fill(Color.red)                            .frame(width: 8, height: 8)                    }                }                .padding(5)            }            // Countdown text            Text(getCountdownText())                .font(.system(size: 24, weight: .bold))                .foregroundColor(getTextColor(for: currentSkin))                .shadow(color: .black.opacity(0.5), radius: 2, x: 1, y: 1)                .multilineTextAlignment(.center)        }        .containerBackground(for: .widget) {            Color.clear        }    }    private func getCountdownText() -> String {        let now = entry.date        let target = entry.targetDate        let diff = target.timeIntervalSince(now)        if diff > 0 {            let days = Int(diff) / (24 * 60 * 60)            let hours = (Int(diff) % (24 * 60 * 60)) / (60 * 60)            let minutes = (Int(diff) % (60 * 60)) / 60            let seconds = Int(diff) % 60            return String(format: "%d nap %02d:%02d:%02d", days, hours, minutes, seconds)        } else if diff >= -24 * 60 * 60 {            return "ITT AZ IDŐ!"        } else {            return "4 év múlva újra találkozunk!"        }    }    private func getSkinBackground(for skin: WidgetSkin) -> some View {        Group {            switch skin {            case .fidesz:                RoundedRectangle(cornerRadius: 8)                    .fill(Color(red: 1.0, green: 0.416, blue: 0.075))                    .overlay(                        RoundedRectangle(cornerRadius: 8)                            .stroke(Color.black.opacity(0.2), lineWidth: 1)                    )            case .tisza:                RoundedRectangle(cornerRadius: 8)                    .fill(                        LinearGradient(                            colors: [                                Color(red: 0.141, green: 0.710, blue: 0.451),                                Color(red: 0.929, green: 0.271, blue: 0.318)                            ],                            startPoint: .topLeading,                            endPoint: .bottomTrailing                        )                    )                    .overlay(                        RoundedRectangle(cornerRadius: 8)                            .stroke(Color.black.opacity(0.2), lineWidth: 1)                    )            case .kutyapart:                RoundedRectangle(cornerRadius: 8)                    .fill(                        LinearGradient(                            colors: [Color.white, Color.black],                            startPoint: .topLeading,                            endPoint: .bottomTrailing                        )                    )                    .overlay(                        RoundedRectangle(cornerRadius: 8)                            .stroke(Color.black.opacity(0.2), lineWidth: 1)                    )            case .dk:                RoundedRectangle(cornerRadius: 8)                    .fill(                        LinearGradient(                            colors: [                                Color(red: 0.004, green: 0.384, blue: 0.655),                                Color(red: 0.773, green: 0.000, blue: 0.404),                                Color(red: 1.0, green: 0.835, blue: 0.0)                            ],                            startPoint: .topLeading,                            endPoint: .bottomTrailing                        )                    )                    .overlay(                        RoundedRectangle(cornerRadius: 8)                            .stroke(Color.black.opacity(0.2), lineWidth: 1)                    )            case .miHazank:                RoundedRectangle(cornerRadius: 8)                    .fill(Color(red: 0.404, green: 0.545, blue: 0.114))                    .overlay(                        RoundedRectangle(cornerRadius: 8)                            .stroke(Color.black.opacity(0.2), lineWidth: 1)                    )            }        }    }    private func getTextColor(for skin: WidgetSkin) -> Color {        switch skin {        case .kutyapart:            return .black        default:            return .white        }    }}struct CountdownWidget: Widget {    let kind: String = "CountdownWidget"    var body: some WidgetConfiguration {        StaticConfiguration(kind: kind, provider: CountdownTimelineProvider()) { entry in            CountdownWidgetEntryView(entry: entry)        }        .configurationDisplayName("Countdown Widget")        .description("Displays a countdown to the target date.")        .supportedFamilies([.systemSmall, .systemMedium])    }}#Preview(as: .systemSmall) {    CountdownWidget()} timeline: {    let targetDate = Calendar.current.date(byAdding: .day, value: 30, to: Date()) ?? Date()    CountdownEntry(date: .now, targetDate: targetDate)}

In react-native-callkeep if you a user rejects call by reply a message or Reply later on IOS or android is there a way to handle it?

$
0
0

enter image description here

Please check the image for reference below. Check reply with message similar options for ios. On tapping Reply with Message call ends but the selected message payload is not received in event payload is there a way to achive it in android and ios? Any way to achive it using native code.

React Native FlatList customize snapToInterval animation speed

$
0
0

I wish to recreate a similar feed to Instagram Reels/Tiktok scrolling. The animation between items is very snappy and quick. My items are images instead of videos. I am having issues with recreating that snappy feel for iOS. I played around with decelerationRate property but it didn't change much for iOS. On android it works perfectly, it's very snappy.

<FlatList        ref={listRef}        data={posts}        renderItem={renderItem}        pagingEnabled        decelerationRate="fast"        disableIntervalMomentum={true}        ...        snapToInterval: ITEM_HEIGHT/>

Modal Issue in React-Native

$
0
0

good day!

We're facing an issue with our React Native application. The "Code of Conduct" and "Health Questionnaire" pop-ups are not appearing on a specific user's phone(iPhone 12 iOS 18.5). We've tested it on our end, including on lower-spec devices, and it works perfectly. Has anyone encountered this issue before?

<Modal    animationType="fade"    transparent={true}    visible={      isCocPopupVisible || isHealthQuestionnairePopupVisible || isLoading    }>    {isLoading && <Loader />}    {isCocPopupVisible && !isLoading && (<CodeOfConductPopup        data={codeOfConduct}        onPressYes={acceptCoC}        onPressNo={rejectCoC}      />    )}    {!isCocContentLoading &&      !isCocPopupVisible &&      isHealthQuestionnairePopupVisible &&      !isLoading && (<QuestionPopup          onPressYes={acceptHealthQuestionnaire}          onPressNo={rejectHealthQuestionnaire}        />      )}</Modal>

How to enable liquid glass (iOS 26) for bottom tabs in react native with CLI (without expo)

$
0
0

I couldnt find any instructions on this official site from react navigation.In the web (for example YouTube) you can find some "small" tutorials for react native with expo.

I also would like to know if the current implementation/design for the bottom tabs will be repaced by the liquid glass design permanently. Is there somewhere a statement by the react native team?



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>