Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 2 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
eslint:
enabled: true
config_file: .eslintrc
ignore_file: .eslintignore
config_file: .eslintrc.js
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.18.0
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.6
10 changes: 4 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
ruby '4.0.6'

# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
gem 'bundler', '4.0.15'
gem 'cocoapods', '1.17.0'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
gem 'nkf'
37 changes: 18 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,24 @@ GEM
benchmark (0.4.1)
bigdecimal (3.2.3)
claide (1.1.0)
cocoapods (1.15.2)
cocoapods (1.17.0)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2)
cocoapods-core (= 1.17.0)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 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.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
ruby-macho (~> 4.1.0)
xcodeproj (>= 1.28.1, < 2.0)
cocoapods-core (1.17.0)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -65,10 +64,9 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.8)
connection_pool (3.0.2)
drb (2.2.3)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.17.2)
Expand All @@ -79,46 +77,47 @@ GEM
mutex_m
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.13.2)
json (2.21.2)
logger (1.7.0)
minitest (5.27.0)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.3.0)
nanaimo (0.4.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.4.4)
ruby-macho (2.5.1)
ruby-macho (4.1.0)
securerandom (0.4.1)
typhoeus (1.5.0)
ethon (>= 0.9.0, < 0.16.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
xcodeproj (1.28.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
base64
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
nanaimo (~> 0.4.0)
nkf
rexml (>= 3.3.6, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, != 7.1.0)
benchmark
bigdecimal
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
concurrent-ruby (< 1.3.4)
bundler (= 4.0.15)
cocoapods (= 1.17.0)
logger
mutex_m
xcodeproj (< 1.26.0)
nkf

RUBY VERSION
ruby 2.7.6p219
ruby 4.0.6

BUNDLED WITH
2.1.4
4.0.15
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ The Zooniverse Mobile app is a [React Native](https://facebook.github.io/react-n

### Preparing The React Native Framework
#### Requirements:
- Node >= 16 (Recommend >= 18)
- Node 24.18.0 (use `nvm use` to load the version in `.nvmrc`)
- Ruby 4.0.6, Bundler 4.0.15, and CocoaPods 1.17.0 (Ruby is pinned in `.ruby-version`)
#### Steps:
1. Follow the instructions for Android and iOS setup in [this guide](https://reactnative.dev/docs/environment-setup).
2. Clone down this repo and navigate to its directory (called `mobile`).
3. Run `npm install` (later, if you need to reinstall dependencies for some reason, you can run `rm -rf node_modules/ && npm install`)
4. Run `npm start`.
3. Copy or create the local files that are not checked into Git:
- `local.properties` goes in `android/local.properties`. It contains the local Android SDK path and is excluded because that path is specific to each developer's machine.
- `key.properties` goes in `android/app/key.properties`. It contains the release keystore filename, key alias, and signing passwords and is excluded because it contains credentials.
- `my-upload-key.keystore` goes in `android/app/my-upload-key.keystore`. It contains the private Android upload signing key and is excluded because committing it would expose a sensitive release credential.
4. Run `npm ci`.
5. Run `npm start`.
#### Troubleshooting:
- [Troubleshooting wiki](https://github.com/zooniverse/mobile/wiki/Troubleshooting) for additional help
- `react-native-blob-util` is pinned to `0.24.9` because `0.24.10` interrupts Android file downloads, preventing drawing subjects from loading. Do not upgrade it until the upstream Android regression is fixed.

### Push Notification Troubleshooting
- When using Firebase Console "Test on device", confirm the FCM token has no leading or trailing spaces.
- In Firebase Console -> Project settings -> Cloud Messaging, confirm the iOS APNs Key ID and Team ID match the current Apple Developer account.
- Direct APNs delivery can work while Firebase Cloud Messaging still fails; use FCM v1 REST/API sends to get the real Firebase/APNs error.
- Android debug uses the dev Firebase project, Android release uses production, and iOS uses the bundled `ios/GoogleService-Info.plist`.

### iOS
#### Requirements:
Expand All @@ -21,12 +33,15 @@ The Zooniverse Mobile app is a [React Native](https://facebook.github.io/react-n
- To run on an iOS device see [Running on device - iOS]https://reactnative.dev/docs/running-on-device?platform=ios
#### Steps:
On the command line, from the `mobile` directory, run:
1. `cd ios && rm -rf Podfile.lock && pod install && cd ..`. You may need to `brew install cocoapods` first.
1. Run `bundle install`, then `cd ios && bundle exec pod install && cd ..`.
2. `npm run ios`

### Android
#### Requirements:
- Android Studio
- The following local files are intentionally excluded from Git and must be created or obtained before building:
* `android/local.properties` identifies the local Android SDK path. Android Studio normally creates it; otherwise add `sdk.dir=/absolute/path/to/Android/sdk`.
* `android/app/key.properties` contains the release keystore path and credentials. Obtain it and the referenced keystore securely from an existing maintainer. The current Gradle configuration reads this file during debug and release builds.
- You'll need at least one emulator. To get one:
* Within Android Studio, open the "AVD Manager" - in the toolbar click the icon with the purple device and small android (fourth from the right)
* Click 'Create Virtual Device' - bottom left-hand corner
Expand Down Expand Up @@ -72,4 +87,4 @@ Steps:
5) Drag n drop the file into the "App bundles" in Google Play store where you would normally create the internal testing release.

### iOS
Note: Nothing has changed with the iOS release process, continue to build and archive via Xcode.
Note: Nothing has changed with the iOS release process, continue to build and archive via Xcode.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ android {
applicationId "com.zooniversemobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 115
versionName "2.16.0"
versionCode 126
versionName "2.17.0"
}
signingConfigs {
debug {
Expand Down
Binary file removed android/app/src/main/assets/fonts/AntDesign.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/Entypo.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/EvilIcons.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/Feather.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/FontAwesome.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/Fontisto.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/Foundation.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/Ionicons.ttf
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/MaterialIcons.ttf
Binary file not shown.
Binary file removed android/app/src/main/assets/fonts/Octicons.ttf
Binary file not shown.
Binary file not shown.
30 changes: 9 additions & 21 deletions android/app/src/main/java/com/zooniversemobile/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,19 @@ import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)
override val reactHost: ReactHost by lazy {
getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here.
},
)
}

override fun onCreate() {
super.onCreate()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 0 additions & 5 deletions android/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
'react-native-reanimated/plugin',
[
'module:react-native-dotenv',
{
Expand All @@ -15,5 +14,6 @@ module.exports = {
verbose: false,
},
],
'react-native-worklets/plugin',
],
};
4 changes: 2 additions & 2 deletions ios/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>PROJECT_ID</key>
<string>zooniverse-production</string>
<key>STORAGE_BUCKET</key>
<string>zooniverse-production.appspot.com</string>
<string>zooniverse-production.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
Expand All @@ -33,4 +33,4 @@
<key>DATABASE_URL</key>
<string>https://zooniverse-production.firebaseio.com</string>
</dict>
</plist>
</plist>
13 changes: 12 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,22 @@ target 'ZooniverseMobile' do
)

post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)

installer.pods_project.targets.each do |target|
target.build_configurations.each do |build_config|
build_config.build_settings[
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'
] = 'YES'

if target.name.start_with?('RNFB')
build_config.build_settings['CLANG_ENABLE_MODULES'] = 'NO'
end
end
end
end
end
Loading