m (Created page with 'SBRemoteNotificationServer is a singleton class that receives Apple push notifications. == Faking push notification == Push notification may be faked locally using the -conn…') |
(No difference)
|
Revision as of 11:48, 28 October 2009
SBRemoteNotificationServer is a singleton class that receives Apple push notifications.
Faking push notification
Push notification may be faked locally using the -connection:didReceiveMessageForTopic:userInfo: method, like this:
static const char plist[] = "{aps={badge=5;alert=hi;};etc=foo;}";
NSDictionary* userInfo = [NSPropertyListSerialization propertyListFromData:[NSData dataWithBytesNoCopy:plist length:sizeof(plist) freeWhenDone:NO]
mutabilityOption:NSPropertyListImmutable format:NULL errorDescription:NULL];
[[SBRemoteNotificationServer sharedInstance] connection:nil didReceiveMessageForTopic:@"com.yourcompany.appname" userInfo:userInfo];
References