3.5.1
0.61.1
Android for now
It should returns subscriptions info just like the old version of RNIAP (old version was 2.4.1)
It shows error Cannot read property 'getItemsByType' of undefined
Android Real Device (Debug Mode)

endConnection to endConnectionAndroid, buySubscription to requestSubscriptionRNIap.getSubscriptions(itemSkus), then receive the above errorWithout additional information, it feels pretty hard to help you out. Would you like to try out for example project and see the differences compared to yours?
Also, please use 3.5.2 or later because below versions had some typing issues #740.
I got similar issues, it seems to me that autolinking is broken for android starting version 3.5.x.
@benoitvallon Could you try example project? I've tested this before releasing and the build didn't matter.
Hi @hyochan, I just upgraded to 3.5.2, and getSubscriptions function is working fine now, thanks a lot!! However, because I migrated from the old version 2.4.1 to 3.5.2, so I need to migrate to the new flow of purchasing the subscriptions right?
Could you please help me to confirm several things about the new flow, I'll very appreciate:
Currently, my app is using subscriptions only (no item purchase), based on the example folder, is this one the new flow for subscriptions:
initConnection --> purchaseUpdatedListener --> purchaseErrorListener --> getSubscriptions to display price and info of subs --> user request a sub --> call requestSubscription with corresponding id --> if requestSubscription succeed, thepurchaseUpdatedListener receives purchase receipt --> send receipt to my backend to update the user's premium info --> If backend response succeed --> acknowledgePurchaseAndroid (for android), and finishTransactionIOS (for iOS) --> clear function subscriptions when component unmount
Error Cases:
requestSubscription failed, then purchaseErrorListener will receive an error, then the only thing I need to do in this case is displaying the error for user right?purchaseUpdatedListener --> then the next time I go to the app, whereover I call the purchaseUpdatedListener, this listener will immediately receive the old receipt of my previous subscription request right? Then I need to re-request my API to finalize the sub purchase, is it correct?Please correct me if I'm missing something, or I use the wrong functions for my flow, thanks a lot
@hyochan after a project cleaning and using 3.5.2 I made it work again. Thanks
Hi @hyochan, I just upgraded to
3.5.2, andgetSubscriptionsfunction is working fine now, thanks a lot!! However, because I migrated from the old version2.4.1to3.5.2, so I need to migrate to the new flow of purchasing the subscriptions right?Could you please help me to confirm several things about the new flow, I'll very appreciate:
Currently, my app is using subscriptions only (no item purchase), based on the example folder, is this one the new flow for subscriptions:
initConnection-->purchaseUpdatedListener-->purchaseErrorListener-->getSubscriptionsto display price and info of subs --> user request a sub --> callrequestSubscriptionwith corresponding id --> ifrequestSubscriptionsucceed, thepurchaseUpdatedListenerreceivespurchase receipt--> sendreceiptto my backend to update the user's premium info --> If backend response succeed -->acknowledgePurchaseAndroid(for android), andfinishTransactionIOS(for iOS) --> clear function subscriptions when component unmountError Cases:
- If for example, the
requestSubscriptionfailed, thenpurchaseErrorListenerwill receive an error, then the only thing I need to do in this case is displaying the error for user right?- If the request to my server is having error, or app crashes at the time I receive the receipt in the
purchaseUpdatedListener--> then the next time I go to the app, whereover I call thepurchaseUpdatedListener, this listener will immediately receive the old receipt of my previous subscription request right? Then I need to re-request my API to finalize the sub purchase, is it correct?Please correct me if I'm missing something, or I use the wrong functions for my flow, thanks a lot
receipt you can't retrieve in ios. Therefore, you should becareful with this. Also if you don't finishTransaction or acknowledgePurchase it won't get charged. I mean it will be refunded in 3 days.@hyochan Thanks a lot for the info
Please see my updated sentence at the end which says that it will be refunded.
Most helpful comment
@hyochan after a project cleaning and using
3.5.2I made it work again. Thanks