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

How to set android push notification color and icon?

$
0
0

I am using react-native, amplify, and pinpoint.

I have followed several guides and stack overflow questions to set the android default color and icon for push notifications like this:

<meta-data    android:name="com.google.firebase.messaging.default_notification_icon"    android:resource="@drawable/ic_notification" /><meta-data    android:name="com.google.firebase.messaging.default_notification_color"    android:resource="@color/patch_coral" />

I have a file colors.xml inside of android/app/src/main/res/values/ with this content:

<resources><color name="patch_coral">#E97A6E</color></resources>

And for the icon I have drawable folders inside of android/app/src/main/res/ which contain the ic_notification.png generated in android asset studio as white icons as was instructed in several places.

I have also tested with debug and release builds to see if that would change anything; however, the push notifications still do not have the default icon or color, but it does have the app icon on the right side. Here is an example:

current android push notification example

What needs to be changed or added to get the color and icon to replace the default android color, and square icon?


App rejected due to privacy policy url issue but there no field for privacy policy in Store Listing

$
0
0

I have recently submitted an app which got rejected due to below error

> Issue: Violation of Families Policy RequirementsApps that contain elements that appeal to children must comply with all Families Policy Requirements. We found the following issue(s) with your app:> > Eligibility Issue Privacy policy You must provide a link to your app's> privacy policy on your app's store listing page. This link must be> maintained at all times while the app is available on Google Play, and> it must link to a privacy policy that, among other things, accurately> describes your app’s data collection and use. Please provide a link to> a valid privacy policy in your app's store listing page in the Play> Console. For more details, please refer to the Privacy policy section> (#6) of the Families Policy Requirements.

But there is no privacy policy field in my Store listing page. I can't understand then why is my app getting rejected. Please guide me. Thank you in advance.

Location not updating on server when app enters stationary when app is in background or is closed using mauron85/react-native-background-geolocation

$
0
0

Location updates correctly when app is in foreground or when sent to background while user is moving but if app goes into stationary region while app is closed or is background location stops to update. Even if I travel distance once app goes to stationary region from background or terminate state it does not exit stationary region and stops updating location on server.

Environment:

React Native version: 0.59.9Plugin version: 0.6.3Platform: AndroidOS version: 7Device manufacturer and model: Redmi Note 4

Plugin configuration options:

BackgroundGeolocation.configure({      desiredAccuracy: 10,      stationaryRadius: 10,      distanceFilter: 5,      notificationTitle: 'Background Tracking',      notificationText: 'Enabled',      debug: true,      startOnBoot: true,      stopOnTerminate: false,      locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,      interval: 5000,      url: url,      syncUrl: url,      httpHeaders: {        ...this.props.headers      },      postTemplate: {        lat: '@latitude',        long: '@longitude',        id: id // you can also add your own properties`      }    })

ReactNative WebView content height calculation working fine on iOS but on Android it gives more height than the actual content

$
0
0

I am using web view to load my rich text editor html content in react native. The problem is I need to render multiple webviews one after the other vertically. And webview need a explicit height to load content. So, after searching for some time I found https://medium.com/@fxwio/set-webview-height-to-the-height-of-html-content-react-native-2d696128c181and it helped me to identify height based on content. The content height on iOS is working fine. But on Android if the actual content height is "1756" it calculates as "8884".Please help me out of this.

Push Notifications Configuration Error - React Native

$
0
0

I am trying to create push notifications in my react native project both in iOS and android.

I have followed both the configuration instructions for react-native-push-notification and push-notification-ios, however when I run my app I get the following error.

erorr

After doing some online research I can't seem to find a fix for this problem.

Here is my code

mport PushNotificationIOS from '@react-native-community/push-notification-ios';import PushNotification from "react-native-push-notification";const configure = () => { PushNotification.configure({   onRegister: function(token) {     //process token   },   onNotification: function(notification) {     // process the notification     // required on iOS only     notification.finish(PushNotificationIOS.FetchResult.NoData);   },   permissions: {     alert: true,     badge: true,     sound: true   },   popInitialNotification: true,   requestPermissions: true, });}; export {    configure,   };

React native navigation drawer is not covering header in my application

$
0
0

I am new to react native development, but i have some requirement with react navigation drawer. I want to display the navigation drawer from top of the screen but it is display below from toolbar. It is a combination of both Stack and Drawer screens. Following is my code in App.js

function App() {  SplashScreen.hide()  return (<NavigationContainer>      {/* headerMode='float' */}<Stack.Navigator initialRouteName='Login'><Stack.Screen name="Login" component={LoginScreen}          options={{ headerShown: false }} />        {/* <Stack.Screen name="Home" component={HomeScreen} /> */}<Stack.Screen name="DrawerScreens" component={DrawerScreens}           options={({ navigation, route }) => ({            title: "Home",            headerTintColor: '#FFFFFF', headerStyle:{backgroundColor:'#154493'},            headerLeft: props => <NavigationDrawerStructure navObj={navigation} />,          })} /><Stack.Screen name="Dashboard" component={Dashboard}             options={({ route }) => ({headerTintColor: '#FFFFFF', headerStyle:{backgroundColor:'#154493'}})} /></Stack.Navigator></NavigationContainer>

DrawerScreens function is like following..

function DrawerScreens({ route, navigation }) {  // console.log("param:"+route.params.token)  return (    //drawerContent={props=>CustomDrawerContent(props)}    // <SafeAreaProvider><Drawer.Navigator drawerContent={props => CustomDrawerContent(props)} headerMode="float">    {/* <Drawer.Navigator drawerContent={props => CustomDrawerContent(props)}> */}      {/* options={{ drawerLabel: 'Updates' }} */}<Drawer.Screen name="LandingScreen" component={LandingScreen}        initialParams={{ token: route.params.token }}/>  );}

CustomDrawer function contains list of the menu items which is dynamic and NestedMenuView is taking care of that..

function CustomDrawerContent(props) {  return (<SafeAreaView style={{flex: 1}} forceInset={{ top: "always" }}><NestedMenuView navObj={props.navigation} /></SafeAreaView>         );};

Please check the reference image here, I want left menu starts from header instead of below from header

For me the combination of both stack and drawer screens.Thanks in advance.

how to normalize font size?

$
0
0

In android, you can increase the font size. If you use the maximum font, the layout will break. You need to come up with a formula so that when you change the font size on the device, the font size in the application is the same. This applies not only to the Text component, but to all components (input, icons, etc.)

At the moment there is such a formula, but it is not finalized, tell me how to solve the problem

import { PixelRatio } from 'react-native';export function FontSize (size, px) {  if (px) {    return `${ Math.round(size / PixelRatio.getFontScale()) + 1 }${ px === true ? 'px' : px }`;  } else {    return Math.round(size / PixelRatio.getFontScale()) + 1;  }}

How to forbid Tablet usage in expo / react-native?

$
0
0

I have developed an app with Expo and react-native for Smartphones - now I am trying to upload the ".aab" file to the Google Play Store - however it seems like it will be available for tablet and wearables, too. I could not really find out how to either code it into the "app.json" or into the code itself, that only a smartphone must be supported.

Furthermore, it should not be possible to even download the app from any other device than a smartphone, cause that would cause bad ux

I tried the device catalogue but could only choose to block by processor or RAM - is there an easy goto solution?


How to use CodePush only on Android with React Native

$
0
0

I'm currently building a React Native app which will be available only on Android for now. I decided to use Code Push to update the app without the Google Play analysis delay. I installed the react native library on my project and successfully connected my App Center account using the CLI, added the keys to the build.gradle and the HOC on my App entrypoint file. The problem is that when I run the app I keep getting an error. I suspect I'm getting this because I have Code Push set up only for Android and not iOS. If this is the case what would be the smartest way to solve the problem? Eject iOS folder from the project or something? I'd appreciate any tips. Thanks.

The error log

[CodePush] Sync already in progress. LOG
[CodePush] Checking for update. LOG
[CodePush] An unknown error occurred. LOG
[CodePush] 400: An update check must include a valid deployment key - please check that your app has been configured correctly. To view available deployment keys, run 'code-push deployment ls -k'.

My buildTypes section on build.gradle

buildTypes {    debug {        signingConfig signingConfigs.debug        resValue "string", "CodePushDeploymentKey", '""'    }    releaseStaging {        resValue "string", "CodePushDeploymentKey", '"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"'        // Note: It is a good idea to provide matchingFallbacks for the new buildType you create to prevent build issues        // Add the following line if not already there        matchingFallbacks = ['release']    }    release {        // Caution! In production, you need to generate your own keystore file.        // see https://facebook.github.io/react-native/docs/signed-apk-android.        signingConfig signingConfigs.debug        minifyEnabled enableProguardInReleaseBuilds        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"        resValue "string", "CodePushDeploymentKey", '"XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"'    }}

This is my entrypoint file

import React from 'react';import { Provider } from 'react-redux';import CodePush from 'react-native-code-push';import { PersistGate } from 'redux-persist/integration/react';import './config/ReactotronConfig';import Routes from './routes';import { store, persistor } from './store';import { setTopLevelNavigator } from './utils/NavigationService';function App() {  return (<Provider store={store}><PersistGate persistor={persistor}><Routes ref={navigatorRef => setTopLevelNavigator(navigatorRef)} /></PersistGate></Provider>  );}export default CodePush({  checkFrequency: CodePush.CheckFrequency.ON_APP_RESUME,})(App);

How to building React Native App using WebRtc

$
0
0

Thank you for your help in advance.

I want to make a new WebRtc mobile application for video calling using react native, i checked many articles but not getting exact information how to start. Can any person please help me and guide me the path to create an application.

.\gradlew /clean

FAILURE: Build failed with an exception.

  • Where:Build file 'C:\Jig\New folder\react-native-demoapp-master\react-native-demoapp-master\node_modules\react-native-webrtc\android\build.gradle' line: 30

  • What went wrong:A problem occurred evaluating project ':WebRTCModule'.

    Could not find method implementation() for arguments [com.facebook.react:react-native:+] on project ':WebRTCModule'.

  • Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.903 secs

(React-Native 0.62.0) Getting Unable to find a matching variant of project :react-native-community_async-storage (same for other libs too)

$
0
0

My project was working perfectly but it stops building after upgrading to RN 0.62.0 from RN 0.59.5 (debug build is working fine, it happens only for assembleRelease)

I did some research and came across using macthingFallback, but that doesn't worked too.

missingDimensionStrategy can be a solution, but adding it for every library used can't be optimised option.

My android/app/build.gradle have

  1. Two items in signingConfigs i.e. prod and stage that contains infoabout .keystore

  2. Four items in productFlavors (i.e. dev, beta, prod,qa)

  3. Three items in buildTypes i.e.
   debug {        applicationIdSuffix = ".dev"    }
release {    minifyEnabled enableProguardInReleaseBuilds    proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"    productFlavors.beta.signingConfig signingConfigs.stage    productFlavors.prod.signingConfig signingConfigs.prod    productFlavors.qa.signingConfig signingConfigs.stage    matchingFallbacks = ['release']}packagingOptions {    pickFirst "lib/armeabi-v7a/libc++_shared.so"    pickFirst "lib/arm64-v8a/libc++_shared.so"    pickFirst "lib/x86/libc++_shared.so"    pickFirst "lib/x86_64/libc++_shared.so"}

android/build.gradle have

dependencies{   classpath('com.android.tools.build:gradle:3.6.3')}repositories {        google()        jcenter()        maven { url 'https://maven.fabric.io/public' }    }allprojects {    repositories {        mavenLocal()        google()        jcenter()        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")        }        maven { url "https://www.jitpack.io" }    }}

my gradle-wrapper.properties have

distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip

my gradle.properties

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8android.useAndroidX=trueandroid.enableJetifier=trueFLIPPER_VERSION=0.33.1

settings.gradle have

rootProject.name = 'APPNAME'include ':react-native-config'project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)include ':react-native-sound'project(':react-native-sound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sound/android')include ':app', ':react-native-code-push'project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

Error logs after running ./gradlew assembleRelease (giving error only for release build)

React Native - Android - keyboardavoidingView in stackNavigator within a tabNavigator pushes bottomTabBar (clunky behaviour)

$
0
0

I am trying to build an auth flow that has a welcome page and then login or signup depending on the user's case.It is built inside a stack navigator. The first screen has no header but then login and signup do via their screen options.

// AuthNavigatorconst AuthStackNavigator = createStackNavigator();export const AuthNavigator = () => {  return (<AuthStackNavigator.Navigator      initialRouteName={WELCOME_PAGE.id}      screenOptions={{        headerShown: false,        headerTintColor: colors.primary,      }}      lazy><AuthStackNavigator.Screen        name={WELCOME_PAGE.id}        component={WELCOME_PAGE.component}      /><AuthStackNavigator.Screen        name={LOGIN_PAGE.id}        component={LOGIN_PAGE.component}        options={LOGIN_PAGE.options}      /><AuthStackNavigator.Screen        name={SIGN_UP_PAGE.id}        component={SIGN_UP_PAGE.component}        options={LOGIN_PAGE.options}      /></AuthStackNavigator.Navigator>  );};

This flow, is nested inside a tabNavigator:

// AuthTabNavigatorconst AuthTabNavigator =  Platform.OS === 'android'    ? createMaterialBottomTabNavigator()    : createBottomTabNavigator();const RootNavigator = () => {  return (<AuthTabNavigator.Navigator      activeColor={colors.primary}      inactiveColor="grey"      barStyle={materialBottomNavBackgroundColor}      tabBarOptions={defaultTabNavOptions}><AuthTabNavigator.Screen        name={WELCOME_PAGE.id}        component={AuthNavigator}        options={WELCOME_PAGE.options}      /></AuthTabNavigator.Navigator>  );};export default RootNavigator;

On iOS, things work fine but on Android, It has weird behaviour. When pressing on the input field, the keyboard pushes the bottom bar causing a clunky effect on press but also on dismiss of the field. As if it were recalculating the height every time and repositioning the layout.

In order to make sure it's not coming from my code, I tested again with the snippet from the React Native documentation

I get the following (these are on the Android emulator but I get the same result on my OnePlus android phone)

The only version that works is the one when not nested in the tab navigator so I guess the issue comes from there.

I checked a few solutions but none worked:

I am using React Native CLI:

"react-native": "0.62.2","@react-navigation/bottom-tabs": "^5.2.8","@react-navigation/drawer": "^5.7.2","@react-navigation/material-bottom-tabs": "^5.1.10","@react-navigation/native": "^5.1.7","@react-navigation/stack": "^5.2.17",

Let me know if you encountered the same issue and found a way to fix it. Thanks in advance.


EDIT: SOLUTION I WENT WITH

On top of the "custom" solution I posted in the comments, after opening an issue on React Navigation repo and checking closed issues, I found that on Android, you might have 2 options:

  • Either your invert the nesting, see here

  • Or you can set the behaviour of the keyboardAvoidingView to position on Android and provide a custom Tabbar

https://github.com/react-navigation/react-navigation/issues/7359#issuecomment-545842090

https://stackoverflow.com/a/51169574/11287266

I ended up going with the latter:

const TabBarComponent = props => {  return (<View collapsable={false}><BottomTabBar {...props} /></View>  );};// AuthTabNavigatorconst AuthTabNavigator = createBottomTabNavigator();const RootNavigator = () => {  return (<AuthTabNavigator.Navigator      activeColor={colors.primary}      inactiveColor="grey"      barStyle={materialBottomNavBackgroundColor}      tabBarOptions={defaultTabNavOptions}      tabBar={props => <TabBarComponent {...props} />}><AuthTabNavigator.Screen        name={WELCOME_PAGE.id}        component={AuthNavigator}        options={WELCOME_PAGE.options}      /></AuthTabNavigator.Navigator>  );};export default RootNavigator;

<KeyboardAvoidingView        contentContainerStyle={{ flexGrow: 1 }}        style={styles.container}        behavior={Platform.OS === 'ios' ? 'padding' : 'position'}        keyboardVerticalOffset={Platform.OS === 'android' ? -50 : 25}>

Passing useState update function to child causes undefined function error

$
0
0

Using expo and react-native I have created a screen called MainStateScreen this screen essentially has two direct children called OptionsComponent and NavigationButton. OptionsComponent has multiple children that when modified, update the state of the MainStateScreen so we can pass that as a prop to the next screen with the NavigationButton. That's how it's supposed to work at least.

Instead, when I try to modify the OptionsComponent's children and use MainStateScreen's update function I get the following error.

Here is pseudo-code of my component composition:

MainStateScreen.js

const defaultOptionsObject = [    {        name: '',        value: 1,        count: 0,    },    {        name: '',        value: 8,        count: 0,    },    {        name: '',        value: 20,        count: 0,    },    {        name: '',        value: 25,        count: 0,    },    {        name: '',        value: 30,        count: 0,    },    {        name: '',        value: 32,        count: 0,    },    {        name: '',        value: 100,        count: 0,    },]const MainStateScreen = () => {    const [options, setOptions] = useState(defaultOptionsObject)    return (<View><ScrollView><OptionsComponent options={options} setOptions={setOptions} /></ScrollView><NavigationButton onPress={() => navigation.push('OtherScreen', { options })} /></View>    )}

OptionsComponent.js

const SingleOptionComponent = ({ index, option, options, setOptions }) => {    const [stateOption, setStateOption] = useState({ ...option })    const updateCount = val => {        const tempOption = { ...stateOption }        if (val) {            tempOption.count += 1        } else if (tempOption.count !== 0) {            tempOption.count -= 1        }        setStateOption(tempOption)    }    useEffect(() => {        const tempOptions = [ ...options ]        tempOptions[index] = { ...stateOption }        setOptions(tempOptions) // Commenting this out removes the error.    }, [stateOption])    const AddSubtractButton = () => {        return (<View><TouchableHighlight onPress={() => updateCount(true)}><Text>Add</Text></TouchableHighlight><TouchableHighlight onPress={() => updateCount(false)}><Text>Subtract</Text></TouchableHighlight></View>        )    }    return (<ListItem rightElement={AddSubtractButton} />    )}const OptionsComponent = ({ options, setOptions }) => {    return (<View>            {options.map((option, index) => {                return (<SingleOptionComponent                        key={`${option?.value}-${index}`}                        index={index}                        option={option}                        options={options}                        setOptions={setOptions}                    />                )            })}<View/>    )}

The exact error is:

TypeError: undefined is not a function (near '...options.map...')This error is located at:    in OptionsComponent (at MainStateScreen.js)

BUT when I console.log the setOptions function in the useEffect of SingleOptionComponent, Function setOptions is printed in the console.

If I remove the setOptions(tempOptions) call from the useEffect inside the SingleOptionComponent the error goes away but I need something like that to accomplish the pass up to the parent and over to the NavigationButton.

What could I be doing wrong?

Expo push notification sound and popup doesn't work

$
0
0

I am developing an app with expo and push notification works fine but without sound and it doesn't popup..

Note: it only vibrates but without notification sound.

My client side

 if (Constants.isDevice) {      const { status: existingStatus } = await Permissions.getAsync(Permissions.NOTIFICATIONS);      let finalStatus = existingStatus;      if (existingStatus !== 'granted') {        const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);        finalStatus = status;      }      if (finalStatus !== 'granted') {        alert('Failed to get push token for push notification!');        return;      }      token = await Notifications.getExpoPushTokenAsync();      console.log(token);      this.setState({ expoPushToken: token });    } else {      alert('Must use physical device for Push Notifications');    }    if (Platform.OS === 'android') {      Notifications.createChannelAndroidAsync('notification-sound-channel', {        name: 'Notification Sound Channel',        sound: true,        priority: 'max',        vibrate: [0, 250, 250, 250],      });    }

My server side is php laravel: https://github.com/Alymosul/exponent-server-sdk-php

$notification = ['title' => 'test title','body' => 'test body''channelId' => 'notification-sound-channel',];

I also tested it with expo Push notifications tool: https://expo.io/notifications and it works the same (vibration without sound or popup)

environment

expo: "^37.0.8",

SDK version: 27,

Testing device android version: 9

Unable to connect with remote debugger

$
0
0

I'm using React.JS and when I do react-native run-android (with my device plugged in) I see a blank page. When I shake the device and select Debug JS Remotely from the option list I see the following screen.

enter image description here

FYI:

OS: Ubuntu 16.04Node version is: v4.6.2java version "1.8.0_111"react": "15.4.1react-native": "0.38.0

Android ReactNative Expo-Av library: How to loop through multiple songs?

$
0
0

New Dev. Was given a task by this spot i'm Interning at.

We are developing a react native app, and using the expo-av library they have a theme song playing on repeat in the background of most of the app screens.

The current code (using Context API) is:

const [soundObject, setSoundObject] = useState(initialState.mainThemePlay)const startMusic = async () => {    mainTheme = new Audio.Sound()    try {      await mainTheme.loadAsync(require("../assets/sounds/MainTheme.mp3"))      await mainTheme.setStatusAsync({ isLooping: true })      await mainTheme.playAsync()      setSoundObject(mainTheme)    } catch (error) {      console.log("Couldnt load main theme")      return    }  }  const stopMusic = async () => {    try {      await soundObject.stopAsync()      await soundObject.unloadAsync()      setSoundObject(null)    } catch (error) {      console.log("Couldnt stop main theme")      return    }  }

Right now because of isLooping: true it loops over and over the same song.

How do I make it so that it plays 3 songs consecutively, and at the end of the 3rd song it should go back to the 1st song?

In the docs there is an attribute called didJustFinish, a Boolean value that is supposed to be returned when the media stops playing.

Conceptually I tried a bunch of different ways to make it loadAsync the new song and setSoundObject() the new song, when the first song didJustFinish: true but I'm having trouble.

Hope this is a good question. Thanks all

Running react native bare project results in error A problem occurred configuring project ':react-native-reanimated'

$
0
0

I have installed react native through the expo kit and now when I run yarn run android I received that error. I haven't changed anything on the template. I don't know what is happening.? If there are further about feel free to ask. I have also checked the build.gradle of react native reanimated but ,unfortunately , no success has shown up.

FAILURE: Build failed with an exception. * Where:Build file 'C:\Users\David\Desktop\TheGuruApp\node_modules\react-native-reanimated\android\build.gradle' line: 89* What went wrong:A problem occurred configuring project ':react-native-reanimated'.> java.io.IOException: The filename, directory name, or volume label syntax is incorrect* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.      * Get more help at https://help.gradle.orgBUILD FAILED in 28serror Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081FAILURE: Build failed with an exception.* Where:Build file 'C:\Users\David\Desktop\TheGuruApp\node_modules\react-native-reanimated\android\build.gradle' line: 89* What went wrong:A problem occurred configuring project ':react-native-reanimated'.> java.io.IOException: The filename, directory name, or volume label syntax is incorrect* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.      * Get more help at https://help.gradle.orgBUILD FAILED in 28s

React Native FBSDK TypeError: null is not an object (evaluating 'AppEventsLogger.logPurchase')

$
0
0

I'm trying to use the react-native-fbsdk to log some app events like add products to cart, purchase and etc on Android. I followed all the Android installation instructions on the official page: github.com/facebook/react-native-fbsdk. As my react-native version is 0.62.2, it is supposed to have auto-link, but anyway I also followed the instructions to manually link the package. The problem is that this error happens when initializing the app and I could not solve it: TypeError: null is not an object (evaluating 'AppEventsLogger.logPurchase').

The error screenenter image description here

enter image description hereenter image description here

enter image description here

enter image description here

enter image description here

enter image description here

How to clear react-native cache?

$
0
0

In react-native development, there are multiple caches used when the app is built:

  1. React-native packager cache
  2. Emulator cache
  3. Java side cache (.gradle) folder (only in android)
  4. npm cache (if relevant?)

Am I missing something also? Because I'm trying to clear cache in react-native, to be able to repeat a bug that only occurs on first usage. But clearing those caches above did not help. This is on android. When the app is building, most of the rows DO NOT say UP-TO-DATE, as expected, because I cleared the cache.

But, there are still many rows where this text is printed. Like:

app:preBuild UP-TO-DATE

app:preDebugBuild UP-TO-DATE

:app:preReleaseBuild UP-TO-DATE

The question is, how can I clear the whole cache related to react-native development?

Android equivalence of iOS ActionSheet

$
0
0

What is the Android equivalence of the UIActionSheet in the iOS SDK? I am working on a React-Native project and need to maintain the use of native controls where possible. I have not come across an npm package or other that makes use of the respective plartform 'actionsheet'. They all seem to use native actionsheet in iOS, and a javascript mock of the iOS actionsheet for Android (which makes it non-native on Android). If I can know what android shows where iOS shows an actionsheet then I can make use of the RN Android component for android and actionsheet for iOS. I hope this is a clear question.

Viewing all 28463 articles
Browse latest View live


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