Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Egypt blocking OneSignal - OneSignal Android Studio failed to get Android Parameters issue #855

Closed
mtm19 opened this issue Oct 6, 2019 · 14 comments

Comments

@mtm19
Copy link

mtm19 commented Oct 6, 2019

Description:
I am trying to integrate OneSignal to my android app after successfully integrating it to iOS with no problems. I have added android platform to my app in my OneSignal account and gone through all the steps. However, when I run the app, it just fails to get the parameters and returns userid = null, pushtoken is not null, permissionStatus.enabled = true, subscriptionStatus.subscribed = false. I have literally tried everything since 3 days but with no luck. It doesn't event recognize in the website that any device has requested but got an error. I have tried using simulators and real devices but it never worked. I have also tried to go to the link its trying to access through the computers browser and it gets the json data.

Environment
Android Studio 3.4.2 (Windows 10)
Android Studio 3.5.1 (Mac OS Mojave 10.14.6)
Pixel 3 XL Simulator running (Android 9, API 28)
Pixel 2 XL Simulator running (Android 8.1, API 27)
Huawei Honor real device running (Android 7.0, API 24)
OneSignal.sdktype = native
OneSignal.VERSION = 031104

Steps to Reproduce Issue:

  1. Integrate OneSignal SDK by going through all the steps
  2. Runing the app and try to get information such as user id

Code

public class ApplicationClass extends Application {

private static Context context;

public static Context getContext() {
    return context;
}

@Override
public void onCreate() {
    super.onCreate();
    context = getApplicationContext();
    
    // OneSignal Initialization
    OneSignal.setLogLevel(OneSignal.LOG_LEVEL.DEBUG, OneSignal.LOG_LEVEL.NONE);
    OneSignal.startInit(this).inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification).unsubscribeWhenNotificationsAreDisabled(true)
            .init();

}

}

OneSignal Logs

2019-10-06 12:15:11.498 30972-31049/com.mtm.edrequests W/OneSignal: OneSignalRestClient: null Error thrown from network stack. 
    java.net.SocketTimeoutException: failed to connect to onesignal.com/2606:4700::6810:d720 (port 443) from /fec0::1cb6:8803:6c1:556 (port 42418) after 60000ms
        at libcore.io.IoBridge.connectErrno(IoBridge.java:185)
        at libcore.io.IoBridge.connect(IoBridge.java:129)
        at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
        at java.net.Socket.connect(Socket.java:621)
        at com.android.okhttp.internal.Platform.connectSocket(Platform.java:145)
        at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:141)
        at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
        at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
        at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
        at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
        at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
        at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:461)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:407)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:538)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:26)
        at com.onesignal.OneSignalRestClient.startHTTPConnection(OneSignalRestClient.java:177)
        at com.onesignal.OneSignalRestClient.access$100(OneSignalRestClient.java:44)
        at com.onesignal.OneSignalRestClient$4.run(OneSignalRestClient.java:108)
        at java.lang.Thread.run(Thread.java:764)
2019-10-06 12:15:11.500 30972-31057/com.mtm.edrequests I/OneSignal: Failed to get Android parameters, trying again in 40 seconds.
2019-10-06 12:15:51.504 30972-31057/com.mtm.edrequests D/OneSignal: Starting request to get Android parameters.

JSON Data
"chnl_lst":[],"outcomes":{"direct":{"enabled":false},"indirect":{"notification_attribution":{"minutes_since_displayed":1440,"limit":10},"enabled":false},"unattributed":{"enabled":false}}}

@rgomezp
Copy link
Contributor

rgomezp commented Oct 9, 2019

Howdy,
This sounds like you're having a network issue. Can you try on a different network? What country are you located in?

@mtm19
Copy link
Author

mtm19 commented Oct 9, 2019

I am located in Egypt. I found the problem but I’m unable to resolve. The problem is, if I go to my browser and try going to https://onesignal.com, it is just blocked. However if I try to go to https://app.onesignal.com it works fine and because the OneSignal API uses https://onesignal.com/.., it just gets blocked here. I tried changing networks and using LTE but the issue persists. I just need a way to change the BASE_URL of the api from https://onesignal.com/ TO https://app.onesignal.com/

@rgomezp rgomezp changed the title OneSignal Android Studio failed to get Android Parameters issue Egypt blocking OneSignal - OneSignal Android Studio failed to get Android Parameters issue Oct 10, 2019
@rgomezp
Copy link
Contributor

rgomezp commented Oct 10, 2019

Egypt is blocking OneSignal. We are looking into how best to communicate with Egypt on how best to resolve this issue. If you want to reach out to your ISP and let them know they should unblock OneSignal, that would be helpful.

@mtm19
Copy link
Author

mtm19 commented Oct 11, 2019

I tried contacting the ISP but they keep saying that it is not blocked. I will keep trying to contact them to hopefully get a solution to this.

@rgomezp
Copy link
Contributor

rgomezp commented Oct 15, 2019

@mtm19 ,
Okay. Please update the issue when possible

@mtm19
Copy link
Author

mtm19 commented Oct 16, 2019

@rgomezp
I tried contacting all the ISPs with no positive results. They are all saying nothing is blocked though the site is still not working unless i access app.onesignal.com. So the only way I can think of now is updating the OneSignal SDK for iOS and Android to have the option of changing the BASE_URL from “https://onesignal.com/...” to “https://app.onesignal.com/..” . If you could do something about this that would be much appreciated as my project has been delayed for about 2 weeks because of this issue.

@iSWORD
Copy link

iSWORD commented Oct 30, 2019

Not sure if that would help, but at least in my case, in a new browser session when I go to https://onesignal.com and get an SSL error, if I then visit https://app.onesignal.com which loads just fine, it solves the problem with https://onesignal.com and I no longer get the SSL error for as long as the session lives.

@rgomezp
Copy link
Contributor

rgomezp commented Nov 7, 2019

Hi everyone, unfortunately, this is something up to the ISP. I would encourage you to try to pressure them to unblock OneSignal. However, this isn't really an issue with the SDK so I will be closing the issue. Hopefully, this gets resolved soon

@rgomezp rgomezp closed this as completed Nov 7, 2019
@iSWORD
Copy link

iSWORD commented Nov 8, 2019

@rgomezp A workaround could be communicating over a subdomain like api.onesignal.com instead of the naked domain. It seems to be working without any issues so far on TE Data. Would it be possible to do this in the Android SDK?

@SourcCode-eg
Copy link

I am from Egypt and I have the same problem any one find any Solution ?

@samerzaki
Copy link

I'm facing the same problem from Egypt

@rgomezp
Copy link
Contributor

rgomezp commented Jan 2, 2020

Please contact your ISP

@hkawii
Copy link

hkawii commented Jan 4, 2020

Any update on that issue please, we still have that problem in Egypt, as tested with We, Etisalat, Vodafone, currently all have that issue

There is update to that issue please? Egypt's customers are highly affected

@khattab93
Copy link

@rgomezp Any updates about this issue. We are still facing it.

iSWORD pushed a commit to iSWORD/OneSignal-Android-SDK that referenced this issue Jan 13, 2020
It appears that subdomains of onesignal.com are not blocked by the Egyptian ISP TE Data (also known as WE)

Fixes OneSignal#919, OneSignal#883, OneSignal#859, OneSignal#855, OneSignal#849, OneSignal#847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants