Purchasely / Purchasely-ReactNative

Other
13 stars 2 forks source link

New Arch support #130

Open PierreCapo opened 1 month ago

PierreCapo commented 1 month ago

Hello, I have tried migrating my app to the new architecture, and faced some issues with the Purchasely library. It looks like some functions were not exported anymore. After having a look at the source code of this library, it looks like the library is having an issue in the following lines: https://github.com/Purchasely/Purchasely-ReactNative/blob/0cdfa1ff26410b4eb7ad4828d8009832ed07e5dd/purchasely/src/index.ts#L697-L699

It looks like it's linked to spreading the RNPurchasely object, but I tried quickly to apply this solution defined below but it didn't work. See https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-libraries.md#javascript-xyz--is-not-a-function-it-is-undefined for more details. At the end of the day, a non-optimal but quick fix was to redefine the functions not exported (userLogin, userLogout, etc.) as you did with these ones:

https://github.com/Purchasely/Purchasely-ReactNative/blob/0cdfa1ff26410b4eb7ad4828d8009832ed07e5dd/purchasely/src/index.ts#L699-L720

Please note that the new arch will be enabled by default in React-Native 0.75, which means Purchasely won't work anymore on new react-native projects in a few days (most likely 0.75 will be released during the incoming weeks).

chouaibMo commented 1 month ago

hi @PierreCapo Thank you for bringing this to our attention, and for your suggestions, we truly appreciate it. We're currently working on updating the SDK to ensure it supports apps built on the new architecture. These updates will be included in a release scheduled for the next few days or weeks.

Best regards, Chouaïb from Purchasely