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

[LOCAL] Fabric Interop - Properly dispatch integer commands (#38527) #38835

Merged
merged 1 commit into from
Aug 8, 2023

Commits on Aug 8, 2023

  1. Fabric Interop - Properly dispatch integer commands (#38527)

    Summary:
    Pull Request resolved: #38527
    
    This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching.
    (See terrylinla/react-native-sketch-canvas#236)
    
    The problem is that libraries that were receiving commands as ints with:
    ```
    public void receiveCommand(
          int surfaceId, int reactTag, int commandId, Nullable ReadableArray commandArgs) {
    ```
    
    would not receive command with the Fabric Interop for Android.
    
    The problem is that with Fabric, events are dispatched as string always.
    cipolleschi took care of this for iOS, but we realized that the Android part was missing. I'm adding it here.
    
    The logic is, if the event is dispatched as a string that represents a number (say `"42"`) and the user has Fabric Interop enabled, then we dispatch the event as `int` (so libraries will keep on working).
    
    Changelog:
    [Android] [Fixed] - Fabric Interop - Properly dispatch integer commands
    
    Reviewed By: cipolleschi
    
    Differential Revision: D47600094
    
    fbshipit-source-id: c35f0509e6c6c0cddc7090a069882f92dd95532e
    cortinico committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    ee297a1 View commit details
    Browse the repository at this point in the history