Categories
React Native

React Native – Deep linking example for Android and IOS

In this article I will discuses how to configure Deep Link on React Native application. React Native provides a Linking to get notified of incoming links. React Navigation can integrate with the Linking module to automatically handle deep links. Deep linking and universal links are gateway into your mobile application.

Configure Deep Link on React Native Application:

Very first, you want to specify a scheme URL for your app. If your app scheme is appname then a link to your app would be appname://

URL scheme for your app:

Open your Android app manifest android/app/src/main/AndroidManifest.xml you need to add following code between tag section.

Now configure the native iOS app to open based on the appname:// URI scheme. You need to add the following lines to ios/AppName/AppDelegate.m file.

After this change you need to re-build app “react-native run-android” or “react-native run-ios”

App Links Configure:

Here is configure app initial route and others screens with query params.

Configure App Linking:

Here is full example code for setup on App screen.

Test Deep Linking on IOS and Android:

Categories
Magento 2

Magento error – Unable to apply data patch for module Magento_Theme. In Gd2.php line 72

In PatchApplier.php line 170: Unable to apply data patch Magento\Theme\Setup\Patch\Data\RegisterThemes for module Magento_Theme. Original exception message: Wrong file

In Gd2.php line 72: Wrong file

Finally Installation is complete 100% after done following changes:

Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file. at line 96. Replace function with this: !file_exists($filename) Please find and change validateURLScheme function like below code.

Just add && !file_exists($filename)

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
Magento 2

Magento error – Could not validate a connection to Elasticsearch and Install using composer

Download Magento 2

Open SSH terminal on your server and run the following command to download and create new project. Previous post how to install Magento 2 on Windows XAMPP server.

Create The Database and Collect other information

Create new database and note Database name, database user name and database user password. Also site url, admin username, password, timezone and more. Run following command to install Magento 2.

Install/Setup Magento 2 by Command line

In SearchConfig.php line 81: Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

If you got any error related with Elasticsearch then just disable some module related with Elasticsearch using run following command and again run install command.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
WordPress

How to fix invalid JSON response error in WordPress

Updating failed. The response is not a valid JSON response.

This error appears when edit and update your posts or pages on your WordPress website. You will see message saying “The response is not a valid JSON response” and updating that page would fail. In this article, I will show you how to fix the invalid JSON error in WordPress.

WordPress needs to communicate with the server while you are editing a post or page form WordPress admin and it getting responses from the web hosting server in the background. This response is in JSON format which is used to quickly transport data using JavaScript.

I getting this error when I move my wordpress website to another server.

Solution:

First please confirm your home and siteurl is ok on database wp_options table.

Please go to Settings => Permalinks page. From here, you need to review the WordPress permalink options. Please select “Post name” option form Permalink Settings and click on the Save Changes button to store your settings.

Permalink Settings

Also please confirm those code are available on the .htaccess file.

Now site is ready to edit post or page from WordPress admin.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Download or Save View Content as Image in gallery

In this article, I will show you how we can download or save loop view content as image in React Native. For download or save view inner content, you want to ensure that you have react-native-view-shot and @react-native-community/cameraroll its dependencies.

Install npm package for view-shot and cameraroll

Make sure view-shot and cameraroll linked with Xcode

Configure Download View Inner Content

Now we write a const variable viewRefs to set each view ref for each loop view item. Also I have used userDataList loop data object.
Now we write a const method const downloadImage = async (index) => {} to download and save loop view, each item.
Now we write a const method const getPermissionAndroid = async () => {} for Permissions storage, to save and download image. On my previous article I have explain how to Share View Content in loop each item.
Permission is required to read and write to the external storage. Open android/app/src/main/AndroidManifest.xml file and add those permissions to save or download image.
React Native Download and Save View Content full Example code:

Here is full code for Download and Save view content loop items using React Native. You can move the code on your own created screen.

Done, now run your app using following command:

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Share view content in loop or Share list each item

In this article, I will show you how we can share view content with other apps in React Native. To use this share view inner content, you want to ensure that you have react-native-view-shot and react-native-share its dependencies.

Share view content in loop

Installation Sharing View Inner Content

Now we write a const variable viewRefs to set each view ref for each loop view item. Also I have used userDataList loop data object.

Now we write a const method const shareImage = async (index) => {} to share loop view, eache item.

React Native Sharing View Content full Example code:

Here is full code for sharing view content with other apps using React Native. You can move the code on your own created screen.

Done, now run your app using following command:

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Form Validation Multiple Input Fields

In this article, I will show you how we can validate multiple input fields. On my previous article I have discus how to implement Multiple Input Fields with add more rows with React Native. In this article I will make first row inputs are require of multiple rows.

Validate Multiple Input Fields

If you don’t know how to validate React Native multiple input fields before submit form data. I hope this article can help you to validate multiple input fields.

Validate Multiple Input Fields

Now we write a function function validateFormMultipleFields() to validate multiple input fields.

Now we write another form submit handle method const handlePressSubmitButton = () => {} to validate multiple input fields when a user submit form data to API end point.

Validate Multiple Input full Example code:

Here is full code for validate multiple input fields with React Native. You can move the code on your own created screen.

Done, now run your app using following command:

Categories
React Native

React Native: Dynamic multiple input fields and add more field

In this article, I will show you how we can implement multiple input fields dynamically with add more rows on click on Add More button with React Native.

Dynamic Multiple Input Multiple Row

If you don’t know how to create this React Native dynamic multiple input fields, then hope this article can help you. In this example initially screen came with two row with 6 input fileds such as (UserId, StartAmount and EndAmount). We can added multiple row by click on add more rows. I have write another article to validate multiple inputs.

Here we defined first two rows with 6 input fileds with (userId, startAmount and endAmount) and each fields error key.

Here we added method for Add More form inputs lines.

Dynamic Multiple Input full Example code:

Here is full code with dynamic multiple input field example. You can move the code on your own created screen.

Done, now run your app using following command:

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Bottom Tabs Navigator

Bottom Tabs Navigator is simple tab bar on the bottom of the screen, you switch between different screen or routes. Routes are initialized all tab screen components, they are not mounted until first focused.

Bottom Tabs Navigator

Installation Bottom Tabs Navigator

To use this tab navigator, you want to ensure that you have @react-navigation/native and its dependencies.

Install vector icons library

React Native Bottom Tabs Navigation Example:
Now create new “screens” directory in application root directory.


Then you need to create some screen files like HomeScreen.js, LoginScreen.js, RegisterScreen.js, AboutScreen.js and ProfileScreen.js in screens directory. Or If you have already some screens than skip new screen creations.

Now, open App.tsx file form React Native application directory and add following code in your App file.

Done, now run your app using following command:

Your app is ready with bottom tabs navigation. More details Bottom Tabs Navigator click here.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.

Categories
React Native

React Native: Top Tabs Navigator

Top Tabs Navigator is material-design themed tab bar on the top of the screen that lets you switch between different routes by tapping the tabs or swiping horizontally. Transitions are animated by default. Routes tab screen components for each route are mounted immediately.

Top Tabs Navigator

Installation Top Tabs Navigator

To use this tab navigator, you want to ensure that you have @react-navigation/native and its dependencies.

Installing dependencies into a bare React Native project

React Native Top Tabs Navigation Example:
Now create new “screens” directory in application root directory.


Then you need to create some screen files like HomeScreen.js, LoginScreen.js, RegisterScreen.js, AboutScreen.js and ProfileScreen.js etc. in your screens directory. Or If you have already some screens than skip new screen creation.

Example HomeScreen:

Now, open App.tsx file form React Native application directory and add following code in your App file.

Done, now run your app using following command:

Your app is ready with top tabs navigation. More details Material Top Tab Navigator click here.

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Hope it will help you.