No puede probar notificaciones push reales. Sin embargo,, puede probar la respuesta de de su aplicación a una notificación de inserción simulada creando uno programáticamente y manualmente activando el método - application:application didReceiveRemoteNotification:notification
de su AppDelegate.
Para activar este de una clase diferente (como un UIViewController):
[[[UIApplication sharedApplication] delegate]
application:[UIApplication sharedApplication]
didReceiveRemoteNotification:testNotification];
El testNotification debe tener el mismo formato que una notificación real, a saber, un NSDictionary que contiene objetos de la lista propiedad más NSNull.
He aquí un ejemplo de cómo proporcionar el testNotification
arriba:
NSMutableDictionary *notification = [[NSMutableDictionary alloc] init];
[notification setValue:@"Test" forKey:@"alert"];
[notification setValue:@"default" forKey:@"sound"];
NSMutableDictionary *testNotification = [[NSMutableDictionary alloc] init];
[testNotification setValue:notification forKey:@"aps"];
Esto debería crear un NSDictionary notificación razonable para trabajar con ellos.
Es hora de actualizar mejor respuesta. La biblioteca de mi respuesta es muy útil, ¡gracias por su ayuda! – kaspartus