Skip to content

Commit

Permalink
Upgrade Amazon's SDK to 3.0.4 (#2543)
Browse files Browse the repository at this point in the history
It's just one patch upgrade, as you can see in the [release
notes](https://developer.amazon.com/docs/appstore-sdk/release-notes.html)
nothing breaking was introduced so the upgrade will be smooth.

---------

Co-authored-by: hyochan <[email protected]>
  • Loading branch information
KonstantinosKoulaxizis and hyochan authored Nov 4, 2023
1 parent 3ad2a14 commit e294165
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
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

0 comments on commit e294165

Please sign in to comment.