Fix: Correct onBind method signature to match android.app.Service in MusicService.kt
Summary
This PR fixes a Kotlin compilation error in MusicService.kt related to the onBind method signature.
Problem
The existing code attempted to override:
override fun onBind(intent: Intent?): IBinder
However, the Android Service class defines:
public abstract IBinder onBind(Intent intent)
Due to Kotlin's strict override checks, the mismatch causes:
'onBind' overrides nothing.
Fix Updated the signature to match the exact expected method:
@MainThread
override fun onBind(intent: Intent): IBinder {
return binder
}
+1 for now i adde dthe patch-package
Would be great to get this approved and released if possible.
2 months is a long time to sit on a pull request to remove a redundant question mark. This is blocking compatibility with Expo SDK 53 / React Native 0.79.
https://github.com/doublesymmetry/react-native-track-player/issues/2455
this might in turn breaks RN < 0.79, could someone test?
this is caused by the kotlin rewrite of HeadlessJsTaskService.
@lovegaoshi All that question mark means in Kotlin is Intent is a nullable type. It's overwriting a java super method where Intent is not nullable. The only reason why this breaks RN 0.79 (at least with expo 53) is because they are using the latest Android plugins that are now super strict about nullable type mismatches. But obviously pretending a non-nullable is nullable is completely harmless, which is why it has been permitted by Android until now.
tl;dr this will absolutely not break RN < 0.79. It's just fixing a super (no pun intended!) pedantic typing error.
Sorry this has taken so long!