Push Notification is not working on iOS 10

18,460

Solution 1

Need some changes for iOS 10 with xCode 8 GM You need to implement UserNotification.framework and their delegate methods to get work of push notifications and in capabilities needs to enable Push Notifications.

You have to import new UserNotification.framework. Please follow this link : Push notification issue with iOS 10

Solution 2

Enabling the push notifications capabilities were not required as part of Xcode 7. This is now required in Xcode 8. By enabling push notifications capabilities in Xcode 8, it'll add the following changes:

project.pbxproj

com.apple.Push = {
    enabled = 1;
};

*.entitlements (for development)

<key>aps-environment</key>
<string>*development*</string>

*.entitlements (for enterprise and production)

<key>aps-environment</key>
<string>*production*</string>

Solution 3

On iOS 10 is necessary add the Push Notifications entitlement, so if you "Fix Issue" the problem will be resolved automatically.

Problem

Share:
18,460
Sanchit Kumar Singh
Author by

Sanchit Kumar Singh

I develop,iOS stuff. When I am not developing, I play games,do trek and hangout with friends.

Updated on July 06, 2022

Comments

  • Sanchit Kumar Singh
    Sanchit Kumar Singh almost 2 years

    After the installing the new update of iOS 10, push notifications are not working, while the same implementation of code is working for iOS 9. Is there any new thing for iOS 10 for push notification. As, I am not able figure it out. Also, is it necessary to turn on push notification under capabilities.

  • Sanchit Kumar Singh
    Sanchit Kumar Singh over 7 years
    Thanks for the link, enabling push notifications under capabilities was helpful. Previously it worked for iOS 9 and below, without doing any change under capabilities. Although I am not clear why we are doing it in case of iOS 10.
  • Ashish Shah
    Ashish Shah over 7 years
    Without enabling Push Notifications in capabilities, I was getting email from apple to developer account : Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. So I worked around it and find this in capabilities.
  • Sanchit Kumar Singh
    Sanchit Kumar Singh over 7 years
    Okay, So push were working without enabling push notification in capabilities?? And do you add anything in entitlements or in .plist
  • jayant rawat
    jayant rawat over 7 years
    so if we enable push notifications in capabilitities , is extra code for registering for ios 10 notifications not required in app delegate as mentioned in answer?
  • Rajan Maheshwari
    Rajan Maheshwari over 7 years
    @AshishShah No need to implement UserNotification. It can still be done with UIUserNotificationSettings. You just need to enable the capabilities for Push notifications which will make a .entitlement file in your project.
  • Skander Fathallah
    Skander Fathallah over 5 years
    except for com.apple.Push = { enabled = 1; }; are there other lines in project.pbxproj that are necessary for remote notifications ? and thanks :D @Jen C