Java Client for Hyphenate Services
The Java Client for Hyphenate Services is for use in server applications on a proxy server, aka, your developer server. Client library serves as a wrapper layer on top of raw REST APIs that allows you to deploy on your server and make APIs requests. See Hyphenate APIs.
This library is open source. We encourage you to contribute to make the code base better! If you encountered any bug or feature suggestion, please submit an issue or email email@example.com for urgent fixes.
You can add the library via Gradle or Maven, which we recommended, or compile it from command line.
Update Hyphenate app configurations in
API_ORG = hyphenatedemo API_APP = demo APP_CLIENT_ID = YXA68E7DkM4uEeaPwTPbScypMA APP_CLIENT_SECRET = YXA63_RZdbtXQB9QZsizSCgMC70_4Rs
package io.hyphenate.server.jersey is using Jersey 2.15. Java 7 or later is required.
package io.hyphenate.server.httpclient is using Httpclient 4.3.3. Java 1.5 or later is required.
Install JUnit library (ex. junit:junit:4.12)
Get all the dependencies
REST APIs Documentation
By default, requests are sent at the expected rate limits for each web service, typically 30 queries per second for free users.
Each IP address is limited to 30 requests per second. Requests beyond this limit will receive a 429 or 503 error. If you received this error, please reduce the request frequency and try again. Please contact Hyphenate firstname.lastname@example.org if you need higher request rate.
Install Java IDE
You can use IntelliJ, Eclipse, NetBeans or any Java IDE you prefer to the run the project.
Unix or Mac
$ gradle eclipse
Run the following command, it'll generate necessary Eclipse files, then import via Eclipse
> gradlew.bat eclipse
Unix or Mac
"Import Project" -> select project root folder -> select "Import project from external model" -> select "Gradle" -> select "Use auto-import" and "Create separate module per source set" -> select "Use default gradle wrapper" -> Select "1.7" for Gradle JVM -> ".idea" for project format -> click "Finish"
Run the following command and open the project from Intellij IDEA
> gradlew.bat idea
Build from Command line
Unix or Mac
Compile and package the project
$ ./gradlew jar
see all Gradle commands
$ ./gradlew tasks
> gradlew.bat clean compile
If you're not using the tools listed above, you can manual manage the .jar package by running the following command.
> gradlew.bat distZip
That will create a zip file, hyphenate-server-example.zip, under the folder build/distributions, which includes all the dependency