Push message to any browsers in 3 steps

What you’ll need

  • Sign up a free GoEasy account.
  • Add an application free to obtain app key.
  • About 9 minutes.

Step 1: Import GoEasy

WARNING:
1. Please don't download goeasy.js as your local js, GoEasy provides dynamic goeasy.js according to different browsers.Directly use local goeasy.js may get browser compatibility issues.
2. If your application needs to support Windows XP users, please use HTTP to load goeasy.js. GoEasy will upgrade all SSL certificates to SHA-2 from Sep 22th 2016,then all Windows XP users will not be able to connect GoEasy with HTTPS.
:
                      <script type="text/javascript" src="http(s)://cdn.goeasy.io/goeasy.js"></script>
                      
                      <script type="text/javascript">

                          var goEasy = new GoEasy({
                              appkey: 'Your app key here'
                          });

                      </script>
                      
                  Option 1. Manually download:
                        Download sdk: goeasy.jar
                        Add dependency libraries: gson.jar  slf4j-api.jar

                  Option 2. Maven:
                       Add goeasy maven repository to your pom.xml::
                       
                         <repositories>
                             ...
                             <repository>
                                 <id>goeasy</id>
                                 <name>goeasy</name>
                                 <url>http://maven.goeasy.io/content/repositories/releases/</url>
                             </repository>
                         </repositories>
                       
                       and then add dependency::
                        
                         <dependencies>
                             ...
                             <dependency>
                                 <groupId>io.goeasy</groupId>
                                 <artifactId>goeasy-sdk</artifactId>
                                 <version>0.3.5</version>
                             </dependency>
                         </dependencies>
                        

                    GoEasy goEasy = new GoEasy("appkey" );
                
Javascript
Java

Step 2: Push message

GoEasy supports you push a message from either server or client (javascript, android, iOS).

2.1 Push message by RESTful API

You could post a http request to call GoEasy RESTful API, and whatever language your application is created. For java, you also can choose our sdk to help you to push a message.

URL:

http(s)://goeasy.io/goeasy/publish

Method:

Post

Parameters:

Name Required Description
appkey Yes Your app key
channel Yes Target channel name
content Yes The message you want to publish

    goEasy.publish('demo_channel', 'Hello world!');
RESTful API (Php, iOS, .Net, Ruby ...)
Java

2.2 Push message from browser

:
                    
                    goEasy.publish({
                        channel: 'demo_channel',
                        message: 'Hello world!'
                    });
                
Javascript

Step 3: Receive message on browser

:

                    goEasy.subscribe({
                        channel: 'demo_channel',
                        onMessage: function(message){
                            alert('Meessage received:'+message.content);
                        }
                    });
                
Javascript