Skip to content

Add contacts import nitro module #54459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
bf0ca57
Merge branch 'main' of https://github.com/Expensify/App
perunt Dec 23, 2024
7a548c8
Revert "Revert "Revert "Revert "Contacts import(51018)""""
perunt Dec 23, 2024
6f1e3da
bump nitro
perunt Jan 6, 2025
7abab7e
modify HybridContactsModule
perunt Jan 6, 2025
434a9f9
generate specs
perunt Jan 6, 2025
e704e6b
Merge branch '@perunt/rerevert-contacts-import-module' of https://git…
perunt Jan 6, 2025
fce6f6b
lint
perunt Jan 6, 2025
9f0acad
Merge branch '@perunt/rerevert-contacts-import-module' of https://git…
perunt Jan 10, 2025
1d85e9a
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Jan 10, 2025
7c8fc7f
fix android
perunt Jan 10, 2025
924ce0e
import
perunt Jan 13, 2025
9be4449
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Jan 13, 2025
40ab11f
typecheck
perunt Jan 13, 2025
524fdec
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Jan 16, 2025
4ad7f0b
bump nitro to 0.21.0
perunt Jan 16, 2025
be5e87a
Merge branch 'main'
perunt Jan 16, 2025
d54e954
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Feb 20, 2025
27c0243
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Feb 20, 2025
ab4e4b5
lint
perunt Feb 21, 2025
3ed4384
fix: new eslint rules
perunt Feb 21, 2025
3a7122d
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Mar 18, 2025
15c0c9c
bump nitro
perunt Mar 24, 2025
0841825
use one tsconfig
perunt Mar 24, 2025
087cfaa
remove node modules from nitro module
perunt Mar 24, 2025
45be028
clean tsconfig
perunt Mar 24, 2025
ac69b81
codegen
perunt Mar 24, 2025
6179f6d
fix: Nitro breaking changes
perunt Mar 24, 2025
defe8e9
move from interface to type
perunt Mar 26, 2025
22bb0fa
rename
perunt Mar 26, 2025
3bd8809
specs + add empty module
perunt Mar 26, 2025
fbdba00
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Mar 26, 2025
2010959
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Mar 27, 2025
2caedc0
rename to ExpensifyNitroUtils
perunt Mar 27, 2025
73e62fd
fix cpp adapter
perunt Mar 27, 2025
320b3d9
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Mar 28, 2025
68c1f72
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Mar 31, 2025
e1b14b0
clean spec
perunt Apr 1, 2025
ee672e4
ашч context
perunt Apr 1, 2025
a4b5bd5
lint
perunt Apr 1, 2025
3422a85
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Apr 1, 2025
8862d5b
fix tsconfig
perunt Apr 2, 2025
c68a372
clean podfile
perunt Apr 2, 2025
c27b93c
clean gitignore
perunt Apr 2, 2025
f8646ff
use java 17
perunt Apr 2, 2025
37cdd4b
clean
perunt Apr 2, 2025
bd9c456
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Apr 8, 2025
f873d1d
podfile checksum
perunt Apr 8, 2025
75ebc09
change buildConfiguration
perunt Apr 9, 2025
ffceb88
add types
perunt Apr 16, 2025
e9274cd
rename
perunt Apr 21, 2025
dcaa5a0
update requestContactPermission in HybridContactsModule(kotlin)
perunt Apr 21, 2025
d86b2f8
move projection to const
perunt Apr 21, 2025
c8cd538
use CONTACT_FIELDS
perunt Apr 21, 2025
dd0a20c
refactor: improve code readability with early returns and static cons…
perunt Apr 21, 2025
95faeb2
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Apr 21, 2025
c827792
lint: export types
perunt Apr 22, 2025
e776c07
chore: resolve eslint errors triggered by merge conflict resolution
perunt Apr 22, 2025
ec4dec3
chore: fix useOnyx linter errors by adding canBeMissing parameters
perunt Apr 22, 2025
1940b44
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Apr 22, 2025
5a30f42
lint
perunt Apr 22, 2025
6583a01
fix AvatarSource type compatibility issues
perunt Apr 22, 2025
85a5f81
chore: fix useOnyx linter errors by adding canBeMissing parameters af…
perunt Apr 22, 2025
1ff99a0
use import type
perunt Apr 22, 2025
833f23a
adjust kotlin file
perunt Apr 22, 2025
280d84d
use better naming
perunt Apr 23, 2025
956c5b2
clean package file
perunt Apr 23, 2025
0d620a1
add explanations for ` @inline(__always)`
perunt Apr 23, 2025
2beeb99
rename callback
perunt Apr 23, 2025
74f1e9b
change name of allReportNameValuePairs due to conflicts
perunt Apr 23, 2025
8e9e278
Merge branch 'main' of https://github.com/Expensify/App into @perunt/…
perunt Apr 23, 2025
af5fcc6
rename to `@expensify/nitro-utils`
perunt Apr 23, 2025
fc36ad1
refactor import/export
perunt Apr 25, 2025
5582bd8
fix type
perunt Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ web/gtm.js
src/libs/SearchParser/searchParser.js
src/libs/SearchParser/autocompleteParser.js
help/_scripts/**
modules/**
Mobile-Expensify/**
1 change: 1 addition & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Add any project specific keep options here:
-keep class com.expensify.chat.BuildConfig { *; }
-keep class com.facebook.** { *; }
-keep class com.margelo.nitro.** { *; }
-keep, allowoptimization, allowobfuscation class expo.modules.** { *; }

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
308 changes: 155 additions & 153 deletions ios/NewExpensify.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "ReleaseProduction"
buildConfiguration = "DebugDevelopment"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ prepare_react_native_project!

setup_permissions([
'Camera',
'Contacts',
'LocationAccuracy',
'LocationAlways',
'LocationWhenInUse'
Expand Down
55 changes: 54 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,29 @@ PODS:
- nanopb/encode (= 2.30908.0)
- nanopb/decode (2.30908.0)
- nanopb/encode (2.30908.0)
- NitroModules (0.25.2):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.11.18.00)
- RCTRequired
- RCTTypeSafety
- React-callinvoker
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-jsi
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- NWWebSocket (0.5.4)
- Onfido (29.7.2)
- onfido-react-native-sdk (10.6.0):
Expand Down Expand Up @@ -2860,6 +2883,28 @@ PODS:
- SocketRocket (0.7.1)
- Turf (2.8.0)
- TweetNacl (1.0.2)
- UtilsModule (0.0.1):
- DoubleConversion
- glog
- hermes-engine
- NitroModules
- RCT-Folly (= 2024.11.18.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- VisionCamera (4.6.1):
- VisionCamera/Core (= 4.6.1)
- VisionCamera/React (= 4.6.1)
Expand Down Expand Up @@ -2891,6 +2936,7 @@ DEPENDENCIES:
- GzipSwift
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- lottie-react-native (from `../node_modules/lottie-react-native`)
- NitroModules (from `../node_modules/react-native-nitro-modules`)
- "onfido-react-native-sdk (from `../node_modules/@onfido/react-native-sdk`)"
- "pusher-websocket-react-native (from `../node_modules/@pusher/pusher-websocket-react-native`)"
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
Expand Down Expand Up @@ -2998,6 +3044,7 @@ DEPENDENCIES:
- RNShare (from `../node_modules/react-native-share`)
- RNSound (from `../node_modules/react-native-sound`)
- RNSVG (from `../node_modules/react-native-svg`)
- UtilsModule (from `../modules/ExpensifyNitroUtils`)
- VisionCamera (from `../node_modules/react-native-vision-camera`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

Expand Down Expand Up @@ -3088,6 +3135,8 @@ EXTERNAL SOURCES:
:tag: hermes-2024-11-25-RNv0.77.0-d4f25d534ab744866448b36ca3bf3d97c08e638c
lottie-react-native:
:path: "../node_modules/lottie-react-native"
NitroModules:
:path: "../node_modules/react-native-nitro-modules"
onfido-react-native-sdk:
:path: "../node_modules/@onfido/react-native-sdk"
pusher-websocket-react-native:
Expand Down Expand Up @@ -3298,6 +3347,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-sound"
RNSVG:
:path: "../node_modules/react-native-svg"
UtilsModule:
:path: "../modules/ExpensifyNitroUtils"
VisionCamera:
:path: "../node_modules/react-native-vision-camera"
Yoga:
Expand Down Expand Up @@ -3358,6 +3409,7 @@ SPEC CHECKSUMS:
MapboxMaps: 05822ab0ee74f7d626e6471572439afe35c1c116
MapboxMobileEvents: d044b9edbe0ec7df60f6c2c9634fe9a7f449266b
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
NitroModules: 6cad985fa4a6efaf567fe5c9aa464bce17e2d0cc
NWWebSocket: 040d22f23438cc09aaeabf537beff67699c3c76d
Onfido: f3af62ea1c9a419589c133e3e511e5d2c4f3f8af
onfido-react-native-sdk: 1b8abe574234b86a592d7efb4eeada715709e23b
Expand Down Expand Up @@ -3475,9 +3527,10 @@ SPEC CHECKSUMS:
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Turf: aa2ede4298009639d10db36aba1a7ebaad072a5e
TweetNacl: 3abf4d1d2082b0114e7a67410e300892448951e6
UtilsModule: f44e5326c5b8fd69a2b418c102da13b77d295073
VisionCamera: c95a8ad535f527562be1fb05fb2fd324578e769c
Yoga: 1fd059161b449018342943b095a6d4e69bcaa719

PODFILE CHECKSUM: 5b2f0a75a0848d964701b52fb6ab7e9602040f3e
PODFILE CHECKSUM: 34b60156d56d02023f0cbadc0c861335554ca7f5

COCOAPODS: 1.15.2
70 changes: 70 additions & 0 deletions modules/ExpensifyNitroUtils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Expo
.expo/

# Turborepo
.turbo/

# generated by bob
lib/
1 change: 1 addition & 0 deletions modules/ExpensifyNitroUtils/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
29 changes: 29 additions & 0 deletions modules/ExpensifyNitroUtils/UtilsModule.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "UtilsModule"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]

s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/mrousavy/nitro.git", :tag => "#{s.version}" }

s.source_files = [
# Implementation (Swift)
"ios/**/*.{swift}",
# Autolinking/Registration (Objective-C++)
"ios/**/*.{m,mm}",
# Implementation (C++ objects)
"cpp/**/*.{hpp,cpp}",
]

load 'nitrogen/generated/ios/UtilsModule+autolinking.rb'
add_nitrogen_files(s)

install_modules_dependencies(s)
end
29 changes: 29 additions & 0 deletions modules/ExpensifyNitroUtils/android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project(UtilsModule)
cmake_minimum_required(VERSION 3.9.0)

set (PACKAGE_NAME UtilsModule)
set (CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_STANDARD 20)

# Define C++ library and add all sources
add_library(${PACKAGE_NAME} SHARED
src/main/cpp/cpp-adapter.cpp
)

# Add Nitrogen specs :)
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/UtilsModule+autolinking.cmake)

# Set up local includes
include_directories(
"src/main/cpp"
"../cpp"
)

find_library(LOG_LIB log)

# Link all libraries together
target_link_libraries(
${PACKAGE_NAME}
${LOG_LIB}
android # <-- Android core
)
Loading
Loading