OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[Bug]: Android SDK v5.x: Network requests to api.onesignal.com fail with UnknownHostException and Connection reset in the UAE

Open midhlajnazar opened this issue 2 months ago • 5 comments

What happened?

When initializing onesignal_flutter (v5.5.2 / Android SDK 051002) on Android (both emulators and physical devices), OneSignal fails to fetch parameters or initialize because requests to https://api.onesignal.com consistently throw UnknownHostException and SocketException: Connection reset during the TLS handshake.

Steps to reproduce?

1.
Initialize onesignal_flutter (^5.5.2) in a Flutter application on Android using a valid OneSignal App ID:
Dart
OneSignal.initialize("YOUR_ONESIGNAL_APP_ID");
2.
Run the application on an Android emulator or a physical Android device connected to a standard network/cellular network in the UAE (using local ISPs like Etisalat or du) without a VPN enabled.
3.
Inspect Logcat logs during app startup.
4.
Observe that OneSignal's background worker attempts to fetch Android parameters (GET https://api.onesignal.com/apps/.../android_params.js) and immediately fails.
5.
Notice the resulting java.net.UnknownHostException and java.net.SocketException: Connection reset errors in the logs.

What did you expect to happen?

nslookup api.onesignal.com and curl requests to https://api.onesignal.com time out both on local Wi-Fi and mobile cellular data in the UAE

OneSignal Flutter SDK version

Plugin Version: onesignal_flutter: ^5.5.2 • Android SDK Version: 051002 (Flutter wrapper 050612) • Platform: Android (Emulator & Physical Devices) • Region/Network: United Arab Emirates (UAE) - ISPs (Etisalat / du)

Which platform(s) are affected?

  • [x] iOS
  • [x] Android

Relevant log output

W/OneSignal(31479): [OneSignal-IO-2] HttpClient: null Error thrown from network stack. 
W/OneSignal(31479): java.net.SocketException: Connection reset
W/OneSignal(31479): 	at java.net.SocketInputStream.read(SocketInputStream.java:191)
W/OneSignal(31479): 	at java.net.SocketInputStream.read(SocketInputStream.java:143)
W/OneSignal(31479): 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:1015)
W/OneSignal(31479): 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:979)
W/OneSignal(31479): 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket(ConscryptEngineSocket.java:0)
W/OneSignal(31479): 	at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:244)
W/OneSignal(31479): 	at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:226)
W/OneSignal(31479): 	at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:194)
W/OneSignal(31479): 	at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:151)
W/OneSignal(31479): 	at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:114)
W/OneSignal(31479): 	at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
W/OneSignal(31479): 	at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
W/OneSignal(31479): 	at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
W/OneSignal(31479): 	at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
W/OneSignal(31479): 	at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
W/OneSignal(31479): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
W/OneSignal(31479): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
W/OneSignal(31479): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
W/OneSignal(31479): 	at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
W/OneSignal(31479): 	at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:27)
W/OneSignal(31479): 	at com.onesignal.core.internal.http.impl.HttpClient$makeRequestIODispatcher$job$1.invokeSuspend(HttpClient.kt:217)
W/OneSignal(31479): 	at com.onesignal.core.internal.http.impl.HttpClient$makeRequestIODispatcher$job$1.invoke(HttpClient.kt:8)
W/OneSignal(31479): 	at com.onesignal.core.internal.http.impl.HttpClient$makeRequestIODispatcher$job$1.invoke(HttpClient.kt:2)
W/OneSignal(31479): 	at com.onesignal.common.threading.ThreadUtilsKt$launchOnIO$1.invokeSuspend(ThreadUtils.kt:170)
W/OneSignal(31479): 	at com.onesignal.common.threading.ThreadUtilsKt$launchOnIO$1.invoke(ThreadUtils.kt:8)
W/OneSignal(31479): 	at com.onesignal.common.threading.ThreadUtilsKt$launchOnIO$1.invoke(ThreadUtils.kt:2)
W/OneSignal(31479): 	at com.onesignal.common.threading.OneSignalDispatchers$launchOnIO$1.invokeSuspend(OneSignalDispatchers.kt:202)
W/OneSignal(31479): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
W/OneSignal(31479): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
W/OneSignal(31479): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1100)
W/OneSignal(31479): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
W/OneSignal(31479): 	at java.lang.Thread.run(Thread.java:1571)
I/OneSignal(31479): [OneSignal-IO-2] Failed to get Android parameters, trying again in 90 seconds.
D/OneSignal(31479): [OneSignal-IO-2] FeatureFlagsBackendService.fetchRemoteFeatureFlags(appId=XXXX)
D/OneSignal(31479): [OneSignal-IO-1] HttpClient: Request Sent = GET https://api.onesignal.com/apps/XXXX/sdk/features/android/051002 - Body: null - Headers: Accept=[application/vnd.onesignal.v1+json], OneSignal-Fid-Env=[gs=0;agp=9.0.1;flag=0;reg=0;def=0;prov=1;min=24;tgt=36;snd=-], OneSignal-Install-Id=[XXXXX], OneSignal-Subscription-Id=[XXXX], SDK-Version=[onesignal/android/051002], SDK-Wrapper=[onesignal/flutter/050612]
I/OneSignal(31479): [OneSignal-IO-1] HttpClient: Could not send last request, device is offline. Throwable: java.net.UnknownHostException
D/OneSignal(31479): [OneSignal-IO-1] FeatureFlagsBackendService: non-success status=-1 body=<empty>

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

midhlajnazar avatar Sep 24 '26 04:09 midhlajnazar

Hi there,

Thank you for the report. This is a known issue and we're actively working on it.

What we know:

Since around September 18, connections to api.onesignal.com from inside the UAE are being blocked at the network level. It affects multiple UAE ISPs on both Wi-Fi and cellular. This is not caused by your app, your configuration, or the OneSignal SDK version, and nothing has changed on our side. Requests from outside the UAE work normally.

While the block is in place:

  1. The OneSignal SDK on devices in the UAE cannot initialize, register subscriptions, or update users. You'll see errors like UnknownHostException, Connection reset, or TLS timeouts.
  2. API requests sent from servers located in the UAE will time out.

What we're doing about it:

The UAE regulator (TDRA) has told affected customers the block was requested by the Ministry of Economy and Tourism. We've filed a formal request with the Ministry to review and lift it, and we're pursuing it through our regional partner and legal counsel in parallel. We don't have a timeline yet. Updates will be provided as soon as possible.

How you can help:

Requests from UAE businesses carry weight with local authorities. If you're able to, please:

  1. Submit a review request to the Ministry of Economy and Tourism: https://www.moet.gov.ae/en/services. Explain that your business uses OneSignal (api.onesignal.com) to send notifications to your customers and that the block is disrupting your service.
  2. If you have a UAE Pass, also file an unblock request with TDRA: https://tdra.gov.ae/en/Services/block-or-unblock-websites
  3. If you're on du, report the block here: https://www.du.ae/surfsafely?ctype=unblock
  4. Send us any reference number or reply you get back. It helps us push our own request forward.
  5. If you haven't already, reply with your ISP and the approximate time the problem started for you.

We know this is disruptive and we're sorry for the impact on you and your users. We'll keep you posted!

jfishman1 avatar Sep 24 '26 17:09 jfishman1

I am facing the same issue in the UAE on both iOS and Android. Despite users updating and launching the app multiple times, the OneSignal dashboard still shows older app versions and stale Last Session timestamps. Requests to api.onesignal.com are timing out, with DNS resolution sometimes taking around 100 seconds, followed by TLS connection timeouts.

mustafasaify-glitch avatar Sep 26 '26 18:09 mustafasaify-glitch

We are experiencing the same issue in the UAE.

Environment:

- `onesignal_flutter`: `5.6.x` / `5.7.0`
- Native OneSignal Android SDK: `051002`
- Flutter production app
- Android 16
- Device: Samsung Galaxy A55 5G (`SM-A556E`)
- Network: UAE Etisalat/du connections

The device notification permission is granted by Android, but OneSignal cannot create the subscription:

androidPermission=PermissionStatus.granted oneSignalPermission=false optedIn=false subscriptionId= hasToken=


We also see:

```text
NativePermissionController: checkPermission: missing 13

The same device previously worked with an older production release. The failure started after upgrading the OneSignal/native SDK versions.

From the UAE network, api.onesignal.com resolves through DNS, but HTTPS/TLS requests time out or reset. Because OneSignal cannot reach api.onesignal.com, the Android parameters and subscription registration do not complete.

Could you confirm whether there is an approved workaround for UAE networks, such as an alternate endpoint, regional routing, or proxy configuration? We can provide additional logs and test a patched SDK if needed.

shehanargaam avatar Sep 28 '26 10:09 shehanargaam

Same issue, reporting per your request for ISP, start date and reference numbers.

ISP: du. Blocked on both our business fixed line and du 5G since around 10 September. Etisalat works for us as of 30 September. http://api.onesignal.com redirects to du's block page lighthouse.du.ae; https is cut during the TLS handshake. onesignal.com itself is not blocked.

du technical ticket 1-655326968124: du confirmed the block is enforced on instruction from TDRA and referred us to TDRA.

TDRA unblock request BUB-26-100001076: rejected. TDRA stated the block falls under intellectual property law and referred us to the Ministry of Economy, Intellectual Property Department, as the competent authority.

So the entry sits with the Ministry's IP Department, consistent with an anti-piracy blocking order that swept in the API hostname.

en-tech-sharif avatar Sep 30 '26 07:09 en-tech-sharif

Update from the UAE: api.onesignal.com has been reachable, we tested around 21 October. http no longer redirects to lighthouse.du.ae, the SDK endpoints return 200, and fresh installs on two apps registered normally. Looks lifted on our side.

en-tech-sharif avatar Oct 23 '26 10:10 en-tech-sharif