MCPcopy Create free account
hub / github.com/M66B/NetGuard / getPurchases

Method getPurchases

app/src/main/java/eu/faircode/netguard/IAB.java:143–155  ·  view source on GitHub ↗
(String type)

Source from the content-addressed store, hash-verified

141 }
142
143 public List<String> getPurchases(String type) throws RemoteException {
144 // Get purchases
145 Bundle bundle = service.getPurchases(IAB_VERSION, context.getPackageName(), type, null);
146 Log.i(TAG, "getPurchases");
147 Util.logBundle(bundle);
148 int response = (bundle == null ? -1 : bundle.getInt("RESPONSE_CODE", -1));
149 Log.i(TAG, "Response=" + getResult(response));
150 if (response != 0)
151 throw new IllegalArgumentException(getResult(response));
152
153 ArrayList<String> details = bundle.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
154 return (details == null ? new ArrayList<String>() : details);
155 }
156
157 public PendingIntent getBuyIntent(String sku, boolean subscription) throws RemoteException {
158 if (service == null)

Callers 2

updatePurchasesMethod · 0.95
isPurchasedMethod · 0.95

Calls 2

logBundleMethod · 0.95
getResultMethod · 0.95

Tested by

no test coverage detected