[Solved] store.canMakePurchases problem

I am setting up IAP in one of my apps and currently Im having some trouble with giving the user feedback when he cant purchase the product. Like if he has the option for IAP turned off. This is for iOS by the way.

I have setup a check:

if store.canMakePurchases then   
 store.purchase( {validProducts[1]} )   
else  
 native.showAlert("Store purchases are not available, please try again later.", { "OK" } )  
end   

This works just fine if I have enabled IAP on my phone and everything else works as its should like. But if I turn the option to buy IAP off nothing happens when I tap the button. I dont get the alert message. Should I not have gotten that popup then? or is there some other thing I need to check for? [import]uid: 17969 topic_id: 26700 reply_id: 326700[/import]

No one else has experienced this issue before? Just cant seem to find what it could be that is wrong. I havent yet tried the stable build or other daylie builds, will try and do this as well. Any tips is much appriciated since its stuck there until I can fix some kind of feedback to the customer that he cant use in app purchase on his device. [import]uid: 17969 topic_id: 26700 reply_id: 108486[/import]

I will give it a try tomorrow and tell you about the outcome. [import]uid: 90610 topic_id: 26700 reply_id: 108489[/import]

Are you on Google/Android or iOS? I think Google behaves differently and there really is no way to get this information (with a few exceptions) without actually trying to make the purchase. Expect that the function will return true if it can’t be determined and present the error after the purchase fails.

On iOS, I think it is only disabled if parental locks to disable purchasing are set.

[import]uid: 7563 topic_id: 26700 reply_id: 108565[/import]

@dingo
thanks! will also keep trying to figur out where the problem lies.

@ewing
its for IOS and its with the parental lock that I have tried since many has turned off the option for IAP. I also have an alert for transaction.state failed. I guess I could also put in something if none of the transaction states falls through… [import]uid: 17969 topic_id: 26700 reply_id: 108597[/import]

Update:
Ok, so I found out what the problem was… my alert sentence was to long. And corona dosent give an error it just dosent display it. So I divided it up. So if anyone else is experiencing that their alert dosent show that might be the case :slight_smile: [import]uid: 17969 topic_id: 26700 reply_id: 109027[/import]