-
Notifications
You must be signed in to change notification settings - Fork 548
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
Android PubSub with WebSockets Sample does not work!!! #750
Comments
@iwwork Thank you for reporting this. I will try to follow the steps and reproduce the issue. The stack trace indicates that the WebSocket handshake request for upgrade failed. Can you please let us know if you are using the default version of paho or are you using a custom version. If you are not sure about the paho version, chances are you are using the default version. Please let us know accordingly. |
@desokroshan Thanks. |
@muellerfr @desokroshan please help, wish to solve it asap |
@iwwork I am unable to reproduce the issue on my end. The error suggests that the handshake request for upgrading connection to websocket failed. Can you please confirm the following :
|
@desokroshan Thanks Wish these could solve it.
|
@iwwork Thanks for sharing the stack trace. Request-id is not available in the stack trace. You will have to setup a debugger add breakpoints where you receive response from iot or lower your log-level. But before that, since I am not able to reproduce it on my end, I am guessing the exception might be related to the specific android version you are using. Can you please share the details of the device and Android API level you are running the sample on. Also can you try running it on API Level 28 and let me know if the error persists. |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
I have encountered with the same error on version 8.1 and 6.0 Android devices and I'm using awsIOTAndroidSDK version 2.12.6. Here is my log record.
|
same error still happens, using the amazon sample code in AndroidPubSubWebSocket. This app is removed now from the github samples with android SDK, so I guess it's not fixable? |
Thanks @muellerfr @minbi @desokroshan to solve this one:
AndroidPubSub Sample does not work!!!
#719
Now I tried to follow the above method to use it in the following:
AndroidPubSubWebSocket
https://github.com/awslabs/aws-sdk-android-samples/tree/master/AndroidPubSubWebSocket
there still has some problems:
State your question
The apk keeps reconnceting
Which AWS Services are you utilizing?
AWS IoT
Provide code snippets (if applicable)
Followed the instruction https://github.com/awslabs/aws-sdk-android-samples/tree/master/AndroidPubSubWebSocket to set the parameter on the AWS cloud
Downloaded the whole code from https://github.com/awslabs/aws-sdk-android-samples
Used Android Studio 3.3.1 to open the folder AndroidPubSubWebSocket
I change in the awsconfiguration.json
"PoolId": "REPLACE_ME",
"Region": "us-east-1"
PubSubActivity.java
// Customer specific IoT endpoint
// AWS Iot CLI describe-endpoint call returns: XXXXXXXXXX.iot..amazonaws.com,
private static final String CUSTOMER_SPECIFIC_IOT_ENDPOINT = "REPLACE_ME";
add implementation "com.amazonaws:aws-android-sdk-auth-userpools:$aws_version in AndroidPubSub/build.gradle
Sync, Build and Run App on emulator9.0 or Mobile Phone8.0, the result in Logcat is
The Apk keeps reconnectiong.
How to deal with this problem?
Should there some other code be added?
Environment(please complete the following information):
Device Information (please complete the following information):
If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.
The text was updated successfully, but these errors were encountered: