Skip to content
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

[Wallet] Preliminary iOS support #1098

Merged
merged 35 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
03f871f
WIP
tkporter Aug 15, 2019
9f8f627
Pull from npm
cmcewen Aug 16, 2019
dd84927
WIP
cmcewen Aug 16, 2019
a363590
More WIP
cmcewen Aug 16, 2019
1893bfc
Merge branch 'master' into trevor/ios
cmcewen Aug 16, 2019
771cdf6
WIP
cmcewen Aug 17, 2019
220b83a
Merge branch 'master' into trevor/ios
cmcewen Sep 2, 2019
e933d6f
update podfile
cmcewen Sep 2, 2019
d98083e
Use new npm packages that work
cmcewen Sep 2, 2019
daa3101
Add cocoapods to Gemfile so we all use the same version
jeanregisser Sep 17, 2019
aa9e795
Update react-native-config to simplify integration on iOS
jeanregisser Sep 17, 2019
49a820f
Merge remote-tracking branch 'origin/master' into cmcewen/new-ios
jeanregisser Sep 18, 2019
c7794c7
Use correct geth node dir everywhere
jeanregisser Sep 18, 2019
0db976c
Put back typo to fix protocol test
jeanregisser Sep 18, 2019
7b7cad1
Restore using web3 ipc provider on Android
jeanregisser Sep 18, 2019
77e6a90
Update Podfile.lock
jeanregisser Sep 19, 2019
93a4fc7
Use keychain on iOS
jeanregisser Sep 19, 2019
cc5a439
Implement opening sms app on iOS
jeanregisser Sep 19, 2019
a174fe4
Replacements for SendIntentAndroid on iOS
jeanregisser Sep 19, 2019
2fe8e54
Use latest react-native-geth improvements
jeanregisser Sep 19, 2019
472cad1
Fix tests
jeanregisser Sep 20, 2019
e919bd9
Use latest react-native-geth
jeanregisser Sep 20, 2019
d192f09
Fix RN segment analytics firebase on iOS
jeanregisser Sep 23, 2019
72db0fe
Remove custom patch package which is not needed anymore
jeanregisser Sep 24, 2019
17490b5
Fix clock sync code and remove obsolete react-native-system-clock module
jeanregisser Sep 24, 2019
8d7adfe
Use latest react-native-ntp-client
jeanregisser Sep 24, 2019
299d2b2
Go back to web3 1.0.0-beta.37 since it is working
jeanregisser Sep 24, 2019
a7d41c4
Disable bitcode, geth framework doesn't support it
jeanregisser Sep 24, 2019
83750d3
Fix exception caused by ToastAndroid unavailable on iOS
jeanregisser Sep 25, 2019
1cf4de6
Merge remote-tracking branch 'origin/master' into cmcewen/new-ios
jeanregisser Sep 25, 2019
d1b4a9a
Merge branch 'master' into cmcewen/new-ios
jeanregisser Sep 25, 2019
839ec79
Remove obsolete font references
jeanregisser Sep 25, 2019
2480723
Remove unneeded dummy swift file
jeanregisser Sep 25, 2019
5eaa390
Remove now obsolete file due to the changes in pincode handling
jeanregisser Sep 25, 2019
40c5c66
Update comment
jeanregisser Sep 25, 2019
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build": "yarn run lerna run build",
"report-coverage": "yarn run lerna run test-coverage",
"test:watch": "node node_modules/jest/bin/jest.js --watch",
"postinstall": "yarn run lerna run postinstall && patch-package && sh scripts/custom_patch_packages.sh && yarn keys:decrypt",
"postinstall": "yarn run lerna run postinstall && patch-package && yarn keys:decrypt",
jmrossy marked this conversation as resolved.
Show resolved Hide resolved
"preinstall": "bash scripts/create_key_templates.sh",
"keys:decrypt": "bash scripts/key_placer.sh decrypt",
"keys:encrypt": "bash scripts/key_placer.sh encrypt"
Expand Down Expand Up @@ -66,6 +66,7 @@
"node-gyp": "5.0.1",
"tar": "4.4.10",
"lodash": "4.17.15",
"react-native-ntp-client": "^1.0.0",
"**/codecov/**/js-yaml": "^3.13.1",
"**/deep-extend": "^0.5.1",
"**/extend": "^3.0.2"
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ android/app/src/pilot/google-services.json
secrets.json
android/sentry.properties
ios/sentry.properties
ios/Pods
3 changes: 2 additions & 1 deletion packages/mobile/Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"
gem "fastlane"
55 changes: 54 additions & 1 deletion packages/mobile/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,62 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.3)
babosa (1.0.2)
claide (1.0.2)
cocoapods (1.7.5)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.7.5)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.10.0, < 2.0)
cocoapods-core (1.7.5)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.4.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.1.5)
declarative (0.0.10)
declarative-option (0.1.0)
digest-crc (0.4.1)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.4)
emoji_regex (1.0.1)
escape (0.0.4)
excon (0.65.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
Expand Down Expand Up @@ -64,6 +104,8 @@ GEM
xcodeproj (>= 1.8.1, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
Expand Down Expand Up @@ -93,18 +135,24 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.2.0)
jwt (2.1.0)
memoist (0.16.0)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mini_magick (4.9.5)
minitest (5.11.3)
molinillo (0.6.6)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
nap (1.1.0)
naturally (2.2.0)
netrc (0.11.0)
os (1.0.1)
plist (3.5.0)
public_suffix (2.0.5)
Expand All @@ -114,6 +162,7 @@ GEM
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
ruby-macho (1.4.0)
rubyzip (1.2.3)
security (0.1.3)
signet (0.11.0)
Expand All @@ -128,10 +177,13 @@ GEM
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tty-cursor (0.7.0)
tty-screen (0.7.0)
tty-spinner (0.9.1)
tty-cursor (~> 0.7)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
Expand All @@ -153,7 +205,8 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods
fastlane

BUNDLED WITH
1.17.2
2.0.1
7 changes: 7 additions & 0 deletions packages/mobile/__mocks__/@celo/react-native-sms-retriever.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { NativeModules } from 'react-native'

NativeModules.RNSmsRetrieverModule = {}

const smsRetrieverMock = jest.genMockFromModule('@celo/react-native-sms-retriever')

module.exports = smsRetrieverMock
3 changes: 3 additions & 0 deletions packages/mobile/__mocks__/react-native-geth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { NativeModules } from 'react-native'

NativeModules.RNGeth = {}
1 change: 0 additions & 1 deletion packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ dependencies {
implementation project(':react-native-flag-secure-android')
implementation project(':react-native-firebase')
implementation project(':react-native-confirm-device-credentials')
implementation project(':react-native-system-clock')
implementation project(':react-native-restart-android')
implementation project(':react-native-sms-retriever')
implementation project(':react-native-share')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import com.tradle.react.UdpSocketsModule;
import org.celo.devicecredentials.RNConfirmDeviceCredentialsPackage;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.reactmodule.RNSystemClockPackage;
import com.rnrestartandroid.RNRestartAndroidPackage;
import me.furtado.smsretriever.RNSmsRetrieverPackage;
import cl.json.RNSharePackage;
Expand Down Expand Up @@ -111,7 +110,6 @@ protected List<ReactPackage> getPackages() {
new FlagSecurePackage(),
new RNFirebaseStoragePackage(),
new RNVersionCheckPackage(),
new RNSystemClockPackage(),
new RNRestartAndroidPackage(),
new RNSmsRetrieverPackage(),
new RNSharePackage(),
Expand Down
2 changes: 0 additions & 2 deletions packages/mobile/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ include ':react-native-flag-secure-android'
project(':react-native-flag-secure-android').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-flag-secure-android/android')
include ':react-native-confirm-device-credentials'
project(':react-native-confirm-device-credentials').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-confirm-device-credentials/android')
include ':react-native-system-clock'
project(':react-native-system-clock').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-system-clock/android')
include ':react-native-restart-android'
project(':react-native-restart-android').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-restart-android/android')
include ':react-native-sms-retriever'
Expand Down
80 changes: 80 additions & 0 deletions packages/mobile/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# File contents of "ios/Podfile"
platform :ios, '9.0'

pre_install do |installer|
# workaround for CocoaPods/CocoaPods#3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

target 'celo' do
use_frameworks!

pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
# the following ones are the ones taken from "Libraries" in Xcode:
'RCTAnimation',
'RCTActionSheet',
'RCTBlob',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]

# the following dependencies are dependencies of React native itself.
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'

# React Native Libraries
# pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
# pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth'
# pod 'RNFBDatabase', :path => '../node_modules/@react-native-firebase/database'
pod 'RNFirebase', :path => '../../../node_modules/react-native-firebase/ios'
pod 'RNFS', :path => '../../../node_modules/react-native-fs'
pod 'react-native-geth', :path => '../../../node_modules/react-native-geth'
pod 'RNSVG', :path => '../../../node_modules/react-native-svg'
pod 'RNAnalytics', :path => '../../../node_modules/@segment/analytics-react-native'
pod 'RNAnalyticsIntegration-Firebase', :path => '../../../node_modules/@segment/analytics-react-native-firebase'
pod 'react-native-config', :path => '../../../node_modules/react-native-config'
pod 'react-native-contacts', :path => '../../../node_modules/react-native-contacts'
pod 'RNDeviceInfo', :path => '../../../node_modules/react-native-device-info'
pod 'react-native-keep-awake', :path => '../../../node_modules/react-native-keep-awake'
pod 'RNLanguages', :path => '../../../node_modules/react-native-languages'
pod 'react-native-mail', :path => '../../../node_modules/react-native-mail'
pod 'RNScreens', :path => '../../../node_modules/react-native-screens'
pod 'SentryReactNative', :path => '../../../node_modules/react-native-sentry'
pod 'react-native-splash-screen', :path => '../../../node_modules/react-native-splash-screen'
pod 'react-native-version-check', :path => '../../../node_modules/react-native-version-check'
pod 'RNRandomBytes', :path => '../../../node_modules/react-native-secure-randombytes'
pod 'react-native-udp', :path => '../../../node_modules/react-native-udp'
pod 'react-native-netinfo', :path => '../../../node_modules/@react-native-community/netinfo'
pod 'RNShare', :path => '../../../node_modules/react-native-share'
pod 'react-native-camera', :path => '../../../node_modules/react-native-camera'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'CeloBlockchain', :path => '../../../node_modules/@celo/client/CeloBlockchain.podspec'
pod 'RNSecureKeyStore', :path => '../../../node_modules/react-native-secure-key-store/ios'

pod 'Firebase/Core', '~> 5.20.2'
pod 'GoogleUtilities', '~> 5.3.7'
# pod 'Segment-Firebase', '~> 2.4.0'

target 'celoTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Geth framework doesn't support bitcode. Not really a deal breaker, I tend to disable bitcode usually as it complicates crash reporting a little bit (you have to download the symbols after uploading the app to App Store Connect to be able to symbolicate stacktraces, It can (should) be automated anyway but takes longer in the CI pipeline).

end
end
end
Loading