-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
getAvailablePurchases() not getting resolved on iOS 16 #1984
Comments
@Mi6u3l when trying |
@andresesfm I did not. Apologies if it was a requirement and I missed it. |
Please help us test the recently released |
Running into the same issue here. I have just upgraded to I have imported the named export I have then called setup({ storekitMode: 'STOREKIT2_MODE' }); very early in my App.tsx and before wrapping my app in the I am then using the following App.tsx (simplified): import { getAvailablePurchases, setup, useIAP, withIAPContext } from 'react-native-iap';
setup({ storekitMode: 'STOREKIT2_MODE' });
const App = () => {
const { connected } = useIAP();
const loadSubscriptions = useCallback(async () => {
if (connected) {
await getAvailablePurchases();
}
}, [connected]);
useEffect(() => {
loadSubscriptions();
}, [loadSubscriptions]);
return null;
}
export default withIAPContext(App); Once I do that I get a fat red native exception:
Anything I'm doing wrong here? I'm testing on a real iPhone 13 with iOS 16, XCode 14, React Native 0.68.2 |
That looks correct @manuelbieh . (Thank you for the PR) I will have a look |
I double checked and created this minimum reproducible example in my app folder to sort out possible side effects and I still get the error there: import { useCallback, useEffect } from 'react';
import { getAvailablePurchases, setup, useIAP, withIAPContext } from 'react-native-iap';
setup({ storekitMode: 'STOREKIT2_MODE' });
// setup({ storekitMode: 'STOREKIT_HYBRID_MODE' });
const App = () => {
const { connected } = useIAP();
const loadSubscriptions = useCallback(async () => {
if (connected) {
await getAvailablePurchases();
}
}, [connected]);
useEffect(() => {
loadSubscriptions();
}, [loadSubscriptions]);
return null;
};
export default withIAPContext(App); that's my complete RN app at this point and I'm getting the error as described above. Other calls like |
We're also running into this problem on iOS 16 with version 10.1.3, so I tried to build our master branch, which uses 7.5.6: Similar behaviour. So right now we can't release an update and I wonder if this might still work with a different library version? I hope this can somehow be fixed soon (we would help, but our insights are very minimal, especially on the native side of things). |
A small side note that might not really be useful. We do have one TestFlight user on iPhone 12 mini with iOS 16 who is able to start the application. So my guess is that this bug is somewhat related to the App Store user itself. But again - just a wild guess. |
For me, it works in production. But not on development or Testflight |
Fix for reported crash: #1988 |
Released fix as part of |
Experiencing the same symptoms on 7.5.1 Blocked doing any releases until we figure out whats going on. Id love to try the v11 alpha but our react native version will not support it |
@andresesfm Thank you very much! So we need to migrate from 10 to 11 or is this also fixable for version 10? |
yeah edit: porting to a new version changes the positional parameters to object parameters - thanks @manuelbieh. Though a good practice is to release first a version that supports both ( also thanks @derRaab for the tip - I had to remove and add again the sandbox account on the device, what helped in the end was to raise the minimal iOS (target version) - probably because Storekit2 works on 15+... |
@Aiosa you should check the 10.0.0 migration guide. |
@Aiosa For me it does resolve now in version |
That would be a nice contribution to the project @Aiosa |
@andresesfm Thanks for your great work! It's kind of weird, but with |
@andresesfm After many days of refactoring and analysing we are still experiencing this kind of problem, but the circumstances become a little more clear now. Maybe there is now a way to understand this a little more? We are only using only This is something I can now reproduce and I hope you can too: Invoking I tested with all boolean combinations of alsoPublishToEventListener and automaticallyFinishRestoredTransactions. Side note: If I try to purchase a product without a logged in sandbox user, the app will request to log into an Apple-ID, so I would expect to trigger such a dialog for getAvailablePurchases() as well. OR at least the api throws an error we can handle within the app. I assume somewhere in the library code the execution stops if no app store user is available to restore purchases from? We are experiencing this non resolving problem mainly with TestFlight users and this is very hard to debug, because not all users have that problem. Maybe you can look into this again? Environment: react-native-iap: 12.0.3 |
@derRaab can you please post some (native) logs of when that occurs?
or
|
@andresesfm Unfortunately none of them did appear in my logs. A colleague on the other hand did receive it only once. 🤦🏻 I'm still investigating... |
Doing some research on this I found the following:
from: So it might not be an issue in production. We can reopen if this doesn't apply in your case. Please consider supporting the project via Ko-fi or patreon. Thank you |
Description
getAvailablePurchases() is not resolving on iOS 16.
It is working fine on iOS 15 and 15.5.
Expected Behavior
getAvailablePurchases() should return a success or error response
Environment:
react-native-iap: 10.1.3 and 11.0.0-rc.3
react-native: 0.67.0
Platforms iOS (any simulator with iOS 16) tested on physical device iPhone 13 mini device (iOS 16)
The text was updated successfully, but these errors were encountered: