mirror of
https://github.com/defold/extension-iap
synced 2025-09-28 01:22:19 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f398677d7b | ||
|
d1c4e88562 | ||
|
6f06d7f08f | ||
|
0852e42977 | ||
|
ba0e1b645a | ||
|
801179288e | ||
|
195ef400b5 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,3 +9,5 @@ Thumbs.db
|
|||||||
.cproject
|
.cproject
|
||||||
builtins
|
builtins
|
||||||
_site
|
_site
|
||||||
|
manifest.private.der
|
||||||
|
manifest.public.der
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
dependencies {
|
repositories {
|
||||||
implementation 'com.android.billingclient:billing:5.0.0'
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'com.android.billingclient:billing:6.2.1'
|
||||||
}
|
}
|
||||||
|
@@ -31,6 +31,7 @@ enum BillingResponse
|
|||||||
BILLING_RESPONSE_RESULT_ERROR = 6,
|
BILLING_RESPONSE_RESULT_ERROR = 6,
|
||||||
BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7,
|
BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7,
|
||||||
BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8,
|
BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8,
|
||||||
|
BILLING_RESPONSE_RESULT_NETWORK_ERROR = 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ProviderId
|
enum ProviderId
|
||||||
|
@@ -221,7 +221,6 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
case BillingResponseCode.OK:
|
case BillingResponseCode.OK:
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_OK;
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_OK;
|
||||||
break;
|
break;
|
||||||
case BillingResponseCode.SERVICE_TIMEOUT:
|
|
||||||
case BillingResponseCode.SERVICE_UNAVAILABLE:
|
case BillingResponseCode.SERVICE_UNAVAILABLE:
|
||||||
case BillingResponseCode.SERVICE_DISCONNECTED:
|
case BillingResponseCode.SERVICE_DISCONNECTED:
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE;
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE;
|
||||||
@@ -229,6 +228,9 @@ public class IapGooglePlay implements PurchasesUpdatedListener {
|
|||||||
case BillingResponseCode.USER_CANCELED:
|
case BillingResponseCode.USER_CANCELED:
|
||||||
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_USER_CANCELED;
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_USER_CANCELED;
|
||||||
break;
|
break;
|
||||||
|
case BillingResponseCode.NETWORK_ERROR: // new in Play Billing Library 6.0.0
|
||||||
|
defoldResponse = IapJNI.BILLING_RESPONSE_RESULT_NETWORK_ERROR;
|
||||||
|
break;
|
||||||
case BillingResponseCode.FEATURE_NOT_SUPPORTED:
|
case BillingResponseCode.FEATURE_NOT_SUPPORTED:
|
||||||
case BillingResponseCode.ERROR:
|
case BillingResponseCode.ERROR:
|
||||||
default:
|
default:
|
||||||
|
@@ -18,6 +18,7 @@ public class IapJNI implements IListProductsListener, IPurchaseListener {
|
|||||||
public static final int BILLING_RESPONSE_RESULT_ERROR = 6;
|
public static final int BILLING_RESPONSE_RESULT_ERROR = 6;
|
||||||
public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7;
|
public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7;
|
||||||
public static final int BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8;
|
public static final int BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8;
|
||||||
|
public static final int BILLING_RESPONSE_RESULT_NETWORK_ERROR = 9;
|
||||||
|
|
||||||
public IapJNI() {
|
public IapJNI() {
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,6 @@ height = 1136
|
|||||||
input_method = HiddenInputField
|
input_method = HiddenInputField
|
||||||
package = com.defold.extension.iap
|
package = com.defold.extension.iap
|
||||||
version_code = 7
|
version_code = 7
|
||||||
target_sdk_version = 29
|
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
title = extension-iap
|
title = extension-iap
|
||||||
|
@@ -44,7 +44,13 @@ end
|
|||||||
|
|
||||||
local function buy(id)
|
local function buy(id)
|
||||||
log("iap.buy() " .. id)
|
log("iap.buy() " .. id)
|
||||||
iap.buy(id)
|
local options = {}
|
||||||
|
local item = available_items[id]
|
||||||
|
if item.subscriptions then
|
||||||
|
local subscription = item.subscriptions[1]
|
||||||
|
options.token = subscription.token
|
||||||
|
end
|
||||||
|
iap.buy(id, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function restore()
|
local function restore()
|
||||||
|
Reference in New Issue
Block a user