MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / startConnection

Method startConnection

src/plugins/iap/src/com/foxdebug/iap/Iap.java:169–193  ·  view source on GitHub ↗
(CallbackContext callbackContext)

Source from the content-addressed store, hash-verified

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,

Callers 1

runMethod · 0.95

Calls 3

getBillingClientMethod · 0.95
startConnectionMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected