Download on the App Store.
This branch works with Xcode 15, Swift 5.8 and supports iOS 15 and above.
Please note: Both Intel and M1 macs are supported 🎉 and we use swift package manager.
Please make sure you aim your pull requests in the right direction.
For bug fixes and features for a specific release, use the version branch.
We encourage you to participate in this open source project. We love Pull Requests, Issue Reports, Feature Requests or any kind of positive contribution. Please read the Mozilla Community Participation Guidelines and our Contributing guidelines first.
- You can file a new issue or research existing bugs
If more information is required or you have any questions then we suggest reaching out to us via:
- Chat on Element channel #fx-ios for general discussion, or write DMs to specific teammates for questions.
- Open a Github discussion which can be used for general questions.
Want to contribute on the codebase but don't know where to start? Here is a list of issues that are contributor friendly, but make sure to read the Contributing guidelines first.
This project uses custom Git hooks to enforce commit message formatting and other automated tasks.
To ensure that these hooks are installed correctly in your local .git/hooks
directory, you need to run the provided setup script after cloning the repository.
- Navigate into the project directory
- Run the setup script to install the Git hooks:
./setup_hooks.sh
This script will copy all the necessary hooks (such as prepare-commit-msg
) to your local .git/hooks
directory, ensuring they are executable.
We use SwiftLint to enforce Swift style and conventions. Make sure to install it so that linting runs correctly when building.
brew install swiftlint
- Install the latest Xcode developer tools from Apple.
- Install, Brew, Node, and a Python3 virtualenv for localization scripts:
brew update brew install node pip3 install virtualenv
- Clone the repository:
git clone https://github.com/ecosia/ios-browser
- Install Node.js dependencies, build user scripts and update content blocker:
cd firefox-ios sh ./bootstrap.sh
- Open
Client.xcodeproj
in Xcode. - Make sure to select the
Fennec
scheme in Xcode. - Select the destination device you want to build on.
- Run the app with
Cmd + R
or by pressing thebuild and run
button.
- Xcode -> File -> Packages -> Reset Package Caches
- This will also require you to have a working github integration set up in xcode (see Settings > Accounts > Source Control Accounts)
User Scripts (JavaScript injected into the WKWebView
) are compiled, concatenated, and minified using webpack. User Scripts to be aggregated are placed in the following directories:
/Client
|-- /Frontend
|-- /UserContent
|-- /UserScripts
|-- /AllFrames
| |-- /AtDocumentEnd
| |-- /AtDocumentStart
|-- /MainFrame
|-- /AtDocumentEnd
|-- /AtDocumentStart
This reduces the total possible number of User Scripts down to four. The compiled output from concatenating and minifying the User Scripts placed in these folders resides in /Client/Assets
and are named accordingly:
AllFramesAtDocumentEnd.js
AllFramesAtDocumentStart.js
MainFrameAtDocumentEnd.js
MainFrameAtDocumentStart.js
To simplify the build process, these compiled files are checked-in to this repository. When adding or editing User Scripts, these files can be re-compiled with webpack
manually. This requires Node.js to be installed, and all required npm
packages can be installed by running npm install
in the project's root directory. User Scripts can be compiled by running the following npm
command in the root directory of the project:
npm run build
The CURRENT_PROJECT_VERSION
being set to 0
indicates that it is not being used for local testing. The outcoming build number is updated by the CI, matching the CI run number (e.g. 8023
).
Our certs and profiles are managed centrally by fastlane match. Find the repo here
Run bundle exec fastlane match --readonly
to add certs and profiles to your system. You can append -p "keychain password"
to avoid keychain prompts during the process. The passphrase to decrypt the repo can be found in LastPass.
As we use fastlane match
to hardwire profiles it gets a bit tricky to add a new device and run the app via your machine.
- Plugin your device and add it to the portal via XCode-Prompt.
- Login into AppDeveloper Portal
- Navigate to
Certificates, Identifiers & Profiles
- Select
Profiles
-Tab and findmatch Development com.ecosia.ecosiaapp
- Edit it and make sure your device is selected
- Save, download and double click the Profile
- Now XCode should find it as it's in your keychain
- Run on Device!
We are using Transifex for managing our translations.
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
[https://www.transifex.com]
api_hostname = https://api.transifex.com
hostname = https://www.transifex.com
username = <vault secret>
password = <vault secret>
rest_hostname = https://rest.api.transifex.com
token = <vault secret>
Pulling translation from the web
tx pull -fs
Test and commit the new translations. There exists schemes for testing other languages in the simulator.
- Pull the source file
- Add the new strings to the English source file
Client/Ecosia/L10N/en.lproj/Ecosia.strings
- Push it to Transifex
tx pull -fs
tx push -s
We do a rebrand of the Strings from Mozilla. Usually this step is only needed after an upgrade as we keep our changes in version control (as of opposite to Mozilla). First we need to import all the strings via the scripts:
# clone the repo
git clone https://github.com/mozilla-mobile/ios-l10n-scripts.git
# run the script in project-dir
./ios-l10n-scripts/import-locales-firefox.sh --release
After import we rebrand (aka "ecosify")
# brand all the files as they contain the term 'Firefox' a lot
python3 ecosify-strings.py Client
python3 ecosify-strings.py Extensions
python3 ecosify-strings.py Shared
Follow the instructions from our confluence page
Make sure that fastlane
and transifex
-cli is installed.
ℹ️ Updating the source file in the project and merging it into
main
will automatically push it to Transifex as well since the Github integration is in place.
🔔 Make sure that an inflight version exists in AppStore Connect. If not, create one.
- Create a new branch off
main
and modify the English release notes here - Open a PR with the modified English release note text file against
main
branch - Once approved, Squash and Merge the code to
main
. (The transifex integration will pick up the push) - Transifex will create a PR and update it with the release notes in all available languages ⏳
- Squash and Merge the code to
main
via a PR and a GitHubAction workflow will be triggered to upload the newly translated release notes
-
Make sure that all languages are translated in the transifex web interface and found their way to
main
-
Verify the translations in the Transifex-made PR
-
Squash and Merge the PR
-
The GitHub Action Workflow
Upload release notes to AppStore
will take care of the upload
-
Push via the update translation via
deliver
to the AppStorebundle exec fastlane deliver --app-version 8.2.0
We built our snapshot testing setup with SnapshotTestHelper
to streamline UI checks. Here’s the gist:
-
Dynamic Setup: We create UI components on-the-fly for testing, ensuring they're set up with current data and state.
-
Config Flexibility: The tool handles multiple themes and devices, simulating how UI looks across different environments.
-
Localization: It supports testing in various languages by adjusting the app’s locale dynamically, crucial for ensuring the UI displays correctly in all supported languages.
-
Comparison: We capture snapshots of the UI and compare them to reference images to spot any unintended changes.
More details here