Skip to content

Commit

Permalink
feat: add ios error reason user canceled (hyochan#2616)
Browse files Browse the repository at this point in the history
- adding user canceled error code, so we can distinguish in app what
error is intention and what is real error
  • Loading branch information
cervebar authored and Arthur Geron committed Jan 7, 2024
1 parent 5425b8e commit bd28785
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ios/RNIapIosSk2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,11 @@ class RNIapIosSk2iOS15: Sk2Delegate {
resolve(nil)
} catch {
reject(IapErrors.E_SYNC_ERROR.rawValue, "Error synchronizing with the AppStore", error)
if "\(error)" == "userCancelled" {
reject( IapErrors.E_USER_CANCELLED.rawValue, "User cancelled synchronizing with the AppStore", error)
} else {
reject( IapErrors.E_SYNC_ERROR.rawValue, "Error synchronizing with the AppStore", error)
}
}
}
}
Expand Down

0 comments on commit bd28785

Please sign in to comment.