superwall / react-native-superwall

Remotely configure every aspect of your paywall and double your revenue.
MIT License
10 stars 0 forks source link

React Native RestorationResult is Expecting the Wrong Key in iOS #2

Closed brian-wagerlab closed 3 months ago

brian-wagerlab commented 3 months ago

When attempting to restore purchases in react-native, in the file src/public/RestorationResult.ts (https://github.com/superwall/react-native-superwall/blob/main/src/public/RestorationResult.ts#L15) the toJson() functions return the objects as either {result: "restored"} or {result: "failed", ...}.

However, in the iOS code (https://github.com/superwall/react-native-superwall/blob/main/ios/Json/RestorationResult%2BJson.swift#L9), the RestorationResult.fromJson() function is expecting the object to have key type, not result.

This should be addressed in the src or in the iOS code as android already expects the correct key of result

yusuftor commented 3 months ago

Thanks for reporting, this is now fixed in the latest release v1.1.0