Skip to content

Conversation

@brightdev0404
Copy link

@brightdev0404 brightdev0404 commented Oct 30, 2025

Summary

This pull request fixes an issue in the Android implementation where the Kotlin method toLowerCase() was used to normalize the file extension before retrieving its MIME type.
In newer Kotlin versions, toLowerCase() has been deprecated in favor of lowercase(), which is locale-safe and avoids potential runtime warnings or compatibility issues.

Motivation

When using this library with modern Android projects (Kotlin 1.5+), the deprecated toLowerCase() method can trigger compilation warnings or even cause build failures depending on lint settings.
Replacing it with lowercase() ensures forward compatibility and adheres to Kotlin best practices.

Implementation

  • Replaced:
    extension.toLowerCase()
    with:
    extension.lowercase()
  • No functional behavior changes — only improves code safety and compatibility.

Impacted area

  • Android uploader module (UploadTask.kt or equivalent file)
  • MIME type detection logic

Test Plan

What's required for testing (prerequisites)?

  • Android project with Kotlin 1.9+
  • React Native project using react-native-background-upload

What are the steps to reproduce (after prerequisites)?

  • Install the current version of the library on a project using Kotlin 1.9 or later.
  • Observe compiler warnings or errors related to toLowerCase() deprecation.
  • Apply this PR and rebuild the project.
  • Confirm the warning is gone and uploads still function as expected.

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)
  • I've added Detox End-to-End Test(s)
  • I've created a snack to demonstrate the changes: LINK HERE

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.

1 participant