This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.ganyo</groupId> | |
<artifactId>gcm-server</artifactId> | |
<version>1.0.2</version> | |
</dependency> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by vivex on 12/6/15. | |
*/ | |
@Service | |
public class NotificationService { | |
/** | |
* gcmRegId is the id which android app will give to server (one time) | |
**/ | |
public boolean pushNotificationToGCM(String gcmRegId,String message){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sender sender = new Sender(GCM_API_KEY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Message msg = new Message.Builder().build(); | |
Message msg2 = new Message.Builder().addData("message","Something New for You").build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
Result result = sender.send(msg2, account.getGcmRegId(), retries); | |
if (StringUtils.isEmpty(result.getErrorCodeName())) { | |
System.out.println(msg2.toString() + "GCM Notification is sent successfully" + result.toString()); | |
return true; | |
} | |
System.out.println("Error occurred while sending push notification :" + result.getErrorCodeName()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
php: | |
- 5.6 | |
services: | |
- mysql | |
addons: | |
hosts: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_ENV=testing | |
APP_DEBUG=true | |
APP_KEY=key | |
DB_CONNECTION=mysql | |
DB_HOST=127.0.0.1 | |
DB_PORT=3306 | |
DB_DATABASE=sample | |
DB_USERNAME=shippable | |
DB_PASSWORD= |