-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Crash when trying to purchase #389
Comments
Hi, I'm also having this issue with a real device with IOS 9.2. Is there a chance to get this fixed soon or maybe a solution that we can implement? |
i could solve it y my self. Just change this line
with Hope it helps :D |
Oh I'll try this later. Can you make a PR please ? |
Actually doing it that way the exception isn't throwed but it cannot be parsed by the javascript. I'm working on it currently. Wait for a new update soon. |
Arf. I really need this fix... Anyone ? |
I made it work adding some validations. Please use the code below under your own responsibility. replace: with: And hope it helps. Worked for me. |
If it works it's awesome. Thanks a lot ! |
The error is gone but I still get |
Nope, forget it. It works \o/ |
Well I shouldn't close it since the fix should be added to the plugin @j3k0 |
Can you please submit a Pull Request if there's any code to merge into the While I haven't been handling GitHub issues for a while, I still maintain On Wed, Feb 3, 2016 at 11:40 PM Michel Parpaillon notifications@github.com
|
Well I can if you want, but I'm not a iOS developer. Maybe there's a cleaner/smarter way of doing it. If it's good enough for you I'll make a PR |
This fix is working for me |
We are testing the fixes provided by @davidzas and @electronicmax to see if it helps the crash issue we are seeing in our app. The thing that is confusing is why I don't see the problem on my local phone builds, but it is seen on other phone builds (iPhone5 vs. iPhone6 with iOS8 vs. iOS9). I will let you guys know if it addresses our problems. The problem is stemming from here in InAppPurchase.m:
The main issue is the line: The respondsToSelector evaluates to FALSE because it cannot find the selector JSONString in the NSDictionary type. NSDictionary would not have this type unless you are including the SBJson json-framework in the app (which we are not). Since it evaluates to FALSE, it then assumes JSONRepresentation is present, which it also is not if you have not installed json-framework. My questions are:
|
In our testing, if you take the official version of the plugin (via cordova plugin add cc.fovea.cordova.purchase), then there is no problem. We only saw this issue when taking master from git. |
Missed a few additional spots where same fix needed to be applied. See j3k0#389
|
So what is the definite fix for this? Would anyone mind to create a pull request? |
@j3k0 Could you see my questions above? The proposed fix may address the issue, but I'm a bit concerned on why this code was there in the first place and how it was working before (but not now) |
The offender: |
Thanks @mlmassey! The json error is gone. However I've got the same error as @mparpaillon mentioned above in the 9.2 simulator:
The store is properly initiated in the app and I can see all data are correctly downloaded from the appstore. The error happens when I try to use an existing AppleID (tap the menu item) or try to create a new one. Any ideas please? I'm a newbie on iOS. |
I don't think you can test in-app purchase in the simulator. You need to use a real phone |
Thanks @mlmassey. When I saw the app in simulator gets info from the Appstore I thought purchases would also work. I tested on iPhone device and everything works perfectly. Thank you! |
Why not just use Apple own JSON routines. Then the code will work with both old and new Cordova. See Pull request #419 for a fix. |
@steffanolesen Yupper. That is the proper fix. Nicely done. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi ! :)
When I launch my app on iPhone 6 simulator (iOS 9) I can't purchase my item.
Here are the logs:
Any idea ?
Thanks a lot
The text was updated successfully, but these errors were encountered: