2011-09-13 7 views
0

プッシュ通知を使用して、新しいメッセージがあることをユーザーに通知しています。新しいメッセージが警告メッセージなしで表示されたときにバッジとサウンドのみを表示することは可能ですか?アップルはこの種の通知を許可しますか?もしそうなら、私はどのように進めていくのかと思います。iphoneのプッシュ通知にバッジとサウンドだけを表示することはできますか?

事前に感謝あなただけのバッジやサウンドを表示することができます

答えて

1

確かに。あなたは何をすべきかについては、この は次のとおりです。 - :

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)]; 

アラート通知を追加しないでください - あなたの通知タイプのライトを設定している

+0

私はあなたが今すぐ分類されたことを願っています。 – Gypsa

0

アラート通知を送信しないで、サウンドとバッチの詳細のみを通知します。

-(void) scheduleNotificationForDate: (NSDate*)date { 
    [[UIApplication sharedApplication] cancelAllLocalNotifications]; 
    UILocalNotification *localNotification = [[UILocalNotification alloc] init]; 
    localNotification.fireDate = date; 
    NSLog(@"Notification will be shown on: %@",localNotification.fireDate); 
    localNotification.timeZone = [NSTimeZone defaultTimeZone]; 
    localNotification.soundName = UILocalNotificationDefaultSoundName; 
    localNotification.applicationIconBadgeNumber = 1; 
    [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; 
    } 
関連する問題