Want to share multiple images with separate caption to each image Whatsapp, react native share

I’ve created working example to share multiple or single images using react-native-share CheckOut ExpoSnack Here added comments before every method what it’ll do and what needs to be replaced. // multiple images share example const shareMultipleImages = async () => { const shareOptions = { title: ‘Share multiple files example’, // here replace base64 data … Read more

react-native-fbsdk error: No resource found that matches the given name: attr ‘android:keyboardNavigationCluster’

Go to React-Native Project : android/build.gradle file and restrict fbsdk Version to 4.28.0. allprojects { repositories { … configurations.all { resolutionStrategy { force ‘com.facebook.android:facebook-android-sdk:4.28.0′ } } } } If you have another error like below: Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.Button.Colored’`. You can try: allprojects { repositories … Read more

How do I display an animated gif in React Native?

For RN < 0.60 By default the Gif images are not supported in android react native app. You need to set use Fresco to display the gif images. The code: Edit your android/app/build.gradle file and add the following code: dependencies: { … compile ‘com.facebook.fresco:fresco:1.+’ // For animated GIF support compile ‘com.facebook.fresco:animated-gif:1.+’ // For WebP support, … Read more

How to upload file to server using react-native

There is file uploading built into React Native. Example from React Native code: var photo = { uri: uriFromCameraRoll, type: ‘image/jpeg’, name: ‘photo.jpg’, }; var body = new FormData(); body.append(‘authToken’, ‘secret’); body.append(‘photo’, photo); body.append(‘title’, ‘A beautiful photo!’); var xhr = new XMLHttpRequest(); xhr.open(‘POST’, serverURL); xhr.send(body);

React Native: Possible unhandled promise rejection

catch function in your api should either return some data which could be handled by Api call in React class or throw new error which should be caught using a catch function in your React class code. Latter approach should be something like: return fetch(url) .then(function(response){ return response.json(); }) .then(function(json){ return { city: json.name, temperature: … Read more

Render HTML in React Native

Edit Jan 2021: The React Native docs currently recommend React Native WebView: <WebView originWhitelist={[‘*’]} source={{ html: ‘<p>Here I am</p>’ }} /> https://github.com/react-native-webview/react-native-webview If you don’t want to embed a WebView, there are also third party libraries to render HTML into native views: react-native-render-html react-native-htmlview Edit March 2017: the html prop has been deprecated. Use source … Read more