Difference between revisions of "Step By Step Guide"

From Ethora iOS & Android ERC-20 & NFT tokenized community platform
Jump to navigation Jump to search
(Updated the steps in the guide and drafted different guides for different platform (Android and iOS))
 
(2 intermediate revisions by the same user not shown)
Line 38: Line 38:
# <code>'''cd ethora/client-reactnative/'''</code>: This command moves into the <code>client-reactnative</code> directory within the cloned repository. This is the root directory of the React Native application.
# <code>'''cd ethora/client-reactnative/'''</code>: This command moves into the <code>client-reactnative</code> directory within the cloned repository. This is the root directory of the React Native application.
# <code>'''npm i react-native-rename'''</code>: This installs the <code>react-native-rename</code> package, which is used to rename the React Native app easily. The package will be installed locally in the project directory.
# <code>'''npm i react-native-rename'''</code>: This installs the <code>react-native-rename</code> package, which is used to rename the React Native app easily. The package will be installed locally in the project directory.
# <code>'''npx react-native-rename@latest "your_app_name" -b "com.yourappname"'''</code>: This renames the React Native app to <code>[your_app_name]</code> and changes the package name (bundle identifier) to <code>"com.yourappname"</code>. You should replace <code>[your_app_name]</code> with your desired app name and update <code>"com.yourappname"</code> to a unique identifier for your app. The package name is an important identifier for Android apps, and it should be unique to avoid conflicts when publishing the app to the Google Play Store.
# <code>'''npx [/cdn-cgi/l/email-protection <nowiki>[email protected]</nowiki>] "your_app_name" -b "com.yourappname"'''</code>: This renames the React Native app to <code>[your_app_name]</code> and changes the package name (bundle identifier) to <code>"com.yourappname"</code>. You should replace <code>[your_app_name]</code> with your desired app name and update <code>"com.yourappname"</code> to a unique identifier for your app. The package name is an important identifier for Android apps, and it should be unique to avoid conflicts when publishing the app to the Google Play Store.
# <code>'''yarn'''</code>: This command installs the project dependencies using Yarn. It reads the <code>package.json</code> file and installs all the required packages for the React Native project.
# <code>'''yarn'''</code>: This command installs the project dependencies using Yarn. It reads the <code>package.json</code> file and installs all the required packages for the React Native project.
# <code>'''find and replace com.ethora with com.yourappname throughout the entire project directory'''</code>: This step involves manually searching for the string <code>"com.ethora"</code> in the entire project directory and replacing it with <code>"com.yourappname"</code>. This is necessary because some files may contain the old package name, and it needs to be updated to the new one.
# <code>'''find and replace com.ethora with com.yourappname throughout the entire project directory'''</code>: This step involves manually searching for the string <code>"com.ethora"</code> in the entire project directory and replacing it with <code>"com.yourappname"</code>. This is necessary because some files may contain the old package name, and it needs to be updated to the new one.
# <code>'''yarn android / npm run android'''</code>: This command builds the Android app and runs it on an Android device or emulator. It bundles the JavaScript code and compiles the native code required for the Android platform. Once the build is successful, it deploys the app to the connected Android device or emulator.
# <code>'''yarn android / npm run android'''</code>: This command builds the Android app and runs it on an Android device or emulator. It bundles the JavaScript code and compiles the native code required for the Android platform. Once the build is successful, it deploys the app to the connected Android device or emulator.
</blockquote>These steps allow you to create a white-labeled version of the Ethora React Native app, with a new name and package name that can be used for branding and distribution as a separate app. Keep in mind that while the steps provided are generally applicable, specific issues or variations may arise depending on the complexity of the project, version of dependencies, or the system you are working on.
</blockquote>These steps allow you to create a white-labeled version of the Ethora React Native app, with a new name and package name that can be used for branding and distribution as a separate app. Keep in mind that while the steps provided are generally applicable, specific issues or variations may arise depending on the complexity of the project, version of dependencies, or the system you are working on.
=== Video Guide: Build Android app using Ethora engine ===
<youtube>wKDVV_Ly0Pg</youtube>


You'll find all the options for the modification in the <code>'''docs/config.ts'''</code> for you to continue building your own product with ethora engine.
You'll find all the options for the modification in the <code>'''docs/config.ts'''</code> for you to continue building your own product with ethora engine.
'''NOTE''': If you're not using M1 chipset mac machine then remove the line <code>'''__apply_Xcode_12_5_M1_post_install_workaround(installer)'''</code> from '''Podfile.'''
'''NOTE''': If you're not using M1 chipset mac machine then remove the line <code>'''__apply_Xcode_12_5_M1_post_install_workaround(installer)'''</code> from '''Podfile.'''
== Steps to build white-labelled Android app using Ethora ==
== Steps to build white-labelled iOS app using Ethora ==
<blockquote>
<blockquote>
# <code>'''mkdir [your_app_name]'''</code>: This command creates a new directory (folder) with the name <code>[your_app_name]</code>. Replace <code>[your_app_name]</code> with the desired name of your app.
# <code>'''mkdir [your_app_name]'''</code>: This command creates a new directory (folder) with the name <code>[your_app_name]</code>. Replace <code>[your_app_name]</code> with the desired name of your app.
Line 54: Line 55:
# <code>'''cd ethora/client-reactnative/'''</code>: This command moves into the <code>client-reactnative</code> directory within the cloned repository. This is the root directory of the React Native application.
# <code>'''cd ethora/client-reactnative/'''</code>: This command moves into the <code>client-reactnative</code> directory within the cloned repository. This is the root directory of the React Native application.
# <code>'''npm i react-native-rename'''</code>: This installs the <code>react-native-rename</code> package, which is used to rename the React Native app easily. The package will be installed locally in the project directory.
# <code>'''npm i react-native-rename'''</code>: This installs the <code>react-native-rename</code> package, which is used to rename the React Native app easily. The package will be installed locally in the project directory.
# <code>'''npx react-native-rename@latest "your_app_name" -b "com.yourappname"'''</code>: This renames the React Native app to <code>[your_app_name]</code> and changes the package name (bundle identifier) to <code>"com.yourappname"</code>. You should replace <code>[your_app_name]</code> with your desired app name and update <code>"com.yourappname"</code> to a unique identifier for your app. The bundle identifier is a unique identifier for iOS apps, and it needs to be changed to avoid conflicts when distributing the app on the App Store.
# <code>'''npx [/cdn-cgi/l/email-protection <nowiki>[email protected]</nowiki>] "your_app_name" -b "com.yourappname"'''</code>: This renames the React Native app to <code>[your_app_name]</code> and changes the package name (bundle identifier) to <code>"com.yourappname"</code>. You should replace <code>[your_app_name]</code> with your desired app name and update <code>"com.yourappname"</code> to a unique identifier for your app. The bundle identifier is a unique identifier for iOS apps, and it needs to be changed to avoid conflicts when distributing the app on the App Store.
# <code>'''cd ios'''</code>: This command moves into the <code>ios</code> directory, which contains iOS-specific files and configuration for the React Native app.
# <code>'''cd ios'''</code>: This command moves into the <code>ios</code> directory, which contains iOS-specific files and configuration for the React Native app.
# <code>'''pod install'''</code>: This command installs the CocoaPods dependencies for the iOS project. CocoaPods is a dependency manager for iOS projects, and it is used to install and manage native dependencies for React Native projects.
# <code>'''pod install'''</code>: This command installs the CocoaPods dependencies for the iOS project. CocoaPods is a dependency manager for iOS projects, and it is used to install and manage native dependencies for React Native projects.
# <code>'''cd ..'''</code>: This command goes back to the previous directory (<code>/ethora/client-reactnative/</code>) from the <code>ios</code> directory.
# <code>'''cd ..'''</code>: This command goes back to the previous directory (<code>/ethora/client-reactnative/</code>) from the <code>ios</code> directory.
# <code>'''open xcode and choose "Open existing project"; select the ios folder located in /[your_app_name]/ethora/client-reactnative/'''</code>: This step opens Xcode and allows you to open the iOS project of your React Native app. Navigate to the <code>ios</code> folder within your <code>[your_app_name]</code> directory, and select the Xcode project file (with a .xcodeproj extension) to open it.
# <code>'''open xcode and choose "Open existing project"; select the ios folder located in /[your_app_name]/ethora/client-reactnative/'''</code>: This step opens Xcode and allows you to open the iOS project of your React Native app. Navigate to the <code>ios</code> folder within your <code>[your_app_name]</code> directory, and select the Xcode project file (with a .xcodeproj extension) to open it.
# <code>'''Navigate to ios/[your_app_name]/AppDelegate.mm and search for the keyword "ethora"'''</code>: In this step, you need to modify the <code>AppDelegate.mm</code> file in Xcode. Search for the keyword "ethora" and replace it with your actual app name in the following line of code: <code>UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"your_app_name", nil);</code>
# <code>'''Navigate to ios/[your_app_name]/AppDelegate.mm and search for the keyword "ethora"'''</code>: In this step, you need to modify the <code>AppDelegate.mm</code> file in Xcode. Search for the keyword "ethora" and replace it with your actual app name in the following line of code: <code>UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"your_app_name", nil);</code>
# '''Click on "Build" button'''; iOS emulator will run once the build is finished, and in the terminal, Metro Bundler will start bundling. '''NOTE''': This step mentions that the process will likely fail, and it recommends running "npm start" from your previous terminal or directly from the code editor's terminal at /ethora/client-reactnative/ directory to avoid any failures. Running "npm start" launches the Metro Bundler, which is responsible for bundling JavaScript code for the React Native app. By following these steps, you will be able to create a white-labeled version of the Ethora React Native app with a new name and bundle identifier, suitable for running on iOS devices and potentially distributing through the App Store. Please note that specific issues or variations may occur based on the complexity of the project, version of dependencies, or the Xcode environment you are using.
# '''Click on "Build" button'''; iOS emulator will run once the build is finished, and in the terminal, Metro Bundler will start bundling. '''NOTE''': This step mentions that the process will likely fail, and it recommends running "npm start" from your previous terminal or directly from the code editor's terminal at /ethora/client-reactnative/ directory to avoid any failures. Running "npm start" launches the Metro Bundler, which is responsible for bundling JavaScript code for the React Native app. By following these steps, you will be able to create a white-labeled version of the Ethora React Native app with a new name and bundle identifier, suitable for running on iOS devices and potentially distributing through the App Store. Please note that specific issues or variations may occur based on the complexity of the project, version of dependencies, or the Xcode environment you are using.
</blockquote>
</blockquote>
 
=== Video Guide: Build iOS app using Ethora engine ===
<youtube>Mm8MBWRXACU</youtube>
== Troubleshooting: Android ==
== Troubleshooting: Android ==
=== Can't run the build on the physical device ===
=== Can't run the build on the physical device ===

Latest revision as of 13:10, 7 August 2023

Introduction

Expected result

By following this guide you will build your own mobile app (iOS, Android or both) with all Ethora engine features (alternatively you may choose to disable / limit some features via Config file).

In the process you will specify your own name and do a basic branding (logo, colours).

How long does it take?

A) It takes just 0.5h for a React Native engineer experienced with Ethora engine to produce a new app build.

B) A React Native engineer without previous Ethora experience should be able to complete it within around 1 work day.

C) You may need a 2-3 work days if you have done some software development but you don't have much experience with React Native.

In any case, it would take not less than 4-6 months for a team of experienced software engineers to develop a new app for your project with similar qualities and a feature set of Ethora engine. So irrespective of the option above, you are going to be saving a ton of time and investment by building on top of it.

Note: whilst Ethora can be called a "no-code" or a "low-code" product and we encourage you to use the product as is, some projects would opt for an advanced customization. Such as adding new screens, features, custom backend integrations or chat bots etc. You might need to allocate 1-2 months or more if you plan to add new functionality on top of Ethora engine, depending on the extent of additional functionalities and modifications.

Make sure to check the Config file first to see if the changes you want are not covered by parameters and switches there.

Pre-requisites

You are expected to have your system set up already for React Native development for either iOS or Android, or both.

If you don't have that setup yet, you will need to install the required packages, such as:

Note for vscode users: if you use Visual Studio Code, we personally recommend installing the following extensions to make your life better/easier:

  • React native snippet
  • Gitlens
  • Color highlight
  • Prettier

Steps to build white-labelled Android app using Ethora

  1. mkdir [your_app_name]: This command creates a new directory (folder) with the name [your_app_name]. Replace [your_app_name] with the desired name of your app.
  2. cd [your_app_name]: This command navigates into the newly created directory, making it the current working directory.
  3. git clone https://github.com/dappros/ethora.git: This command clones the Ethora GitHub repository into your newly created [your_app_name] directory. It downloads all the code and files from the repository to your local machine.
  4. cd ethora/client-reactnative/: This command moves into the client-reactnative directory within the cloned repository. This is the root directory of the React Native application.
  5. npm i react-native-rename: This installs the react-native-rename package, which is used to rename the React Native app easily. The package will be installed locally in the project directory.
  6. npx [/cdn-cgi/l/email-protection [email protected]] "your_app_name" -b "com.yourappname": This renames the React Native app to [your_app_name] and changes the package name (bundle identifier) to "com.yourappname". You should replace [your_app_name] with your desired app name and update "com.yourappname" to a unique identifier for your app. The package name is an important identifier for Android apps, and it should be unique to avoid conflicts when publishing the app to the Google Play Store.
  7. yarn: This command installs the project dependencies using Yarn. It reads the package.json file and installs all the required packages for the React Native project.
  8. find and replace com.ethora with com.yourappname throughout the entire project directory: This step involves manually searching for the string "com.ethora" in the entire project directory and replacing it with "com.yourappname". This is necessary because some files may contain the old package name, and it needs to be updated to the new one.
  9. yarn android / npm run android: This command builds the Android app and runs it on an Android device or emulator. It bundles the JavaScript code and compiles the native code required for the Android platform. Once the build is successful, it deploys the app to the connected Android device or emulator.

These steps allow you to create a white-labeled version of the Ethora React Native app, with a new name and package name that can be used for branding and distribution as a separate app. Keep in mind that while the steps provided are generally applicable, specific issues or variations may arise depending on the complexity of the project, version of dependencies, or the system you are working on.

Video Guide: Build Android app using Ethora engine

You'll find all the options for the modification in the docs/config.ts for you to continue building your own product with ethora engine. NOTE: If you're not using M1 chipset mac machine then remove the line __apply_Xcode_12_5_M1_post_install_workaround(installer) from Podfile.

Steps to build white-labelled iOS app using Ethora

  1. mkdir [your_app_name]: This command creates a new directory (folder) with the name [your_app_name]. Replace [your_app_name] with the desired name of your app.
  2. cd [your_app_name]: This command navigates into the newly created directory, making it the current working directory.
  3. git clone https://github.com/dappros/ethora.git: This command clones the Ethora GitHub repository into your newly created [your_app_name] directory. It downloads all the code and files from the repository to your local machine.
  4. cd ethora/client-reactnative/: This command moves into the client-reactnative directory within the cloned repository. This is the root directory of the React Native application.
  5. npm i react-native-rename: This installs the react-native-rename package, which is used to rename the React Native app easily. The package will be installed locally in the project directory.
  6. npx [/cdn-cgi/l/email-protection [email protected]] "your_app_name" -b "com.yourappname": This renames the React Native app to [your_app_name] and changes the package name (bundle identifier) to "com.yourappname". You should replace [your_app_name] with your desired app name and update "com.yourappname" to a unique identifier for your app. The bundle identifier is a unique identifier for iOS apps, and it needs to be changed to avoid conflicts when distributing the app on the App Store.
  7. cd ios: This command moves into the ios directory, which contains iOS-specific files and configuration for the React Native app.
  8. pod install: This command installs the CocoaPods dependencies for the iOS project. CocoaPods is a dependency manager for iOS projects, and it is used to install and manage native dependencies for React Native projects.
  9. cd ..: This command goes back to the previous directory (/ethora/client-reactnative/) from the ios directory.
  10. open xcode and choose "Open existing project"; select the ios folder located in /[your_app_name]/ethora/client-reactnative/: This step opens Xcode and allows you to open the iOS project of your React Native app. Navigate to the ios folder within your [your_app_name] directory, and select the Xcode project file (with a .xcodeproj extension) to open it.
  11. Navigate to ios/[your_app_name]/AppDelegate.mm and search for the keyword "ethora": In this step, you need to modify the AppDelegate.mm file in Xcode. Search for the keyword "ethora" and replace it with your actual app name in the following line of code: UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"your_app_name", nil);
  12. Click on "Build" button; iOS emulator will run once the build is finished, and in the terminal, Metro Bundler will start bundling. NOTE: This step mentions that the process will likely fail, and it recommends running "npm start" from your previous terminal or directly from the code editor's terminal at /ethora/client-reactnative/ directory to avoid any failures. Running "npm start" launches the Metro Bundler, which is responsible for bundling JavaScript code for the React Native app. By following these steps, you will be able to create a white-labeled version of the Ethora React Native app with a new name and bundle identifier, suitable for running on iOS devices and potentially distributing through the App Store. Please note that specific issues or variations may occur based on the complexity of the project, version of dependencies, or the Xcode environment you are using.

Video Guide: Build iOS app using Ethora engine

Troubleshooting: Android

Can't run the build on the physical device

Enable the "Developer options" menu by going to Settings → About phone → Software information and then tapping the Build number row at the bottom seven times. You can then go back to Settings → Developer options to enable "USB debugging".

Note: enabling "Developer options" may vary across devices / OS versions. Google the instructions for yours.

Note: sometimes you need to enable multiple options, for example in my case I needed to enable these 3:

  • USB debugging
  • Install via USB
  • USB debugging (Security settings)

Things don't update

If you changed some asset like a logo or background image, launch and see the old one (or see image is gone) the culprit could be the cache. To troubleshoot:

  1. Kill the node server (just close your terminal tab where node/metro is running)
  2. Open a new terminal (in vs code or a new terminal window in the same project folder) and run this command: yarn start --reset-cache
  3. Build again ("yarn android").