From e561d0c4faefce7f0e32e15a5667b6512c6341d7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 29 Mar 2017 00:32:38 +0300 Subject: juick-notifications: refactor using with Spring annotations --- .../components/configuration/GCMConfiguration.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java (limited to 'juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java') diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java new file mode 100644 index 00000000..96c7716f --- /dev/null +++ b/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java @@ -0,0 +1,21 @@ +package com.juick.components.configuration; + +import com.google.android.gcm.server.Endpoint; +import com.google.android.gcm.server.Sender; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Created by vital on 29.03.2017. + */ +@Configuration +public class GCMConfiguration { + @Value("${gcm_key}") + private String gcmKey; + + @Bean + public Sender GCMSender() { + return new Sender(gcmKey, Endpoint.GCM); + } +} -- cgit v1.2.3