-
-
Notifications
You must be signed in to change notification settings - Fork 32
Get ws URI directly from server URL #30
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
Get ws URI directly from server URL #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions
this(null); | ||
URL serverUrl = ParseRESTCommand.server; | ||
if (serverUrl == null) { | ||
throw new RuntimeException("serverUrl is null. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkInit is already called in the other constructor to do that check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} catch (URISyntaxException e) { | ||
e.printStackTrace(); | ||
throw new RuntimeException(e.getMessage()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could extract that logic into a static util
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by 1040abb
@@ -23,14 +25,37 @@ | |||
private final String applicationId; | |||
private final String clientKey; | |||
private final SparseArray<Subscription<? extends ParseObject>> subscriptions = new SparseArray<>(); | |||
private final URI uri; | |||
private URI uri; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should keep it final, and only pass the result WSS URL when it's parsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
Thanks
@@ -45,6 +51,25 @@ | |||
this.webSocketClientCallback = getWebSocketClientCallback(); | |||
} | |||
|
|||
private static URI getDefaultUri() { | |||
URL serverUrl = ParseRESTCommand.server; | |||
if (serverUrl != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor change, but i'd return null serverUrl == null and then take this out of an if block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed by d50da48
Thanks 😄
Get ws URI directly from server URL
ex.