thebergamo / react-native-fbsdk-next

MIT License
633 stars 165 forks source link

feat: add support for new architecture in compatibility mode #505

Closed gabrieldonadel closed 3 weeks ago

gabrieldonadel commented 1 month ago

Summary

This PR adds Android and iOS support for the new architecture relying on the compatibility layer.

On Android

two main changes were required for this to work:

  1. Remove static from all functions annotated with @ReactMethod given that in bridgeless it would throw the following error

  2. Use the event dispatcher to send events from the native side to JS and adding a RCTLoginButtonEvent class

On iOS

Had to create a dedicated class for the RCTFBSDKLoginButton view in order to export the onChange view property of type RCTBubblingEventBlock and declare this property on the UIView wrapping the button (FBSDKLoginButton is a final class and can't be extended)

Test Plan:

Locally run refresh-example to update to the latest RC and tested Android and iOS on the old and new architectures

https://github.com/thebergamo/react-native-fbsdk-next/assets/11707729/891ab1aa-23c5-4ee0-a5e5-cb1ebee31700

https://github.com/thebergamo/react-native-fbsdk-next/assets/11707729/8fec570b-23b5-49f4-84bd-093ad2c60b57

github-actions[bot] commented 3 weeks ago

:tada: This PR is included in version 12.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: