Created
June 15, 2015 14:43
-
-
Save issue2k/66e2d941248578f9fc30 to your computer and use it in GitHub Desktop.
Import aerogear devices to zeropush
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
@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