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

Ios config #2490

Merged
merged 5 commits into from
Feb 20, 2025
Merged

Ios config #2490

merged 5 commits into from
Feb 20, 2025

Conversation

Mozart299
Copy link
Contributor

@Mozart299 Mozart299 commented Feb 20, 2025

Summary of Changes (What does this PR do?)

  • Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included issue number in the "Closes #ISSUE-NUMBER" part of the "What are the relevant tickets?" section to link the issue.
  • I've updated corresponding documentation for the changes in this PR.
  • I have written unit and/or e2e tests for my change(s).

How should this be manually tested?

  • Please include the steps to be done inorder to setup and test this PR.

What are the relevant tickets?

Screenshots (optional)

Summary by CodeRabbit

  • New Features

    • Expanded cross-platform support with the addition of macOS compatibility.
    • Updated iOS configuration with a raised minimum OS requirement (iOS 16) and enhanced mapping integration.
    • Introduced a new configuration file for Dart static analysis and linting.
    • Added a new widget test to verify counter functionality.
  • Chores

    • Refined project configurations and build settings across platforms.
    • Streamlined internal dependency management and metadata for enhanced build stability.

Copy link

coderabbitai bot commented Feb 20, 2025

Warning

Rate limit exceeded

@Mozart299 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0cc093d and bad88b4.

📒 Files selected for processing (1)
  • mobile-v3/ios/Podfile (2 hunks)
📝 Walkthrough

Walkthrough

This update makes several configuration and file management improvements. The changes include updating ignore rules, revision tracking, and build configurations for both Android and iOS platforms. New files such as Dart analysis options and Android’s MainActivity have been added, while auto-generated plugin registrant files and legacy build scripts have been removed. Additionally, iOS settings have been updated with modifications to the Podfile, Xcode project files, and asset configurations, along with introducing a basic widget test.

Changes

File(s) Change Summary
mobile-v3/.gitignore Added entries: .build/, .swiftpm/, and ios/Podfile.lock to ignore build artifacts and dependency files.
mobile-v3/.metadata Updated revision and migration values; removed iOS migration entries and added a new macos platform entry.
mobile-v3/analysis_options.yaml New configuration file for Dart analyzer with recommended lint rules for Flutter projects.
mobile-v3/android/app/build.gradle.kts Introduced new Kotlin Gradle build configuration including plugins, Android settings, Flutter block, defaultConfig, and buildTypes.
mobile-v3/android/app/src/main/kotlin/.../MainActivity.kt New MainActivity class added extending FlutterActivity for Android entry point.
mobile-v3/android/gradlew
mobile-v3/android/gradlew.bat
Removed Gradle wrapper scripts for POSIX and Windows environments.
mobile-v3/android/settings.gradle.kts Updated plugin management: added flutter plugin loader, Android application plugin, and Kotlin Android plugin declarations.
mobile-v3/ios/Podfile
mobile-v3/ios/Runner.xcodeproj/project.pbxproj
mobile-v3/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
mobile-v3/ios/Runner/AppDelegate.swift
mobile-v3/ios/Runner/Info.plist
iOS changes: Updated platform version (to 16.0), added GoogleMaps pod, renamed Pods references and updated bundle identifier, enabled GPU validation, adjusted the Google Maps API key placeholder in AppDelegate, and modified the display name in Info.plist.
mobile-v3/ios/Flutter/Generated.xcconfig
mobile-v3/ios/Flutter/flutter_export_environment.sh
mobile-v3/ios/Runner/GeneratedPluginRegistrant.h
mobile-v3/ios/Runner/GeneratedPluginRegistrant.m
mobile-v3/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json
Removed auto-generated configuration and plugin registrant files, as well as asset metadata for launch background images.
mobile-v3/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json Cosmetic reordering of JSON key-value pairs.
mobile-v3/test/widget_test.dart New widget test file added to verify the increment behavior in the Flutter counter widget.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MainActivity
    participant FlutterEngine

    User->>MainActivity: Launch the app
    MainActivity->>FlutterEngine: Initialize engine and load configurations
    FlutterEngine-->>MainActivity: Confirm initialization and load Flutter app assets
    Note over FlutterEngine, MainActivity: Plugin registration is now handled differently due to removed registrant files
Loading

Suggested reviewers

  • Baalmart

Poem

In lines of code our changes gleam,
Ignoring files to keep things clean.
Revision updated, platforms in sight,
Android and iOS now in flight.
With tests in place and configs anew,
Our app embarks on journeys true.
🚀 CodeRabbit soars—onward we pursue!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Mozart299 Mozart299 requested a review from Baalmart February 20, 2025 12:53
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (4)
mobile-v3/test/widget_test.dart (1)

14-29: Consider expanding test coverage

While the counter test is a good starting point, consider adding more test cases:

  • Test edge cases (e.g., maximum counter value)
  • Test other widget interactions
  • Test widget initialization states

Would you like me to provide examples of additional test cases?

mobile-v3/analysis_options.yaml (1)

23-25: Consider enabling additional lint rules

The commented examples show how to customize rules. Consider enabling:

  • prefer_single_quotes for consistent string literals
  • Additional rules for null safety
  • Performance-related lints

Would you like me to provide a list of recommended lint rules for your project?

mobile-v3/android/app/build.gradle.kts (1)

33-39: Build Types Consideration

The release build type currently uses the debug signing configuration, as indicated in the comments. While this can be acceptable during initial testing, it’s advisable to set up a dedicated and secure signing configuration for production releases.

mobile-v3/.gitignore (1)

70-71: Podfile.lock Exclusion Consideration

While ignoring /ios/Podfile.lock can be appropriate for library projects, iOS applications typically benefit from committing the Podfile.lock to maintain consistent dependency versions across environments. Please verify that excluding this file aligns with your team’s workflow and release strategy.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd111b5 and 39fe17d.

⛔ Files ignored due to path filters (4)
  • mobile-v3/android/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
  • mobile-v3/ios/Podfile.lock is excluded by !**/*.lock
  • mobile-v3/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png is excluded by !**/*.png
  • mobile-v3/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (21)
  • mobile-v3/.gitignore (2 hunks)
  • mobile-v3/.metadata (2 hunks)
  • mobile-v3/analysis_options.yaml (1 hunks)
  • mobile-v3/android/app/build.gradle.kts (1 hunks)
  • mobile-v3/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java (0 hunks)
  • mobile-v3/android/app/src/main/kotlin/com/airqo/airqo/MainActivity.kt (1 hunks)
  • mobile-v3/android/gradlew (0 hunks)
  • mobile-v3/android/gradlew.bat (0 hunks)
  • mobile-v3/android/settings.gradle.kts (1 hunks)
  • mobile-v3/ios/Flutter/Generated.xcconfig (0 hunks)
  • mobile-v3/ios/Flutter/flutter_export_environment.sh (0 hunks)
  • mobile-v3/ios/Podfile (2 hunks)
  • mobile-v3/ios/Runner.xcodeproj/project.pbxproj (13 hunks)
  • mobile-v3/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (1 hunks)
  • mobile-v3/ios/Runner/AppDelegate.swift (1 hunks)
  • mobile-v3/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json (0 hunks)
  • mobile-v3/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (1 hunks)
  • mobile-v3/ios/Runner/GeneratedPluginRegistrant.h (0 hunks)
  • mobile-v3/ios/Runner/GeneratedPluginRegistrant.m (0 hunks)
  • mobile-v3/ios/Runner/Info.plist (1 hunks)
  • mobile-v3/test/widget_test.dart (1 hunks)
💤 Files with no reviewable changes (8)
  • mobile-v3/ios/Runner/GeneratedPluginRegistrant.h
  • mobile-v3/ios/Flutter/flutter_export_environment.sh
  • mobile-v3/ios/Flutter/Generated.xcconfig
  • mobile-v3/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json
  • mobile-v3/android/gradlew
  • mobile-v3/android/gradlew.bat
  • mobile-v3/ios/Runner/GeneratedPluginRegistrant.m
  • mobile-v3/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
✅ Files skipped from review due to trivial changes (3)
  • mobile-v3/android/app/src/main/kotlin/com/airqo/airqo/MainActivity.kt
  • mobile-v3/ios/Runner/Info.plist
  • mobile-v3/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
🔇 Additional comments (15)
mobile-v3/.metadata (2)

7-7: Revision update looks good!

The Flutter SDK revision has been consistently updated across both the main revision and root platform configuration.

Also applies to: 16-17


18-20: Verify macOS platform addition

The addition of macOS platform configuration suggests a shift in development focus. Please ensure this aligns with the project's cross-platform strategy, especially given the PR title "Ios config".

Could you clarify if the removal of iOS platform configuration and addition of macOS platform configuration is intentional?

mobile-v3/test/widget_test.dart (1)

11-11: Verify import path correctness

The import path package:airqo/main.dart assumes a specific package name. Please ensure this matches your pubspec.yaml configuration.

mobile-v3/android/settings.gradle.kts (2)

2-8: LGTM! Robust Flutter SDK path handling

The implementation properly validates the Flutter SDK path from local.properties with appropriate error messaging.


20-22:

❓ Verification inconclusive

Verify plugin versions compatibility

Please verify the compatibility of these plugin versions:

  • Flutter plugin loader: 1.0.0
  • Android application: 8.7.0
  • Kotlin Android: 1.8.22

🌐 Web query:

What are the latest stable versions of Android Gradle plugin and Kotlin Android plugin that are compatible with Flutter?

💡 Result:

The latest stable versions of Android Gradle Plugin (AGP) and Kotlin Android Plugin compatible with Flutter projects are:

Android Gradle Plugin

  • Latest Stable: 8.x (specifically 8.X.X)
  • Requires Gradle wrapper version ≥8.X.X ([source][1][9][4])

Kotlin Android Plugin

  • Minimum Required: 1.X.X
  • Recommended Stable: 2.X.X ([source][3][4][6][8])

Compatibility Details

Component Version Range Notes
Android Gradle Plugin 7.X–X.X Tested with Flutter projects ([source][4][9]). Latest stable: X.X.X ([source][X]).
Kotlin Plugin ≥X.X.X Required for foldable device support ([source][X]). Latest stable: X.X.X-RC ([source][X]).
Gradle Wrapper ≥X.X.X Must align with AGP requirements ([source][X][X]).

Recommendations for Flutter Projects

1️⃣ Update android/build.gradle:

plugins {
    id "com.android.application" version "X.X.X" apply false
    id "org.jetbrains.kotlin.android" version "X.X.X" apply false
}

2️⃣ Validate dependencies:
Run flutter analyze --suggestion to detect compatibility issues[1].

3️⃣ JDK Version:
Use Java 17+ for AGP ≥X.X[1]. Verify via:

flutter doctor -v

Common Pitfalls

  • Mixing incompatible AGP/Kotlin versions causes errors like Unsupported class file major version[1][2].
  • Declarative plugin syntax (plugins {} block) is now required for newer Flutter projects[4].

For troubleshooting dependency conflicts, use:

./gradlew :app:dependencies

Citations:


Action: Validate Plugin Versions for Flutter Compatibility

Please double-check that the plugin versions declared in mobile-v3/android/settings.gradle.kts are fully compatible with your Flutter setup:

  • Flutter Plugin Loader: 1.0.0
  • Android Application Plugin: 8.7.0
    • AGP is in the 8.x range confirmed to work with Flutter projects. Ensure your Gradle wrapper (≥8.x) and JDK (Java 17+) meet these requirements.
  • Kotlin Android Plugin: 1.8.22
    • While this version meets the minimum requirements, some sources now recommend considering a move toward a 2.X.X release. Verify that 1.8.22 remains optimal for your project’s dependency ecosystem.

Review your Gradle configuration and the results from flutter analyze --suggestion to ensure no compatibility issues arise.

mobile-v3/analysis_options.yaml (1)

10-10: LGTM! Standard Flutter lints included

Including package:flutter_lints/flutter.yaml ensures adherence to Flutter's recommended coding practices.

mobile-v3/android/app/build.gradle.kts (6)

1-6: Plugin Configuration Integrity Check

The new plugins block correctly applies the Android, Kotlin, and Flutter Gradle plugins. The inline comment about applying the Flutter Gradle Plugin after the Android and Kotlin plugins is clear—please ensure that its position (line 5) is maintained consistently as the project evolves.


8-12: Android Block Basic Setup

This section efficiently defines the application's namespace and sets up the SDK and NDK versions using external Flutter properties. Just verify that properties such as flutter.compileSdkVersion and flutter.ndkVersion are defined prior to their use.


13-16: Compile Options Configuration

Setting both the source and target compatibility to JavaVersion.VERSION_11 is a solid choice that aligns with modern Java standards. The configuration here is clean and straightforward.


18-20: Kotlin Options Setup

The Kotlin options are properly configured with the JVM target set to Java 11. Converting the JavaVersion to a String ensures compatibility with the DSL.


22-31: Default Configuration Block

This block is well-organized, leveraging Flutter's properties for SDK and versioning details. However, note the TODO comment on line 23 regarding the application ID. Before production release, ensure that you replace the placeholder with a unique identifier as recommended by Android development best practices.


42-44: Flutter Module Source Path

Defining the Flutter block with a relative source path ("../..") is clear and effective. Just make sure that this relative path remains valid as the project structure changes over time.

mobile-v3/.gitignore (2)

8-8: Ignoring Build Artifacts

The addition of .build/ ensures that internal build artifacts are not tracked by version control, which helps maintain a cleaner repository.


12-12: Swift Package Manager Artifacts

The new entry .swiftpm/ effectively ignores Swift Package Manager-related files. This is a sensible addition if these files are generated and not intended for version control.

mobile-v3/ios/Runner.xcodeproj/project.pbxproj (1)

498-498:

❓ Verification inconclusive

Verify bundle identifier change.

The bundle identifier has been changed to com.airqo.airqo. This change affects app store distribution and user data. Ensure this is intentional and coordinate with your release management team.

Check if this bundle identifier is already registered in App Store Connect and if it matches your other environments:

Also applies to: 515-515, 533-533, 549-549, 680-680, 702-702


🏁 Script executed:

#!/bin/bash
# Description: Search for all bundle identifier references to ensure consistency

echo "Searching for bundle identifier references..."
rg -l "com\.airqo\." 

Length of output: 1430


Bundle Identifier Update Verification

The bundle identifier in mobile-v3/ios/Runner.xcodeproj/project.pbxproj has been updated to com.airqo.airqo. Our search indicates that references to "com.airqo." exist across multiple areas (iOS, Android, documentation, etc.), which suggests an attempt at consistency. However, please verify that:

  • com.airqo.airqo is the deliberate and correct identifier for this release.
  • This identifier is registered in App Store Connect and aligns with your other environments.
  • The change has been harmonized with the release management team to ensure no adverse effects on app store distribution or user data.

@@ -59,6 +59,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
Copy link

@coderabbitai coderabbitai bot Feb 20, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Consider making GPU validation mode configurable.

While enabling GPU validation mode can help catch rendering issues early (especially useful with Google Maps integration), it may impact development performance due to additional validation checks during rendering.

Since this setting is in xcshareddata and affects all developers, consider:

  1. Moving it to a debug-specific scheme
  2. Making it configurable via a build configuration
  3. Documenting when to enable/disable it

Let's verify if this is a recommended setting for shared schemes:


🌐 Web query:

Should GPU validation mode be enabled by default in Xcode shared schemes?

💡 Result:

GPU validation mode in Xcode schemes should not be enabled by default for general use cases, though it depends on the context of development workflows and performance requirements. Here's a breakdown of key considerations:

Debugging vs. Release Builds

  • Debug configurations: Enabling GPU validation (via XCODE_SCHEME_ENABLE_GPU_API_VALIDATION or XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION) is recommended during development to catch Metal API misuse and shader errors[4][9]. Tools like Shader Validation help identify out-of-bounds memory access or invalid resource usage[4].
  • Release configurations: Validation layers introduce measurable CPU overhead[6][9], making them unsuitable for production builds where performance is critical[3][6].

Default Behavior in Xcode

  • Xcode schemes historically enabled Metal API Validation by default in debug builds[3][9], but this varies based on project settings.
  • The XCODE_SCHEME_LAUNCH_CONFIGURATION property allows explicit control over build configurations tied to schemes (e.g., Debug/Release)[1].

Performance Impact

Scenario CPU Overhead GPU Overhead
Debugging Moderate[9] Minimal
Production Unacceptable[3][6] Unacceptable

Best Practices

  1. Enable for debugging: Use schemes with GPU validation active during development to catch errors early[4][9].
  2. Disable for release: Ensure validation is off in release builds via scheme settings (XCODE_SCHEME_ENABLE_GPU_API_VALIDATION=NO)[1][3].
  3. Automate with CI: Integrate validation checks into automated testing pipelines without enabling them in shipped apps[4].

For shared schemes, a balanced approach is to enable GPU validation only in debug configurations by default while excluding it from release builds[1][6]. This aligns with Apple’s guidance to use these tools diagnostically rather than in production[4][9].

Citations:


GPU Validation Mode Configurability Consideration

While enabling GPU validation mode can help catch rendering issues during development (especially with Google Maps integration), our research confirms that leaving it enabled by default in a shared Xcode scheme is not advisable. This setting can introduce performance overhead and is better suited for debug configurations only. Consider:

  • Moving enableGPUValidationMode = "1" from the shared scheme to a debug-specific scheme, or
  • Making it configurable via build settings so that it’s only enabled during active GPU debugging sessions.

File: mobile-v3/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (line 62)

Copy link
Collaborator

Choose a reason for hiding this comment

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

create a github issue for this.

Copy link

Choose a reason for hiding this comment

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

🧩 Analysis chain

@Baalmart I've created a GitHub issue to track the GPU validation mode configuration improvements. The issue includes detailed context about the current state, the problem, proposed solutions, and implementation notes. You'll be assigned to the issue for tracking purposes.


🏁 Script executed:

#!/bin/bash
# Create a GitHub issue for GPU validation mode configuration
gh issue create \
  --title "iOS: Make GPU validation mode configurable in Xcode schemes" \
  --body "## Current State
The GPU validation mode is currently enabled by default in the shared Xcode scheme for all builds.

\`\`\`diff
      debugDocumentVersioning = \"YES\"
      debugServiceExtension = \"internal\"
+     enableGPUValidationMode = \"1\"
\`\`\`

## Problem
Having GPU validation mode enabled by default in shared schemes can:
- Introduce measurable CPU overhead during development
- Impact performance in production builds
- Affect all developers using the shared scheme, even when not debugging GPU-related issues

## Proposed Solution
Consider one of these approaches:
1. Move GPU validation mode to a debug-specific scheme
2. Make it configurable via build configuration
3. Document when to enable/disable it in the development workflow

## Implementation Notes
- Review current GPU validation settings across all schemes
- Create separate debug schemes with GPU validation enabled
- Update documentation to reflect GPU validation usage guidelines

## References
- Original PR: https://github.com/airqo-platform/AirQo-frontend/pull/2490
- Discussion: https://github.com/airqo-platform/AirQo-frontend/pull/2490#discussion_r1963518359

## Additional Context
This change aligns with best practices for Metal API validation in iOS development, where validation tools should be used diagnostically rather than enabled by default in production builds." \
  --assignee "Baalmart"

Length of output: 1525


@Baalmart I've created issue #2492 to track the GPU validation mode improvements: #2492


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!


@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GMSServices.provideAPIKey("YOUR_API_KEY_HERE")
Copy link

@coderabbitai coderabbitai bot Feb 20, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

⚠️ Potential issue

🧩 Analysis chain

Replace the placeholder Google Maps API key with a valid key.

The placeholder "YOUR_API_KEY_HERE" will cause Google Maps functionality to fail. This needs to be replaced with a valid API key before deployment.

To ensure the API key is properly configured:

  1. Check if the key exists in environment variables or secure storage
  2. Verify the key has the necessary permissions for iOS Maps SDK

🏁 Script executed:

#!/bin/bash
# Description: Check for potential API key configuration files
# Note: Actual key should not be hardcoded in the source code

echo "Searching for potential API key configuration files..."
fd -t f -e plist -e xcconfig -e env . | grep -i "key\|secret\|config"

Length of output: 336


Action Required: Replace the hardcoded placeholder API key.

The current line in mobile-v3/ios/Runner/AppDelegate.swift still hardcodes "YOUR_API_KEY_HERE", which will cause Google Maps functionality to fail in production. Please update this by one of the following approaches:

  • Use a valid API key: Replace the placeholder with a secure, valid API key that has the necessary permissions for the iOS Maps SDK.
  • Load dynamically from configuration: If the intention is to manage keys via configuration files (e.g., those found in mobile-v3/ios/Flutter/Debug.xcconfig and Release.xcconfig), modify the code to load the API key dynamically from the appropriate config (or from the Info.plist/environment variables) rather than hardcoding it.

Make sure to verify that the final deployed key is secure and correctly configured for your build environment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Mozart299 please review this issue. @Mozart299

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!


pod 'GoogleMaps', '9.0.0'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate GoogleMaps pod declaration.

The GoogleMaps pod is declared twice with different version specifications:

  1. Root level: pod 'GoogleMaps', '9.0.0'
  2. Target level: pod 'GoogleMaps'

This could lead to version conflicts.

Keep only one declaration, preferably in the target block with the specific version:

-pod 'GoogleMaps', '9.0.0'

target 'Runner' do
  use_frameworks!
-  pod 'GoogleMaps'
+  pod 'GoogleMaps', '9.0.0'

Also applies to: 34-34

@@ -1,6 +1,7 @@
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
platform :ios, '15.0'
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify iOS 15.0 platform requirement.

Updating the minimum iOS version to 15.0 might exclude users with older devices. Consider the impact on your user base.

Let's check the iOS version distribution among users:


🌐 Web query:

What is the current iOS version distribution and what percentage of users are still on iOS 14 or lower?

💡 Result:

As of February 2025, Apple’s latest major release iOS 18 dominates device adoption with ~79–80% market share, while iOS 17 accounts for ~14–15%. Older versions like iOS 16 and below now represent less than 6% combined[2][3][4].

Key Distribution Highlights:

  • iOS ≥18: 79–80% (with subversions like iOS 18.1 alone accounting for ~45%)[3][5][9]
  • iOS ≥17: Cumulative adoption reaches ~94–95%, including both major versions[3][10].
  • iOS ≤14: Now represents <1% of active devices[2][4][10].

Breakdown of Older Versions:

Version Adoption (Jan–Feb ’25) Notes
iOS ≤14 <1% Mostly legacy devices like iPhone SE (1st gen), iPhone X[4][10].
iOS ≤16 ~6% Includes devices incompatible with newer OS updates[3][4].

Apple’s aggressive update policies and strong user adoption trends ensure rapid migration to newer OS versions[7][10]. Developers are advised to set minimum deployment targets to iOS ≥16 to cover >96% of active users while leveraging modern APIs[2][7].

Citations:


Action Required: Resolve Deployment Target & Duplicate Pod Declarations

  • iOS Deployment Target:
    The current setting (platform :ios, '15.0') drops support for devices running iOS 14 or below. Based on recent reports, less than 1% of users are on iOS 14 or lower. Although this cutoff may be acceptable, consider whether raising the minimum to iOS 16 could better align with modern API usage and industry best practices.

  • Duplicate GoogleMaps Pod Declarations:
    There are two separate declarations for the GoogleMaps pod:

    • A root-level declaration with an explicit version (pod 'GoogleMaps', '9.0.0')
    • A declaration inside the target block without specifying a version
      These duplications might lead to conflicts. It is recommended to consolidate them into a single, consistent declaration.

Copy link
Collaborator

@Baalmart Baalmart left a comment

Choose a reason for hiding this comment

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

Hi @Mozart299 , I have left a few review comments on your PR, please review them accordingly. Thanks for the great work.


@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GMSServices.provideAPIKey("YOUR_API_KEY_HERE")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Mozart299 please review this issue. @Mozart299

@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>AirQo</string>
<string>Airqo</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Supposed to be AirQo and NOT Airqo.

@Baalmart Baalmart merged commit 1e8c6a3 into staging Feb 20, 2025
31 checks passed
@Baalmart Baalmart deleted the ios-config branch February 20, 2025 17:29
@Baalmart Baalmart mentioned this pull request Feb 20, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants