I found an issue with ApnsServiceFactory class. It will never allow you to create an ApnsService object using "gateway.sandbox.push.apple.com", it always changes to "gateway.push.apple.com", even if you call ApnsServiceFactory.setGatewayHost().
I was wondering if anyone knew of a work around? The actual issue occurs in ApnsServiceFactory.getApnsService(). getApnsService initially configures ApnsServiceBuild with the "gateway host" when configureApnsDestination() is called. But the problem is the call to configureApnsCertificate() which is called after configureApnsDestination(). In configureApnsCertificate() the ApnsServiceBuild object (builder) destination is changed when build.withCert(...).withProductionDestination() is called. withProductionDestination overrides the gateway host address. Any help would be appreciated. Thanks Eli