Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Amazon's SDK to 3.0.4 #2543

Merged
merged 4 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/ci-example-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: "14.x"

- name: Setup Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -40,12 +45,6 @@ jobs:
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: Set up JDK 11.0.3
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11.0.3

- name: Grant execute permission for gradlew in example app
run: chmod +x ./gradlew
working-directory: IapExample/android
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RNIap_compileSdkVersion=31
RNIap_buildToolsVersion=30.0.2
RNIap_ndkversion=21.4.7075529
RNIap_playServicesVersion=18.1.0
RNIap_amazonSdkVersion=3.0.3
RNIap_amazonSdkVersion=3.0.4
RNIap_playBillingSdkVersion=6.0.1

android.useAndroidX=true
Expand Down
17 changes: 17 additions & 0 deletions android/src/amazon/java/com/dooboolab/rniap/RNIapAmazonListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,23 @@ class RNIapAmazonListener(
null,
)
}
PurchaseResponse.RequestStatus.PENDING -> {
val error = Arguments.createMap()
val debugMessage = "Purchase is pending. Please wait for the transaction to complete."
val errorCode = PromiseUtils.E_PENDING
error.putInt("responseCode", 0)
error.putString("code", errorCode)
error.putString("debugMessage", debugMessage)
error.putString("message", debugMessage)
eventSender?.sendEvent("purchase-error", error)
PromiseUtils
.rejectPromisesForKey(
RNIapAmazonModule.PROMISE_BUY_ITEM,
errorCode,
debugMessage,
null,
)
}
PurchaseResponse.RequestStatus.NOT_SUPPORTED -> {
val error = Arguments.createMap()
val debugMessage = "This feature is not available on your device."
Expand Down
1 change: 1 addition & 0 deletions android/src/main/java/com/dooboolab/rniap/PromiseUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ object PromiseUtils {
const val E_UNKNOWN = "E_UNKNOWN"
const val E_NOT_PREPARED = "E_NOT_PREPARED"
const val E_ALREADY_PREPARED = "E_ALREADY_PREPARED"
const val E_PENDING = "E_PENDING"
const val E_NOT_ENDED = "E_NOT_ENDED"
const val E_USER_CANCELLED = "E_USER_CANCELLED"
const val E_ITEM_UNAVAILABLE = "E_ITEM_UNAVAILABLE"
Expand Down
Loading