Reputation: 1
I am using push notification to inform the user that they have a new message. Is it possible to show only the badge and sound when the new message comes without the alert message. Will apple allow to use these kind of notification. If so can any one kind me how to proceed.
Thanks in advance
Upvotes: 0
Views: 190
Reputation: 243
Give the notification only with sound and batch details dont give the alert notification.
-(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];
}
Upvotes: 0
Reputation: 11314
Sure you can show only badge and sound. For this what you have to do is:-
where you have set your notification type write:-
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)];
do not add alert notification.
Upvotes: 1