Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all 28476 articles
Browse latest View live

App published but not indexed in Google Play after 2 weeks

$
0
0

For a client of ours we've created an app which has to be available by the 11th of October. The app is already available in the iOS App store but Google Play seems to be a problem.

I have added the package to the release track on the 26th of September, hoping it would be reviewed & published shortly after which, luckily, it did. I can use a direct link to the app (taken from the play console) which indicates it is published correctly. The console does not list any errors. Device and country settings have been double checked and all seems to be correct.

Google support has been contacted a few days ago but, unfortunately, there is still no reply from them.

With the deadline coming closer i'm getting less sleep each night.

Does anyone have any experience with this particular issue and hopefully a solution?

Notes

  • App is created with React Native version 0.59.9
  • No advertisements but uses AdMob SDK for Firebase Analytics
  • Package name is "com.kunstmuseum.kunstmuseum"
  • Searching the Play store for: "pub:Kunstmuseum Den Haag" does give me a result.

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kunstmuseum.kunstmuseum"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

<application
  android:name=".MainApplication"
  android:allowBackup="true"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>
  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
  <service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
    <intent-filter>
      <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
  </service>
  <service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService">
    <intent-filter>
      <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
    </intent-filter>
  </service>
</application>

build.gradle

apply plugin: "com.android.application"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: 'io.fabric'

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js",

    // Sometimes (like if you use Android API<17) adb forwards don't work, so you need a bundle in the dev APK
    bundleInDebug: project.hasProperty("bundleInDebug") ? project.getProperty("bundleInDebug") : false,
]

apply from: "../../node_modules/react-native/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 = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.kunstmuseum.kunstmuseum"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 5
        versionName "1.4"

        // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
        multiDexEnabled true
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // 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
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // 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:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            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 =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation project(':react-native-zip-archive')
    implementation project(':react-native-proximity')
    implementation project(':react-native-webview')
    implementation project(':rn-fetch-blob')
    implementation project(':react-native-video')
    implementation project(':react-native-svg')
    implementation project(':react-native-sound')
    implementation project(':react-native-shake')
    implementation project(':react-native-audio-jack')
    implementation project(':@react-native-community_async-storage')
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules

    /* ----------------------------
    *    REACT NATIVE FIREBASE
    * ---------------------------- */

    // Library as defined in settings.gradle
    implementation project(path: ':react-native-firebase')

    // Required dependencies
    //noinspection GradleCompatible
    implementation "com.google.firebase:firebase-core:16.0.9"
    implementation "com.google.android.gms:play-services-base:16.1.0"

    /* -------------------------
    *   OPTIONAL FIREBASE SDKS
    * ------------------------- */

    implementation('com.google.firebase:firebase-ads:15.0.1') {
      // exclude `customtabs` as the support lib version is out of date
      // we manually add it as a dependency below with a custom version
      exclude group: 'com.android.support', module: 'customtabs'
    }

    // Authentication
    implementation "com.google.firebase:firebase-auth:17.0.0"
    // Analytics
    implementation "com.google.firebase:firebase-analytics:16.5.0"
    // Performance Monitoring
    implementation "com.google.firebase:firebase-perf:17.0.0"
    // Remote Config
    implementation "com.google.firebase:firebase-config:17.0.0"
    // Cloud Storage
    implementation "com.google.firebase:firebase-storage:17.0.0"
    // Dynamic Links
    implementation "com.google.firebase:firebase-dynamic-links:17.0.0"
    // Real-time Database
    implementation "com.google.firebase:firebase-database:17.0.0"
    // Cloud Functions
    implementation "com.google.firebase:firebase-functions:17.0.0"
    // Cloud Firestore
    implementation "com.google.firebase:firebase-firestore:19.0.2"
    // Cloud Messaging / FCM
    implementation "com.google.firebase:firebase-messaging:18.0.0"
    // Crashlytics
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        transitive = true
    }

    /* --------------------------------
    *  OPTIONAL SUPPORT LIBS
    * -------------------------------- */

    // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
    implementation "com.android.support:multidex:1.0.3"

    // For Firebase Ads
    //noinspection GradleCompatible
    implementation "com.android.support:customtabs:27.1.1"

    // For React Native Firebase Notifications
    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'

    // For animated GIF support
    implementation 'com.facebook.fresco:animated-gif:1.10.0'
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'

getting error when i try to run react native app on android

$
0
0

i'm trying to run react native app on android with this command npx react-native run-android

but i am getting this error every time:

Failed to parse React Native CLI configuration. Expected running 'npx.cmd --quiet --no-install react-native config' command from 'C:\Users\UserName\Desktop\AppName' directory to output valid JSON, but it didn't. This may be caused by npx resolving to a legacy global react-native binary. Please make sure to uninstall any global 'react-native' binaries: 'npm uninstall -g react-native react-native-cli' and try again **

how can I fix this ?

Handle native service notification with react-native-firebase (Android)

$
0
0

I've been using react-native-firebase to handle receiving remote push notifications + displaying local notifications. The code below has been sufficient to handle notifications sent during active, background, and terminated states.

notifications().onNotificationOpened(async notificationOpen => {
    // is called when app is active or background and notification is clicked
    // here is where I expect to handle the user clicking the native notification (see below), 
    // but it is not called
})

notifications().onNotification(async notification => {
    // is called when app is in foreground and receives remote push notification
})

notifications().getInitialNotification().then(async notificationOpen => {
    // is called when app is opened from terminated state when clicking on notification
})

Recently, I had to make a custom native service which occasionally displays a notification. However when the user clicks on this notification, the app properly opens/foregrounds, but firebase does not invoke any of its callbacks as it does when receiving remote notification/handling local notifications generated using firebase's library. It makes no difference the activity state of my application; even if in the foreground, clicking the notification does not invoke firebase's callbacks. Here is how I am creating the notification. I have verified the channel ID is the same one that firebase creates. Not sure where else to go from here...

Intent notificationIntent = new Intent(this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

Notification notification = new NotificationCompat.Builder(this, 'push-channel')
    .setContentTitle("Notification Title")
    .setContentText("Notification Text")
    .setSmallIcon(R.drawable.ic_special)
    .setContentIntent(contentIntent)
    .setOngoing(true)
    .build();

I would like to have my react code respond to the user interacting with this native-built notification the same way it properly does when the user interacts with a notification created using notifications().displayNotification(new notifications.Notification(...)) If anyone has any ideas, that would be great!

How to customize button of react native

$
0
0

I am trying to make my application button in react-native like below

enter image description here

I am using inbuilt Button view of react native where I see that it does not allow to change the height also. I want to change the height as well rounded like expected image.

This is how my button is looking :

enter image description here

<Button
    title="CONTINUE"
    color="#FE434C"
    onPress={() => navigate("EnableNotification")}
  />

Could not expand Zip in react native project

$
0
0

I have seen the other questions similar to this on StackOverflow, but I feel like this error pops up all the time, and none of the solutions have really lasted for me. I just recently upgraded our project from React Native version 0.34.1 to 0.42.2 (doing the whole react-native-upgrade process), so I don't know if that is the cause of all this pain, but I keep getting this error:

* What went wrong:
Execution failed for task ':react-native-awesome-card-io:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library'.
> Could not expand ZIP '/Users/taylorking/.gradle/caches/modules-2/files-2.1/com.facebook.fbui.textlayoutbuilder/textlayoutbuilder/1.0.0/29bc8e5a1e2b33944b88277652ee83092ae1dbc0/textlayoutbuilder-1.0.0.aar'.

It sometimes happens on that package react-native-awesome-card-io, but it could and has happened on any of the packages that the project contains. Sometimes I just keep running react-native run-android, and it eventually resolves itself, but it's starting to drive me nuts.

I did just do some snooping around for that specific file, and I wanted to check my permissions on it, and it's showing:

-rw-r--r--  1 taylorking  staff  18074 Mar 16 09:41 textlayoutbuilder-1.0.0.aar

I'm just not even sure if that is the problem or not? I am not too familiar with gradle, but at least most of the posts on this problem deal with that in some form or fashion. I am willing to share any other information that could help solve this once and for all.

Sorry if this seems to be a duplicate, but nothing else has seemed to be the permanent solution on here.

Update:

I just tried deleting that package hoping it would solve my problems, and it just went to the next package with the same error:

* What went wrong:
Execution failed for task ':react-native-camera:prepareComFacebookFrescoDrawee081Library'.
> Could not expand ZIP '/Users/taylorking/.gradle/caches/modules-2/files-2.1/com.facebook.fresco/drawee/0.8.1/a944015ddf50fdad79302e42a85a351633c24472/drawee-0.8.1.aar'.

Update 2:

I ran cd android && ./gradlew clean and it almost finished the cleaning, but it did deny me permission on cleaning the folder related to react-native-camera ... the package above. I felt dirty doing this, but I did:

sudo ./gradlew clean

And that fixed this issue for now ... is there a better, or more long-term solution still? Opinions and thoughts encouraged.

How to debug an Android built application that works perfectly in dev and doesn't return a warning or error?

$
0
0

I'm new in the react-native/expo community.

I developped an app with expo. I have no warning or error in dev. When I publish my app on expo server, all works well.

However, when I make an android build, and install it on my device, I got a bug.

I got a drawer, with many links. But only one of them make restart the app on the first click on it an freeze the app on the second click.

I tried to debug with Sentry, but they are no log into Sentry when my app crash.

I don't know how to debug this kind of problem, so I ask here.

Thanks for your help.

React-native keyboard no comma on android Samsung devices in Text Input

$
0
0

I have a React-native app with TextInput and KeyboardAvoidingView. And everywhere it works well except android Samsung devices, especially Samsung A3. Because on this device the keyboard is appearing without a comma, but I need to use it on the screen.

I already tried the steps from this article, removed autoCapitalize="none" from the TextInput component, but it is not working for me.

Can somebody recommend how can I solve it please.[enter image description here

<TextInput
            style={textInput}
            placeholder={props.placeholder}
            underlineColorAndroid='transparent' editable={!props.disabled}
            keyboardType={keyboardType} 
            autoCorrect={false} selection={state.position}
            value={state.value} onChangeText={this._onChangeText}
            onFocus={this._onFocus} onBlur={this._onBlur}
            autoFocus={autoFocus}
          />

React Native stream camera of Android phone output to RTSP

$
0
0

I would like to stream my Android phone camera to a server, but my server only accepts RTSP. I have tried using react-native-nodemediaclient output RTMP which working well, but I don't want to write a RTMP to RTSP converter which is not optimal solution. So is there any way to implement it, I have searched Google but I cannot find the answer.


double push notification created with React Native + Expo + FCM

$
0
0

I'm trying to create an app that can receive push notification. The push notifications are sent using AWS SNS and using FCM token rather than Expo's Token. The notifications were received, however, every notification was received twice by the system tray. I tried using a phone without expo installed, but it still received 2 notifications.

this is my payload request when sending to SNS

{
"GCM": "{ \"notification\": { \"text\": \"test message\" } }"
}

Any idea why this is happening? I'm willing to provide the code, however I have no idea which part should I put. Here's one example. The app name is the same, but the first notification has expo's logo in it. update: after sending through firebase console I realized that the notification with expo icon is the correct one.

EDIT: After trying to send a notification from firebase console, I managed to get 1 notification only. Is the problem lies in SNS?

EDIT[2] I took a look at my Cloudwatch Log for the SNS Platform Application. And the NumberOfMessagesPublished metrics suggest that only 1 message published. So I guess it eliminates the possibility that the SNS api was called twice.

EDIT[3] I tried to use go-fcm package to send notification to fcm directly. I got 2 notifications even without using SNS. But why sending notification to fcm directly has a different output than using Firebase console?

enter image description here

UPDATE

Finally, I managed to get it to work by setting a tag field in the notification field to prevent duplicates.

So the payload is like this:

{
"GCM": "{ \"notification\": { \"text\": \"test message\", \"tag\": \"testing\" } }"
}

However this still does not answer the question on why I got the duplicates :(

React-Native-Video how to pause the video when video not in full screen or off the screen

$
0
0

i am making a Android video gallery app like YouTube using React-Native for that i am using 'react-native-video' , package While using it i had a problem with video auto-play option all videos are playing at a time in the background without viewing the videos and another problem is all videos controls={true} are showing when scrolling the video and they are not moving along with videos.I am doing all this inside FlatList My code :


import React, { Component, PropTypes } from "react";
import {
  AppRegistry, Image, Platform, StyleSheet, Text, View, TextInput, Button, TouchableHighlight, Alert,
  TouchableOpacity, ScrollView, ColorPropType, FlatList, SectionList, Dimensions,
  Keyboard, Modal, NativeModules, SafeAreaView, StatusBar, ViewPropTypes,
} from 'react-native';

import Video from 'react-native-video';
export default class HomeScreen extends Component {
 constructor(Props) {
    super(Props);
    this.state = {
      error: null,
      paused: true,
      playing: false,
    };
  }

render() {

    return (
       <View style={styles.container}>
          <View style={styles.tabContent}>
            <FlatList style={styles.list}
              data={this.state.all_Posts}             
              keyExtractor={(data_posts, index) => {
                return data_posts.id.toString();
              }}
              ItemSeparatorComponent={() => {
                return (
                  <View style={styles.separator} />
                )
              }}
              renderItem={(post, id) => {
                const items = post.item;
                return (
                  <View style={styles.card}>

                    <View style={styles.cardHeader}>

                         <View>
                          <Video
                            ref={ref => this.player = ref}
                            source={{ uri: "http://192.168.1.2:3200/" + items.file_Name }}
                            style={{ width: '100%', height: 700 }}
                            resizeMode="cover
                            volume={1.0}
                            controls={true}
                            volume={this.state.volume}
                            muted={this.state.muted}
                            paused={this.state.paused}
                            onLoad={this.onLoad}
                            onBuffer={this.onBuffer}
                            onError={this.videoError}
                            onProgress={this.onProgress}

                          />


                        </View>
                 </View>
               )
              }}
            />
          </View>
        </View>
       )
     }
}

Once check the code clearly and tell me how can i play the video only when the user viewing it and in remaining time it is in pause mode.And video controls={true} need to move or hide along with video.So please help me to find the solution to those two problems.

React Native on Android: Unable to determine the current character, it is not a string, number, array, or object

$
0
0

I create a new application and insert a old code, when i build the application this error appears:

Script 'C:\Users\nameuser\Desktop\nameapp\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 191

What went wrong:

A problem occurred evaluating settings 'nameapp'.

Unable to determine the current character, it is not a string, number, array, or object

The current character read is 'i' with an int value of 105
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
info Run "react-native --help" to see a list of all available commands.

With react-native info command I have the current situation:

info
  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
      Memory: 6.46 GB / 15.85 GB
    Binaries:
      Yarn: 1.15.2 - C:\laragon\bin\nodejs\node-v11\yarn.CMD
      npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.5.0.0 AI-191.8026.42.35.5900203

And on the package.json:

{
  "name": "nameapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/cli-platform-android": "^2.9.0",
    "axios": "^0.18.0",
    "haversine": "^1.1.0",
    "moment": "^2.22.2",
    "react": "16.6.3",
    "react-native": "^0.59.8",
    "react-native-actionsheet": "^2.4.2",
    "react-native-auto-height-image": "^1.1.0",
    "react-native-cached-image": "^1.4.3",
    "react-native-cli": "^2.0.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-global-font": "^1.0.2",
    "react-native-google-places": "^3.0.5",
    "react-native-image-crop-picker": "^0.24.1",
    "react-native-image-pan-zoom": "^2.1.10",
    "react-native-image-placeholder": "^1.0.14",
    "react-native-iphone-x-helper": "^1.2.0",
    "react-native-keyboard-manager": "^4.0.13-10",
    "react-native-maps": "github:react-community/react-native-maps",
    "react-native-maps-super-cluster": "^1.4.1",
    "react-native-modal-datetime-picker": "^5.1.0",
    "react-native-open-maps": "^0.3.3",
    "react-native-progress": "^3.4.0",
    "react-native-push-notification": "^3.1.2",
    "react-native-router-flux": "^4.0.6",
    "react-native-share": "^1.2.1",
    "react-native-snap-carousel": "^3.7.4",
    "react-native-swiper": "^1.5.13",
    "react-native-vector-icons": "^4.6.0",
    "react-native-view-shot": "^2.5.0",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-persist": "^4.10.1",
    "redux-persist-transform-filter": "0.0.15",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./src/fonts"
    ]
  }
}

Thank for the help.

Youtube blocked by the great firewall of china [closed]

$
0
0

In one of our mobile application we are using the youtube but it is blocked by the great firewall of china. Which platform do we use and does it work with the firewall for iOS Android?

or any other solution to implement this functionality.

Thanks!

Add node_modules in aar library of a 'react-native android' project

$
0
0

Is there a way to include node_modules in aar library so that a new android project using this aar library doesn't have to add these dependencies at their end as well?

I wanted to create a react native project which could be integrated in an existing android project as an aar library. Since I couldn't find a way to create an aar library of a react native project, I followed https://facebook.github.io/react-native/docs/integration-with-existing-apps to integrate react native in android app and then create an aar library of it. I managed to do it but the aar file created this way is of very small size (since it doesn't contain node_modules I suppose). So now to use this aar in a fresh android project, I had to install all the node_modules there as well and then specify the path in project's build.gradle like maven { url "$rootDir/node_modules/react-native/android" }

Is there a way that this step is not required at the end of the app that is going to integrate the aar? Besides please correct me if I took a wrong approach somewhere and is there an alternative way to approach this.

I receive a 401 error from the server when trying to authenticate a user in my React Native app on Android

$
0
0

I described my problem in the title.

Some additional info:

0) When I enable the Network Inspect in the React Native Debugger, everything works fine, and I don't have such a problem.

1) I use expo for my App.

2) I checked the problem on Android emulator (android v. 10) and on real android device (android v. 7) - the result is the same.

3) The problem is not repeated for iOS simulator.

4) I'm trying to make a GET request to remote server https://.../client/authorize and pass a JWT with user's email address in the Authorization: Bearer header.

5) I use the axios library for requests, but I have the same problem when I use native fetch.

6) Expo version is 35.0.0

7) When I disable Network Inspect in the React Native Debugger the problem with authorization on Android devices is back.

Thanks in advance for your answers.

How to create aab (bundle) via Fastlane?

$
0
0

I want to create aab (bundle) via Fastlane, but so far I was able to create only apk, here is my lane now, how to create aab?

 lane :beta do
    store_password = prompt(text: "Signing Store Password: ", secure_text: true)
    key_password = prompt(text: "Alias Key Password: ", secure_text: true)
    releaseFilePath = File.join(Dir.pwd, "..", "my-release-key.keystore")
    gradle(task: 'clean')
    gradle(
      task: 'assemble',
      build_type: 'Release',
      print_command: false,
      properties: {
        "android.injected.signing.store.file" => releaseFilePath,
        "android.injected.signing.store.password" => store_password,
        "android.injected.signing.key.alias" => "my-key-alias",
        "android.injected.signing.key.password" => key_password,
      }
    )
    upload_to_play_store(
      track: 'internal'
    )

React native: Using a panResponder inside of a scrollview broken on android

$
0
0

I know this issue has been raised many times but I have not found a working fix on any of the other threads (Most of which have very little to no replies).

In my implementation I have a ScrollView which is a parent to a list of items that each have a panResponder for sideways swiping (Like tinder cards).

The issue I am having is that the ScrollView stops the panResponder mid-animation and prioritizes scrolling.

I have tried dynamically toggling scrollEnabled on the scrollView on onPanResponderGrant and onPanResponderRelease but this is not a viable solution since scrolling vertically on a panResponder triggers onPanResponderGrant disabling scrolling.

Here is my implementation of panResponder:

this._panResponder = PanResponder.create({
        onStartShouldSetPanResponder: (evt, gestureState) => true,
        onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
        onMoveShouldSetPanResponder: (evt, gestureState) => false,
        onMoveShouldSetPanResponderCapture: (evt, gestureState) => false,
        onShouldBlockNativeResponder: (evt, gestureState) => false,
        onPanResponderTerminationRequest: () => false,
        onPanResponderGrant: (event, gestureState) => {
          this.pan.setValue(0);
          this.opacity.setValue(0)
          this.rotation.setValue(0)
        },
        onPanResponderMove: (event, gesture) => {
            this.pan.setValue(gesture.dx)
            this.rotation.setValue(gesture.dx)
            this.opacity.setValue(gesture.dx)
          },  
        onPanResponderRelease: (event, gestureState) => {
            if(gestureState.dx < -SWIPE_THRESHOLD){
                this.removeCard()
              } else {
                this.resetPosition()
              }
        }
      });

And here is the FlatList that renders each swipable card:

<FlatList
            data={this.state.cards}
            keyExtractor={item => item.id}
            renderItem={({ item }) => (
              <DataCard
              type={item.type}
              name={item.name}
              />
            )}
          />

I have since swapped out ScrollView with a FlatList with hopes of magically resolving this but no luck.

This functionality works flawlessly on iOS but the issue is still android.

It seems like this is a pretty common issue that has no concrete solution. Which is what Im hoping for by posting this.

Thanks!

React-Native Module for Android App Licensing

Android duplicate when open with

$
0
0

Has anyone had a problem similar to the one in the image?Duplicate

I get this duplication after pt

 manifestPlaceholders = [
                appAuthRedirectScheme: "emyplace"
        ]

in my default configs, but if I remove it, i getting the error:

Manifest merger failed : Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for is provided.

Can you suggest me few options to do deep linking for react native app? [closed]

$
0
0

I have to do deep linking implementation for my react native application. Suggest good options which work for both android and ios.

who to have rtl support in React Native in some pages and components and not affect the whole app?

$
0
0

I am working on an App and set the allow rtl to false

 sharedI18nUtilInstance.allowRTL(getApplicationContext(), false);

now I have a material ui text field that needs to be rtl in some pages but when I set i18manager force rtl in ComponentDidMount it forces the whole app to have rtl I just need it in some pages

  componentDidMount() {
    if (!I18nManager.isRTL) {
      I18nManager.forceRTL(true);
    }
  }

note: the textfield direction rtl does work

Viewing all 28476 articles
Browse latest View live