Code
33
SDK error · code 33
What it means
apiEndpointBlockedError (code 33) means the SDK could not connect to its host and that host resolves to 127.0.0.1 or 0.0.0.0, the way a DNS ad blocker answers. With a self-hosted server, it also fires when the proxy URL is localhost and the server is down or unreachable from the device. Use a host the device can reach, and turn off DNS blocking.
Code
33
iOS (Swift)
ErrorCode.api
Android (Kotlin)
No matching code in the Android SDK; see the causes below.
Causes
cannotConnectToHost) to a URL whose host resolves to 127.0.0.1 or 0.0.0.0, and then reports a blocked endpoint (DNSChecker.swift). Apple describes cannotConnectToHost as a failed attempt to connect to a host (Apple docs).0.0.0.0. The SDK's own message says requests to RevenueCat are being blocked (rev.cat/dnsBlocking).http://localhost:8787, with the server stopped, on a device where localhost resolves to the device itself.Fix
Open the SDK's host or your proxy URL in the device's browser. If it does not load, the problem is the network path, not your app.
Allow the SDK's host in the ad blocker or private DNS profile, or test on another network.
For a self-hosted RevenueDot server, use an address the device can reach, such as your computer's LAN address, a tunnel, or your deployed HTTPS URL. On an Android emulator use 10.0.2.2.
If the URL is right, check that the server is running and listening on that port.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .apiEndpointBlockedError {
// handle api endpoint blocked
} On RevenueDot: With a proxy URL, the SDK's DNS check runs against your RevenueDot host. A server on localhost that is not running therefore shows up as this error, not as a plain networkError. See common problems for emulator and cleartext rules.
FAQ
The SDK's host failed to connect and resolved to 127.0.0.1 or 0.0.0.0, which is what DNS ad blockers return. Allow the host, or test on another network.
The proxy URL is localhost, the server is not reachable, and localhost resolves to 127.0.0.1. Start the server, or use an address the device can reach.
In React Native, compare error.code with PURCHASES_ERROR_CODE.API_ENDPOINT_BLOCKED. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.apiEndpointBlocked.
Get started
RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.
Already have an account? Sign in · Prefer your own servers? Self-host free