- Deprecated:
- This class is deprecated and will be removed in a future release. Instead of setting a PushConnection delegate, register for notifications as described in the GDReachability class reference.
Errors and state changes that occur when using GDPushConnection are handled by creating a class that implements this protocol.
Code Snippets
The following code snippets illustrate some common tasks.
Print State-Change
@end
@implementation BasicHandler
-(void)onStatus:(int)status
{
NSLog( @"Connected OK. Push Channel service available.");
}
else {
NSLog( @"Push Channel service not available.");
}
}
@end
The above snippet shows a very simple handler for GDPushConnection state-change. The availability of the Push Channel service is written to the system log.
Set Event Handler
basicDelegate = [[BasicHandler alloc] init];
connection.delegate = basicDelegate;
The above snippet shows how the above handler could be associated with the Push Connection.