プッシュ通知は、ApplePushNotificationAppDelegate.mでこれを実行します。iphone - プッシュ通知付きのラベルを変更できますか?
- (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]);
}
それはApplePushNotificationViewController.mに行くと、この
-(NSString *)labelchange{
label2.text = @"labelchanged";
return @"hi";
}
を行い、コンソールの結果は私の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";
}
をラベルを変更することなく、このどのように私のプログラムの実行を来りますプログラムはlabel2.textを "labelchanged"に変更しませんか?
プッシュサービスを使用するには証明書を取得する必要がありますが、プロジェクトのリンクはここにあります。「PushMeBaby」はサーバーです。
http://dl.dropbox.com/u/12439052/ApplePushNotification.zip http://dl.dropbox.com/u/12439052/PushMeBaby.zip
感謝。
?なぜそれがテキストを変更していないのですか? – Mahesh