Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Impossible to use Payment Service - getExistingPurchases => onFailure always crashes the app #673

Open
Kra-Kra opened this issue Jul 3, 2013 · 12 comments

Comments

@Kra-Kra
Copy link

Kra-Kra commented Jul 3, 2013

observed on: dev alpha b, OS 10.1.0.1485, WebWorks SDK 1.0.4.11, production environment (app is published in App World)

app calls

blackberry.payment.getExistingPurchases(true, onSuccess, onFailure);

a couple of seconds after framework calls the onFailure callback, app becomes unresponsive and some time later it "disappears" (it is closed by the OS).

Sample code can be found in documentation:

https://developer.blackberry.com/html5/api/blackberry.payment.html#.getExistingPurchases^2

** Update: **
Same problem is observed for the following API call:

blackberry.payment.checkExisting

In short - it is currently not possible to use Payment Service from within bb10 WebWorks app.

@Kra-Kra
Copy link
Author

Kra-Kra commented Jul 3, 2013

Update: I was not able to reproduce this issue on
OS 10.0.10.261
OS 10.2 (probably 10.2.0.341)

It seems to be specific to OS 10.1

@jeffheifetz
Copy link
Contributor

@scdowney Are you still the man to look into this?

@scdowney
Copy link

scdowney commented Jul 4, 2013

—Reply to this email directly or view it on GitHub.

@Kra-Kra
Copy link
Author

Kra-Kra commented Jul 8, 2013

Update - further tests show that application frozes only after alert() / dialog.standardAskAsync() is called

i.e. if you ignore the response from getExistingPurchases => onFailure, app remains responsive and everything works fine. But once you call alert() app becomes frozen and couple of seconds later is closed by the OS.

Maybe this is some kind of event / event loop issue ?

@scdowney
Copy link

scdowney commented Jul 8, 2013

@jeffheifetz, @cdelcol

That update sounds like PR315668 (JIRA 89977). Quick look seems like it was no longer reproducible on 10.1.1693? Can we re-test on that build perhaps?

@Kra-Kra
Copy link
Author

Kra-Kra commented Jul 8, 2013

That update sounds like PR315668 (JIRA 89977).

Are there any public links where I can review those issues ?
"Quick Search" in https://www.blackberry.com/jira/secure/Dashboard.jspa does not work for me ...

@scdowney
Copy link

scdowney commented Jul 8, 2013

I'm not sure there is a public link, I believe it might be on an internal Jira instance.

@Kra-Kra
Copy link
Author

Kra-Kra commented Jul 8, 2013

Update - we got a copy of payment extension from

https://github.com/blackberry-webworks/BB10-WebWorks-Framework/tree/44835cac5cf9a8193b2ba2eb3d98fa3abe8fcd07

amd modified it to execute the InvokeMethod logic in a separate thread - and everything seems to work fine now (dev alpha b / 10.1.0.1485). Below is an example on what we have done:

std::string Payment::InvokeMethod(const std::string& command)
{
  theCommand = command;
  StartProcessingThread(); // starts a separate thread that executes the actual InvokeMethodImpl and sets the result
  while (true) {
    sleep(1);
    if (gotResult)
      return theResult;
  }
}

Questions:
Q1. Does the repository mentioned above contain the sources for the latest version of payment extension (SDK 1.0.4.11).
Q2. Is there anything we should be worried about if we want to publish our app with this workaround (we are not very familiar with WebWorks extensions).

@jeffheifetz
Copy link
Contributor

@scdowney I believe you are correct about the two issues being the same.

@Kra-Kra The internal issue never had a fix put in for it, but the issue was resolved in later builds. You'll note here (http://en.wikipedia.org/wiki/BlackBerry_10) that the version you were testing on does not appear to be released to customers.

@Kra-Kra
Copy link
Author

Kra-Kra commented Jul 11, 2013

We see In-App purchase requests from many different variants of OS 10.1

Below is incomplete list of OS 10.1 versions observed in the "wild" for which our app refused to initiate In-App purchase
(note: OS version is reported by blackberry.system.softwareVersion):

10.1.0.1483
10.1.0.1720
10.1.0.2025
10.1.0.2050
10.1.0.2121
10.1.0.2342
10.1.0.2354
10.1.0.4537

Unfortunately, we cannot ask the user to upgrade his device software in order to perform In-App purchase in our app - we need solution which works for everybody.

Can somebody please check and let us know if our workaround with different thread is ok ? Or should we expect some nasty side effects ?

We plan to release an update of the app with this workaround on Monday, it'd be nice if somebody can review it before that.

Thanks !

@Kra-Kra
Copy link
Author

Kra-Kra commented Jul 22, 2013

Hello,

Can somebody from WebWorks team please answer the following questions:

Q1. Where can we get the latest sources for Payment extension. We found a copy here:

https://github.com/blackberry-webworks/BB10-WebWorks-
Framework/tree/44835cac5cf9a8193b2ba2eb3d98fa3abe8fcd07

but it does not seem "official"

Q2. Should we expect any issues if we run InvokeMethod() logic in a separate thread ?

We plan to publish new version of the app tomorrow and we'd like to receive feedback on those two questions in next 24 hours.

Thanks !

@jeffheifetz
Copy link
Contributor

Q1. The newest code can be found here - https://github.com/blackberry-webworks/BB10-WebWorks-Framework/commits/next . Its only an administrative error that this hasn't been merged into master.

Q2. I really don't know what the possible effects are, especially considering the fact that the code largely seems synchronous atm. @scdowney Any possible effects for the payment code specifically?

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

No branches or pull requests

3 participants