-2

I am facing a problem that I can receive notification normally on iPhone 5s and ios 8.4.1, but I cannot receive it on iPhone 6 (iOS 9.1).

Can you tell me if we need to add a new feature for iOS 9.1 or what it should be the problem?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

1

Sorry that I add this as an answer but I'm not allowed to add comments yet.

I am also using IOS 9.1 as the deployment target and tested my Notifications and they still work.

I think there are two possible reaons why your notification isn't working:

  • Your code is not correct
  • You have not allowed the app to send you notifications

If it is the second point you can change it under "Settings>Your-App>Notification>Allow Notifications".

I hope this helps.

  • Thank for your reply, I allowed the app to send me notification and you can find below my code : let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Badge | UIUserNotificationType.Sound | UIUserNotificationType.Alert, categories: nil) UIApplication.sharedApplication().registerUserNotificationSettings(settings) UIApplication.sharedApplication().registerForRemoteNotifications() – houssam hammoud Oct 30 '15 at 09:14
  • Change the seperator between the UIUserNotificationTypes from " | " to " , ". Does it work now? Otherwise I guess your call of the notification is not correct. – Lennard Wolf Oct 30 '15 at 09:17
  • you mean the didReceiveRemoteNotification or didRegisterForRemoteNotificationsWithDeviceToken – houssam hammoud Oct 30 '15 at 09:23
  • what you mean by the call of the notification? – houssam hammoud Oct 30 '15 at 09:32
  • yes, when you changed the seperator the notification registration seems to be correct, therefor I guess the call is not correct. – Lennard Wolf Oct 30 '15 at 09:37
  • when I change the separation the "," did not work it give me error on syntax but when I call the notification I dont understand what you mean? – houssam hammoud Oct 30 '15 at 09:38
  • By the way, maybe it sounds crazy but have you already checked, if your notification are displayed in the notification area (slide from top of the screen down, a new window appears where you can select notifications at the top)? – Lennard Wolf Oct 30 '15 at 09:40
  • Which XCode version do you use? – Lennard Wolf Oct 30 '15 at 09:40
  • yes sure I checked it hehe but it did not appear, I am using xcode 6.4 but what let me crazy that the app working perfect of iphone 5 and ios 8.4 – houssam hammoud Oct 30 '15 at 09:46
  • Sorry then i can't help you any further, I am using XCode 7.1. But I'm confused that ios9.1 works on xcode 6.4, I thought it only works on xcode 7.1? – Lennard Wolf Oct 30 '15 at 10:01