Applies to Kony Visualizer Classic.
Using this feature, you can integrate a React Native app (which is developed in React Native framework) to a Kony app (which is developed in Kony framework). The React Native app is embedded into the Kony form through a container, called as the React Native Container. Furthermore, some APIs are used to communicate between the React Native app's JavaScript framework and the Kony app's Kony framework. This feature is available from Kony Visualizer V8 SP4 onwards.
React Native is a framework developed by Facebook. React Native is used to create cross-platform mobile applications.
To gain a more hands-on experience on the React Native Integration process, download and use the TaskListSample app from GitHub.
For more information on the container and communication APIs that are essential to integrate a React Native app to a Kony app, refer these sections:
Before you try to integrate the React Native app into your Kony project, ensure that you compile the reactNative project and run it at least once (by which you can confirm that the project is error-free).
For integrating the reactNative app into your Kony project, the requirements for the reactNative Project are as follows:
You must create the reactNative project by using the react-native init <AppName> command.
Note: The supported React Native version in Quantum Visualizer is 0.59.x and not any other version above that.
For the Android OS, if the React Native version is less than 0.58.0, then the React Native apps bundles only armeabi-v7a, arm64-v8a and x86 .so files but not the x86_64 .so file. If the version is equal to or greater than the version. 0.58.0, then both 32- and 64-bit architectures .so files of arm and x86 are bundled with React Native app.
To check the path of the React Native app version, navigate to the React native workspace and open the package.json file. <react-native app workspace>/package.json
Note: For iOS, the application code inside the React Native AppDelegate class is ignored. Multiple apps must not have the same class files or classes with the same name.
In this section, you will learn how to integrate a React Native app to a Kony app manually.
Important: Currently, Kony Visualizer does not provide the support to directly integrate a React Native app to a Kony app. As a result, you must perform the steps mentioned in the following sections to execute the integration process.
In the root folder of your Kony application workspace, create a folder and name it as ReactNativeProjects.
Copy the React Native app(s) to the ReactNativeProjects folder.
For iOS, follow these steps:
Create a package.json file in the ReactNativeProjects. This json file must contain a JSON object with a single key-value pair, where the key is dependencies and its value is an array of react-native dependencies mentioned in each package.json file of all the React Native apps. For example,
//package.json file content
{
"dependencies": ["react","react-native","react-navigation"]
}
Run the following platform-specific React Native command from each ReactNative app root folder to generate the hierarchical JavaScript bundle:
Note: Create the assets folder (under <reactNativeApp>/android/app/src/main/) and also <AppName> folder under assets, if they do not exist.
Note: Replace <AppName> with the app's name key value that is available in the app.json file, which is located at the root folder of the each React Native project.
You can enable the React Native feature for Android by adding its corresponding properties to the androidbuild.properties file. For detailed information on the manual steps of this process, click here.
The manual steps to enable the React Native feature for iOS are as follows:
For Android, React Native apps are added as libraries to the Kony app, which might result in the failure of the build due to many reasons. Here are a few build failure issues when the React Native app is embedded and built for Android:
Note: The latest React Native apps use support libraries version variable as ext block of the build.gradle file, which is located at <reactNativeAppRootFolderPath >/android. You can modify the supportLibVersion from this location.
The relevant example is as follows.
ext {............
supportLibVersion = "26.1.0"
}
Note: You can view which libraries/modules are added to the React Native app by opening the settings.gradle file, which is located at <reactnativeApp>/android.
ext {............
supportLibVersion = "26.1.0"
}
ext {............ supportLibVersion = "26.1.0" }

configurations.all {
resolutionStrategy {
force "com.android.support:recyclerview-v7:27.1.1"
force "com.android.support:appcompat-v7:27.1.1"
}
}
Click here to resolve other types of Gradle-dependency issues, such as duplicate classes.

allprojects {
repositories {
mavenLocal() google() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npmurl "$rootDir/../node_modules/react-native/android"}maven {url 'https://maven.google.com/'name 'Google'}maven { url "https://jitpack.io" }}}
Note: The Build Tools versions are mentioned in the app module build.gradle file.
android {
..........
buildToolsVersion '27.0.3'
}
The relevant information on Kony's Gradle Plugin, Build Tools, and Gradle Dependencies for V8 SP4 is as follows.
Note: The versions will change based on the plugins, so always refer the plugin corresponding to the build.gradle file for the exact Kony versions used .
Location of the build.gradle file: <workspace>/temp/<appName>build/<luaandroid/luatabrcandroid>dist/<appName>:
/** gradle android plugin version **/
classpath 'com.android.tools.build:gradle:3.2.1'
/** compileSDKVersion **/
28
/** build_tools_version **/
28.0.3
/** gradle version **/
gradle 4.6
/** support library dependencies **/
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
/** Google play services dependencies versions **/
//maps
implementation 'com.google.android.gms:play-services-maps:11.6.0'
//locationlibversion
implementation 'com.google.android.gms:play-services-location:11.6.0'
//multidex_dependency
implementation 'com.android.support:multidex:1.0.0'
//dependencies_google_play_wearable_version
implementation 'com.google.android.gms:play-services-wearable:11.6.0'
//dependencies_android_support_wearable_version
implementation 'com.google.android.support:wearable:2.0.2'
//dependencies_android_wearable_wearable_version
compileOnly 'com.google.android.wearable:wearable:2.0.2'
//dependencies_google_fcm_messaging
implementation 'com.google.firebase:firebase-messaging:11.6.0'
//dependencies_google_play_pay_version
implementation 'com.google.android.gms:play-services-wallet:11.6.0'
//classpath_google_services
classpath 'com.google.gms:google-services:3.1.0'
| Copyright © 2013 Kony, Inc. All rights reserved. |