-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathApnsGrailsPlugin.groovy
42 lines (38 loc) · 1.56 KB
/
ApnsGrailsPlugin.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import org.epseelon.grails.apns.ApnsFactoryBean
import grails.util.Environment
class ApnsGrailsPlugin {
def version = "1.2"
def grailsVersion = "2.3 > *"
def title = "Apple Push Notification Service Plugin"
def author = "Sebastien Arbogast"
def authorEmail = "[email protected]"
def description = 'Integrates with Apple Push Notification service to send push notifications to an iPhone client of your application'
def documentation = "http://grails.org/plugin/apns"
def license = 'GPL3'
def developers = [
[name: 'Arthur Neves', email: '[email protected]']
]
def issueManagement = [url: 'https://github.com/sarbogast/grails-apns/issues']
def scm = [url: 'https://github.com/sarbogast/grails-apns']
def doWithSpring = {
def conf = application.config.apns
ApnsFactoryBean.Environment apnsEnvironment
if (conf.environment) {
apnsEnvironment = ApnsFactoryBean.Environment.valueOf(conf.environment.toString().toUpperCase())
}
else {
if (Environment.current == Environment.PRODUCTION) {
apnsEnvironment = ApnsFactoryBean.Environment.PRODUCTION
}
else {
apnsEnvironment = ApnsFactoryBean.Environment.SANDBOX
}
}
apnsService(ApnsFactoryBean) {
pathToCertificate = conf.pathToCertificate ?: null
certificateResourcePath = conf.certificateResourcePath ?: null
password = conf.password
environment = apnsEnvironment
}
}
}