Closed brian-wagerlab closed 7 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", ...}.
src/public/RestorationResult.ts
toJson()
{result: "restored"}
{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.
RestorationResult.fromJson()
type
result
This should be addressed in the src or in the iOS code as android already expects the correct key of result
Thanks for reporting, this is now fixed in the latest release v1.1.0
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) thetoJson()
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 keytype
, notresult
.This should be addressed in the src or in the iOS code as android already expects the correct key of
result