To consume push messages, the application developer implements a delegate method from the SDMSUPPushDelegate.h header file.
Syntax
- (void) pushNotificationReceived: (NSDictionary *) data
Examples
- Online Push Implementation –
- Import the header file SDMSUPPushDelegate.h in the header file of the class where you implement the push delegate. It is recommended to implement this in the App delegate.
- The header file should implement the protocol. This is done by including the <SDMSUPPushDelegate> key to the super class from which the current class inherits the header file.
@interface SUPProxyClientAppDelegate : NSObject<UIApplicationDelegate, SDMSUPPushDelegate>
- Import the SUPUtilities.h file in the .m file of the class in which you implement the delegate.
- In any of the startup methods add the following code snippet:
[SUPUtilities setDelegate:self];
- Implement the delegate method which receives the data in the data parameter.
- (void) pushNotificationReceived:(NSDictionary*)data{
NSLog(@"%@",[data objectForKey:@"Data]);
}