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

SMS message delivered but getting Exception #226

Open
moritzsu opened this issue Jan 27, 2023 · 4 comments
Open

SMS message delivered but getting Exception #226

moritzsu opened this issue Jan 27, 2023 · 4 comments

Comments

@moritzsu
Copy link

moritzsu commented Jan 27, 2023

Hello everyone,
I am currently trying to send a SMS via MessageBird and show the user an error popup when the message could not be delivered.
My SMS always reach their target but a lot of times (I cant tell when exactly) I get an exception from MessageBird which triggers my popup to show up even though the message could be delivered.

I get the following exception (I replaced the part after Adress with placeholder since I dont know if I can share that):
java.io.IOException: unexpected end of stream on com.android.okhttp.Address"placeholder"
What could be the issue for this?

@DevPJ9
Copy link

DevPJ9 commented Jan 27, 2023

I think it is related to you not closing connection after every request.

check out this post from stack overflow: https://stackoverflow.com/questions/45838774/java-io-ioexception-unexpected-end-of-stream-on-connection-in-android

Hope this helps.

@moritzsu
Copy link
Author

I am not doing any networking operations, I let all of that be handled by the MessageBird API.
The code I am testing with, is pretty much like the example at: https://github.com/messagebird/java-rest-api/blob/master/examples/src/main/java/ExampleSendMessage.java

@denizkilic
Copy link
Member

denizkilic commented Feb 2, 2023

Hi @moritzsu,
Thanks for creating the issue. I found this link on StackOverflow which suggests adding android:usesCleartextTraffic="true". Besides this, I don't see a problem with SDK that could cause this error for now. I will investigate further. Did you find anything on the Android side?

@moritzsu
Copy link
Author

moritzsu commented Feb 6, 2023

Sadly I did not find anything related to this on my side - I can not replicate the error consistenly either.
Since it is not possible for me to use clear text traffic I can not use your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants