I am working on an app in which I have implemented Apple push notifications. When my app is in background state then I am able to receive push notifications without sound but when my app is in active state then I am able to get sound for notifications but not showing any banner for it.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateInactive)
{
AudioServicesPlaySystemSound(1007);
}
else {
AudioServicesPlaySystemSound(1007);
carPlateNo = [userInfo valueForKeyPath:@"aps.alert.loc-args"];
if(![carPlateNo isEqualToString:@"Return Message"])
{
[self receiveServices];
}
// Push Notification received in the background
}
}
Can anyone help on this?