Push notification runs this on ApplePushNotificationAppDelegate.m.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
for (id key in userInfo) {
NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]);
}
ApplePushNotificationViewController *apns = [ApplePushNotificationViewController alloc];
NSLog(@"%@ changed", [apns labelchange]);
}
It goes to ApplePushNotificationViewController.m and does this
-(NSString *)labelchange{
label2.text = @"labelchanged";
return @"hi";
}
and the result in the console is this without changing the label on my iPhone
2011-08-03 18:20:56.501 ApplePushNotification[1473:707] key: acme1, value: bar
2011-08-03 18:20:56.503 ApplePushNotification[1473:707] key: acme2, value: 42
2011-08-03 18:20:56.505 ApplePushNotification[1473:707] hi changed
2011-08-03 18:21:04.347 ApplePushNotification[1473:707] key: aps, value: {
alert = "You got a new denyapps!";
badge = 5;
sound = "beep.wav";
}
How come my program runs the program but does not change the label2.text to “labelchanged”?
Need to get certificate to use the push service but here are the links for the projects, “PushMeBaby” is the server.
http://dl.dropbox.com/u/12439052/ApplePushNotification.zip
http://dl.dropbox.com/u/12439052/PushMeBaby.zip
Thanks.
ApplePushNotificationAppDelegate.h
ApplePushNotificationAppDelegate.m