Skip to content

Commit

Permalink
fix: avoid app crash due to multiple reject invocation (#2669)
Browse files Browse the repository at this point in the history
Probably, someone forgot to delete the old **Reject** when adding the
condition to the code. This leads to an error and crash of the
application in the development environment.

**Steps To Reproduce**:
The error occurs when the user has canceled iOS system prompt for Sync
with App Store using StoreKit2.

**Error Message:**
The error says: 'Illegal callback invocation from native module. This
callback type only permits a single invocation from native code.'

**Solution**:
Delete redundant reject.
  • Loading branch information
khrulev committed Jan 15, 2024
1 parent a823393 commit 13eab87
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion ios/RNIapIosSk2.swift
Expand Up @@ -917,7 +917,6 @@ class RNIapIosSk2iOS15: Sk2Delegate {
try await AppStore.sync()
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 {
Expand Down

0 comments on commit 13eab87

Please sign in to comment.