【发布时间】:2015-01-27 14:11:52
【问题描述】:
当我在我的应用程序未激活或关闭时收到推送通知时,我的设备会播放通知声音。当我的应用程序处于活动状态或打开状态时,它不会在收到通知/消息时播放声音。
我希望即使在应用程序处于活动/打开状态时也能播放通知声音。请问有人可以帮我实现吗?
-(void)HandleNotification:(NSDictionary *)userInfo{
NSMutableDictionary * test = [userInfo objectForKey:@"aps"];
NSMutableDictionary *alert_msg = [test objectForKey:@"alert"];
NoteType = [alert_msg objectForKey:@"type"];
Note_Student_id = [alert_msg objectForKey:@"sid"];
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"School Link"
message:[alert_msg objectForKey:@"title"]
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
我的通知如下所示:
{
aps = {
alert = {
sid = 114;
title = fddsf;
type = 2;
};
sound = default;
};
}
【问题讨论】:
标签: ios push-notification apple-push-notifications