(CallbackContext callbackContext)
| 167 | } |
| 168 | |
| 169 | private void startConnection(CallbackContext callbackContext) { |
| 170 | try { |
| 171 | if (billingClient == null) { |
| 172 | billingClient = getBillingClient(); |
| 173 | } |
| 174 | billingClient.startConnection( |
| 175 | new BillingClientStateListener() { |
| 176 | public void onBillingSetupFinished(BillingResult billingResult) { |
| 177 | int responseCode = billingResult.getResponseCode(); |
| 178 | if (responseCode == BillingResponseCode.OK) { |
| 179 | callbackContext.success(responseCode); |
| 180 | } else { |
| 181 | callbackContext.error(responseCode); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | public void onBillingServiceDisconnected() { |
| 186 | callbackContext.error("Billing service disconnected"); |
| 187 | } |
| 188 | } |
| 189 | ); |
| 190 | } catch (SecurityException e) { |
| 191 | callbackContext.error(e.getMessage()); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | private void getProducts( |
| 196 | List<String> idList, |
no test coverage detected