Skip to content

Commit 13a4f75

Browse files
authored
Feat/wa clone main 10 22 (#57)
* fix: fixes white screen of death on start * chore: upgrading RN and React * fix: navigating to the correct channel * fix: navigating warning double name
1 parent 2828a34 commit 13a4f75

41 files changed

Lines changed: 2053 additions & 2523 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

projects/WhatsAppClone/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ DerivedData
2323

2424
# Android/IntelliJ
2525
#
26-
build/
2726
.idea
2827
.gradle
2928
local.properties
3029
*.iml
3130
*.hprof
31+
.cxx/
3232

3333
# node.js
3434
#

projects/WhatsAppClone/Gemfile.lock

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@ GEM
33
specs:
44
CFPropertyList (3.0.5)
55
rexml
6-
activesupport (6.1.6.1)
6+
activesupport (6.1.7)
77
concurrent-ruby (~> 1.0, >= 1.0.2)
88
i18n (>= 1.6, < 2)
99
minitest (>= 5.1)
1010
tzinfo (~> 2.0)
1111
zeitwerk (~> 2.3)
12-
addressable (2.8.0)
13-
public_suffix (>= 2.0.2, < 5.0)
12+
addressable (2.8.1)
13+
public_suffix (>= 2.0.2, < 6.0)
1414
algoliasearch (1.27.5)
1515
httpclient (~> 2.8, >= 2.8.3)
1616
json (>= 1.5.1)
1717
artifactory (3.0.15)
1818
atomos (0.1.3)
1919
aws-eventstream (1.2.0)
20-
aws-partitions (1.605.0)
21-
aws-sdk-core (3.131.2)
20+
aws-partitions (1.649.0)
21+
aws-sdk-core (3.164.0)
2222
aws-eventstream (~> 1, >= 1.0.2)
2323
aws-partitions (~> 1, >= 1.525.0)
2424
aws-sigv4 (~> 1.1)
2525
jmespath (~> 1, >= 1.6.1)
26-
aws-sdk-kms (1.57.0)
26+
aws-sdk-kms (1.58.0)
2727
aws-sdk-core (~> 3, >= 3.127.0)
2828
aws-sigv4 (~> 1.1)
29-
aws-sdk-s3 (1.114.0)
29+
aws-sdk-s3 (1.116.0)
3030
aws-sdk-core (~> 3, >= 3.127.0)
3131
aws-sdk-kms (~> 1)
3232
aws-sigv4 (~> 1.4)
33-
aws-sigv4 (1.5.0)
33+
aws-sigv4 (1.5.2)
3434
aws-eventstream (~> 1, >= 1.0.2)
3535
babosa (1.0.4)
3636
claide (1.1.0)
@@ -81,13 +81,13 @@ GEM
8181
rake (>= 12.0.0, < 14.0.0)
8282
domain_name (0.5.20190701)
8383
unf (>= 0.0.5, < 1.0.0)
84-
dotenv (2.7.6)
84+
dotenv (2.8.1)
8585
emoji_regex (3.2.3)
8686
escape (0.0.4)
8787
ethon (0.15.0)
8888
ffi (>= 1.15.0)
89-
excon (0.92.3)
90-
faraday (1.10.0)
89+
excon (0.93.1)
90+
faraday (1.10.2)
9191
faraday-em_http (~> 1.0)
9292
faraday-em_synchrony (~> 1.0)
9393
faraday-excon (~> 1.1)
@@ -116,7 +116,7 @@ GEM
116116
faraday_middleware (1.2.0)
117117
faraday (~> 1.0)
118118
fastimage (2.2.6)
119-
fastlane (2.207.0)
119+
fastlane (2.210.1)
120120
CFPropertyList (>= 2.3, < 4.0.0)
121121
addressable (>= 2.8, < 3.0.0)
122122
artifactory (~> 3.0)
@@ -155,17 +155,17 @@ GEM
155155
xcodeproj (>= 1.13.0, < 2.0.0)
156156
xcpretty (~> 0.3.0)
157157
xcpretty-travis-formatter (>= 0.0.3)
158-
fastlane-plugin-firebase_app_distribution (0.3.4)
158+
fastlane-plugin-firebase_app_distribution (0.3.7)
159159
fastlane-plugin-increment_version_code (0.4.3)
160160
fastlane-plugin-increment_version_name (0.0.10)
161161
fastlane-plugin-load_json (0.0.1)
162162
ffi (1.15.5)
163163
fourflusher (2.3.1)
164164
fuzzy_match (2.0.4)
165165
gh_inspector (1.1.3)
166-
google-apis-androidpublisher_v3 (0.25.0)
167-
google-apis-core (>= 0.7, < 2.a)
168-
google-apis-core (0.7.0)
166+
google-apis-androidpublisher_v3 (0.29.0)
167+
google-apis-core (>= 0.9.0, < 2.a)
168+
google-apis-core (0.9.1)
169169
addressable (~> 2.5, >= 2.5.1)
170170
googleauth (>= 0.16.2, < 2.a)
171171
httpclient (>= 2.8.1, < 3.a)
@@ -174,27 +174,27 @@ GEM
174174
retriable (>= 2.0, < 4.a)
175175
rexml
176176
webrick
177-
google-apis-iamcredentials_v1 (0.13.0)
178-
google-apis-core (>= 0.7, < 2.a)
179-
google-apis-playcustomapp_v1 (0.10.0)
180-
google-apis-core (>= 0.7, < 2.a)
181-
google-apis-storage_v1 (0.18.0)
182-
google-apis-core (>= 0.7, < 2.a)
177+
google-apis-iamcredentials_v1 (0.15.0)
178+
google-apis-core (>= 0.9.0, < 2.a)
179+
google-apis-playcustomapp_v1 (0.12.0)
180+
google-apis-core (>= 0.9.1, < 2.a)
181+
google-apis-storage_v1 (0.19.0)
182+
google-apis-core (>= 0.9.0, < 2.a)
183183
google-cloud-core (1.6.0)
184184
google-cloud-env (~> 1.0)
185185
google-cloud-errors (~> 1.0)
186186
google-cloud-env (1.6.0)
187187
faraday (>= 0.17.3, < 3.0)
188-
google-cloud-errors (1.2.0)
189-
google-cloud-storage (1.37.0)
188+
google-cloud-errors (1.3.0)
189+
google-cloud-storage (1.43.0)
190190
addressable (~> 2.8)
191191
digest-crc (~> 0.4)
192192
google-apis-iamcredentials_v1 (~> 0.1)
193-
google-apis-storage_v1 (~> 0.1)
193+
google-apis-storage_v1 (~> 0.19.0)
194194
google-cloud-core (~> 1.6)
195195
googleauth (>= 0.16.2, < 2.a)
196196
mini_mime (~> 1.0)
197-
googleauth (1.2.0)
197+
googleauth (1.3.0)
198198
faraday (>= 0.17.3, < 3.a)
199199
jwt (>= 1.4, < 3.0)
200200
memoist (~> 0.16)
@@ -209,11 +209,11 @@ GEM
209209
concurrent-ruby (~> 1.0)
210210
jmespath (1.6.1)
211211
json (2.6.2)
212-
jwt (2.4.1)
212+
jwt (2.5.0)
213213
memoist (0.16.2)
214214
mini_magick (4.11.0)
215215
mini_mime (1.1.2)
216-
minitest (5.16.2)
216+
minitest (5.16.3)
217217
molinillo (0.8.0)
218218
multi_json (1.15.0)
219219
multipart-post (2.0.0)
@@ -255,7 +255,7 @@ GEM
255255
tty-cursor (~> 0.7)
256256
typhoeus (1.4.0)
257257
ethon (>= 0.9.0)
258-
tzinfo (2.0.4)
258+
tzinfo (2.0.5)
259259
concurrent-ruby (~> 1.0)
260260
uber (0.1.0)
261261
unf (0.1.4)
@@ -275,7 +275,7 @@ GEM
275275
rouge (~> 2.0.7)
276276
xcpretty-travis-formatter (1.0.1)
277277
xcpretty (~> 0.2, >= 0.0.7)
278-
zeitwerk (2.6.0)
278+
zeitwerk (2.6.1)
279279

280280
PLATFORMS
281281
ruby
@@ -292,4 +292,4 @@ RUBY VERSION
292292
ruby 2.7.5p203
293293

294294
BUNDLED WITH
295-
2.1.4
295+
2.3.21

projects/WhatsAppClone/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,9 @@ Follow the next steps to ensure WhatsApp's behaviour.
136136
- Transition animations in several components/buttons
137137
- Video and/or voice call support
138138
- Consider date-fns over Moment JS (became legacy)
139+
140+
141+
### Issues
142+
~~1. Crash on android when playing audio message~~
143+
2. navigaton to channel list screen is going to previous clicked channel
144+
3.

projects/WhatsAppClone/android/app/build.gradle

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: "com.android.application"
22

33
import com.android.build.OutputFile
4-
4+
import org.apache.tools.ant.taskdefs.condition.Os
55
/**
66
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
77
* and bundleReleaseJsAndAssets).
@@ -78,7 +78,7 @@ import com.android.build.OutputFile
7878
*/
7979

8080
project.ext.react = [
81-
enableHermes: false, // clean and rebuild if changing
81+
enableHermes: true, // clean and rebuild if changing
8282
]
8383

8484
apply from: "../../node_modules/react-native/react.gradle"
@@ -142,23 +142,13 @@ android {
142142
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
143143

144144
if (isNewArchitectureEnabled()) {
145-
// We configure the NDK build only if you decide to opt-in for the New Architecture.
146-
externalNativeBuild {
147-
ndkBuild {
148-
arguments "APP_PLATFORM=android-21",
149-
"APP_STL=c++_shared",
150-
"NDK_TOOLCHAIN_VERSION=clang",
151-
"GENERATED_SRC_DIR=$buildDir/generated/source",
152-
"PROJECT_BUILD_DIR=$buildDir",
153-
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
154-
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
155-
"NODE_MODULES_DIR=$rootDir/../node_modules"
156-
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157-
cppFlags "-std=c++17"
158-
// Make sure this target name is the same you specify inside the
159-
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160-
targets "whatsappclone_appmodules"
161-
}
145+
// We configure the CMake build only if you decide to opt-in for the New Architecture.
146+
cmake {
147+
arguments "-DPROJECT_BUILD_DIR=$buildDir",
148+
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
149+
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
150+
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
151+
"-DANDROID_STL=c++_shared"
162152
}
163153
if (!enableSeparateBuildPerCPUArchitecture) {
164154
ndk {
@@ -171,9 +161,9 @@ android {
171161
if (isNewArchitectureEnabled()) {
172162
// We configure the NDK build only if you decide to opt-in for the New Architecture.
173163
externalNativeBuild {
174-
ndkBuild {
175-
path "$projectDir/src/main/jni/Android.mk"
176-
}
164+
cmake {
165+
path "$projectDir/src/main/jni/CMakeLists.txt"
166+
}
177167
}
178168
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
179169
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
@@ -194,15 +184,15 @@ android {
194184
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
195185

196186
// Due to a bug inside AGP, we have to explicitly set a dependency
197-
// between configureNdkBuild* tasks and the preBuild tasks.
187+
// between configureCMakeDebug* tasks and the preBuild tasks.
198188
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
199-
configureNdkBuildRelease.dependsOn(preReleaseBuild)
200-
configureNdkBuildDebug.dependsOn(preDebugBuild)
189+
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
190+
configureCMakeDebug.dependsOn(preDebugBuild)
201191
reactNativeArchitectures().each { architecture ->
202-
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
192+
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
203193
dependsOn("preDebugBuild")
204194
}
205-
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
195+
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
206196
dependsOn("preReleaseBuild")
207197
}
208198
}

projects/WhatsAppClone/android/app/src/main/jni/Android.mk

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
# Define the library name here.
3+
project(whatsappclone_appmodules)
4+
# This file includes all the necessary to let you build your application with the New Architecture.
5+
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)

projects/WhatsAppClone/android/app/src/main/jni/MainApplicationModuleProvider.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#include "MainApplicationModuleProvider.h"
22

3+
#include <rncli.h>
34
#include <rncore.h>
45

56
namespace facebook {
67
namespace react {
78

89
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
9-
const std::string moduleName,
10+
const std::string &moduleName,
1011
const JavaTurboModule::InitParams &params) {
1112
// Here you can provide your own module provider for TurboModules coming from
1213
// either your application or from external libraries. The approach to follow
@@ -17,6 +18,14 @@ std::shared_ptr<TurboModule> MainApplicationModuleProvider(
1718
// return module;
1819
// }
1920
// return rncore_ModuleProvider(moduleName, params);
21+
22+
// Module providers autolinked by RN CLI
23+
auto rncli_module = rncli_ModuleProvider(moduleName, params);
24+
if (rncli_module != nullptr) {
25+
return rncli_module;
26+
}
27+
28+
2029
return rncore_ModuleProvider(moduleName, params);
2130
}
2231

projects/WhatsAppClone/android/app/src/main/jni/MainApplicationModuleProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace facebook {
99
namespace react {
1010

1111
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
12-
const std::string moduleName,
12+
const std::string &moduleName,
1313
const JavaTurboModule::InitParams &params);
1414

1515
} // namespace react

projects/WhatsAppClone/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ void MainApplicationTurboModuleManagerDelegate::registerNatives() {
2222

2323
std::shared_ptr<TurboModule>
2424
MainApplicationTurboModuleManagerDelegate::getTurboModule(
25-
const std::string name,
26-
const std::shared_ptr<CallInvoker> jsInvoker) {
25+
const std::string &name,
26+
const std::shared_ptr<CallInvoker> &jsInvoker) {
2727
// Not implemented yet: provide pure-C++ NativeModules here.
2828
return nullptr;
2929
}
3030

3131
std::shared_ptr<TurboModule>
3232
MainApplicationTurboModuleManagerDelegate::getTurboModule(
33-
const std::string name,
33+
const std::string &name,
3434
const JavaTurboModule::InitParams &params) {
3535
return MainApplicationModuleProvider(name, params);
3636
}
3737

3838
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
39-
std::string name) {
39+
const std::string &name) {
4040
return getTurboModule(name, nullptr) != nullptr ||
4141
getTurboModule(name, {.moduleName = name}) != nullptr;
4242
}

0 commit comments

Comments
 (0)