Skip to content
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

Fix empty subscriptions list by removing filter #2187

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

andresesfm
Copy link
Contributor

@andresesfm andresesfm commented Jan 5, 2023

Filtering makes it impossible to get non-renewable subscriptions: #2176

@andresesfm andresesfm merged commit 12d0663 into hyochan:main Jan 5, 2023
@andresesfm andresesfm deleted the remove_type_filtering_ios branch January 5, 2023 23:15
@Dallas62
Copy link
Contributor

Dallas62 commented Jan 6, 2023

Hi,

Not sure if this is working.
Receiving: {"platform":"ios"}

@venux92
Copy link

venux92 commented Jan 9, 2023

@andresesfm Since updating to 12.4.12 I'm getting an issue in my code.

Now getProducts returns
[{}, {"countryCode":......}]
With an empty object as the first element {}

before in 12.4.11 it was returning
[{"countryCode":......}]

Just to mention. I only have one in-app product non-consumable

Changing

return items;

back to

return items.filter(
  item: Product) =>
       skus.includes(item.productId) && item.type === 'iap',
   );

fixes it.

@andresesfm
Copy link
Contributor Author

@Dallas62 That's strange, is it all you are getting back? or do you get an additional item with that value?

@andresesfm
Copy link
Contributor Author

@venux92 can you please post how you are calling the method? maybe you are passing an empty element in the array?

@Dallas62
Copy link
Contributor

@andresesfm It's the first item of a list of three. when I request 2 subscriptions by SKU (same group).

@andresesfm
Copy link
Contributor Author

I will take a look

andresesfm added a commit that referenced this pull request Jan 11, 2023
andresesfm added a commit that referenced this pull request Jan 11, 2023
* Revert "Fix empty subscriptions list by removing filter (#2187)"

This reverts commit 12d0663.

* Update iap.ts

only filter on sku

* lint
@andresesfm
Copy link
Contributor Author

released the fix on 12.4.13

@Basil-Code
Copy link

@andresesfm It's not yet fixed. getSubscriptions is returning an empty array in ios.

@andresesfm
Copy link
Contributor Author

@andresesfm It's not yet fixed. getSubscriptions is returning an empty array in ios.

Please open a ticket with the details.

@venux92
Copy link

venux92 commented Jan 13, 2023

@andresesfm I updated to the latest version 12.4.14 and I can confirm it works now. (Android & iOS)
I'm using getProducts

To reply to your question

@venux92 can you please post how you are calling the method? maybe you are passing an empty element in the array?

I had only one product so I was passing skus: [com.myapp]

Thanks

@wxrhead
Copy link

wxrhead commented Feb 29, 2024

@andresesfm I updated to the latest version 12.4.14 and I can confirm it works now. (Android & iOS) I'm using getProducts

To reply to your question

@venux92 can you please post how you are calling the method? maybe you are passing an empty element in the array?

I had only one product so I was passing skus: [com.myapp]

Thanks

Hi. I am getting empty array using both getProducts and getSubscriptions. Can you please help or share the code? I am stuck on it from 2 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants