10-29-2024 03:10 AM
I have a subscription setup and its checkoutflow seems to be working perfectly as expected, but when i try to fetch the viewers purchases at the start of the game it returns PurchaseList with the count of 0 although they certainly seemed to have the purchased product (in this case its a re-accuring monthly/yearly subscription) so how can I fix that issue? Any help in this regard is highly appreciated
Note: This issue was occuring when tested production build with real users. The SKU ids and everything else is checked properly.
Here is the example implementation:
private void StartOfTheGame() {
IAP.GetViewerPurchases().OnComplete( HandlePurchaseListResponse );
}
private void HandlePurchaseListResponse( Message<PurchaseList> msg ) {
if( msg.IsError ) {
LogAssertion( $"Error: {msg}" );
return;
}
hasSubscription = false;
Log( $"purchase list count: {msg.GetPurchaseList().Count}" ); // This returns 0 as a result hence the for loop doesn't even start although I have made sure that the user do have the product purchased
if( msg.GetPurchaseList().Count <= 0 ) {
_currentAttempts++;
if( _currentAttempts >= _initializationMaxAttempts ) return;
IAP.GetViewerPurchasesDurableCache().OnComplete( HandlePurchaseListResponse );
Log( $"No purchases found, tyring to get cache purchases" );
return;
}
foreach( Purchase p in msg.GetPurchaseList() ) {
LogPurchasedProductDetails( p );
if( p.Sku is ProSubscriptionYearlySKU or ProSubscriptionSixMonthSKU or ProSubscriptionMonthlySKU ) {
SetSubscriptionAsActive( p );
}
}
if( !hasSubscription ) {
Log( "Pro subscription not active." );
}
}
10-31-2024 03:38 AM
No one has anything on this?
11-05-2024 01:58 AM
Why the forums here are so dead... hello??? Anyone????????????????????????????????
02-11-2025 06:08 PM
@LemeSherry I have the same problem.
Please let me know if you have solved it.
02-12-2025 01:42 AM
surely @strplay, although it has been more then 3 months since I reported this issue, I also had a talk with technical team as well but everyone seems to be answer the same exact answers which at the moment of writing this doesn't work for me, and everything else is setup correctly from my side as well, but anyways lets see how it goes.