Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: BB World Delivering old version of the app

Awesome, I think my case looks solver.

 

I guess that issue #1 is caused by cache lag.

 

Regarding #2: thank you, I'm sure it will help a lot of people to deliver better apps.

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: BB World Delivering old version of the app


gbeukeboom wrote:

 

For #2, here is a list of the error messages:

https://developer.blackberry.com/native/reference/bb10/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_r...

 

This error means that a call is in progress when trying to make another call using the Payment Service APIs. All Payment calls must be done sequentially, simultaneous calls are not supported. 


I started to update my code and I found really weird thing: When I use debug mode of PaymentManger then codes are different:

 

Payment System Busy has error code 4, on documentation you shared is error code 2. What is correct? Can I rely o this codes or not?  

 

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB World Delivering old version of the app

The docs are correct.

 

I'm curious though how you managed to reproduce the issue in local/test mode? The calls should be almost instantaneous.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: BB World Delivering old version of the app

I didn't reproduce the error in local testing mode.

 

But I'm logging error codes so I see that when I select response "Payment System busy" then I don't ger error code 2 but 4.

 

How it is possible? I guess  that I can't build any application logic based on these error codes. Correct?

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB World Delivering old version of the app

I would need to see a sample app and know what version of OS and device is being used, in general this sounds like a bug. That being said, creating a mutex so only one call occurs at a time should not be an overly complex issue to account for in code, so the busy error should not be something encountered in real worls scenarios.

 

One possible other cause would be a hang up in the Payment Service itself which could cause errors to come back not related to your app. I haven't seen this myself, just speculating, but you could test if this may be the case by attempting to make any other purchase from another app or BlackBerry World. You wouldn't need to go as far as to make the purchase, just see if the payment service is being responsive.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: BB World Delivering old version of the app

When using local testing mode I'm getting error message "paymentSystemBusy" together with code 4 (in one reply). I'll double check the code to make sure there no shared instance of reply.
--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: BB World Delivering old version of the app

Garett, 

 

I made some adjustments in my app but I'm still getting plenty of reports from my users that they get Payment Service busy error.

 

Here is gist that shows code, I'm using for purchasing

 

https://gist.github.com/anonymous/82ce8dc6f8345e87ae9c

 

Could you please review whether I'm doing something wrong?

 

I'm sorry for disturbing you but it looks like both me and BlackBerry loses money because of this issue.

 

Thanks

Tom

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB World Delivering old version of the app

Did you test in sandbox mode prior to publishing? From your response it sounds as though the new release was pushed live without testing first.

 

I don't see any issues with the code myself, however it really depends on how your UI handles the requests. I could not see any MUTEX logic in place, so it is conceivable that the app still allows multiple calls to occur simultaneously.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Re: BB World Delivering old version of the app

I just tried to test it and I found following:

 

1) I download app from BB World

2) Then I invoke method purchase() (by clicking on button) from attached code

3) Then it fails with BB Connection Error 2

4) Then when I click on Restore purchase then it starts method checkStatus() then it takes some time and it looks like something happens because then method purchase() works well

 

Regarding MUTEX: I'm sorry but I don't understand what do you mean. I don't think that there is thread safety issue as payment manager is called always once.

 

I can give you to list of testers and you can try it by yourself without need of buying my app. 

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: BB World Delivering old version of the app


thubalek wrote:

 

Regarding MUTEX: I'm sorry but I don't understand what do you mean. I don't think that there is thread safety issue as payment manager is called always once.


The payment service only supports one call per app at a time, so if your code happens to attempt/allow more than one call at a time then it opens up potential for failures, such as the "busy" error.

 

Does your app happen to check for existing purchases when it first launches?

Garett
@garettBeuk
--
Goodbye everybody!