Skip to content

Instantly share code, notes, and snippets.

@issue2k
Created June 15, 2015 14:43
Show Gist options
  • Save issue2k/66e2d941248578f9fc30 to your computer and use it in GitHub Desktop.
Save issue2k/66e2d941248578f9fc30 to your computer and use it in GitHub Desktop.
Import aerogear devices to zeropush
@Grab(group='com.zeropush', module='zeropush', version='1.1.0.Final')
import com.zeropush.ZeroPush
import groovy.json.JsonSlurper
String serverToken = "ABC"
String applicationToken = "ABC"
ZeroPush.getConfiguration().setTokens(serverToken, applicationToken)
def registrationProxy = ZeroPush.registration()
def file = new File("Installation.json")
def InputJSON = new JsonSlurper().parseText(file.text)
InputJSON.each{
if(it.platform.equals("ios")) {
println("Registering ios device ${it.deviceToken}")
def deviceToken = it.deviceToken
def alias = it.alias
def register = registrationProxy.register(deviceToken)
println register.execute()
println("Done?")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment