didRegisterForRemoteNotificationsWithDeviceToken not called in ios8, but didRegister...Settings is
Your code seems to be correct. As a minor improvement you could write your didRegisterUserNotificationSettings method like so:
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
if (notificationSettings.types != UIUserNotificationTypeNone) {
NSLog(@"didRegisterUser");
[application registerForRemoteNotifications];
}
}
There may be a configuration problem that causes a failed APN registration.
Assure that your Provisioning Profile contains the aps-environment entry
Assure that you have a unique App Identifier (a string without any "*") set in your Provisioning Profile. You should also use this exact identifier as "Bundle identifier" in your Info.plist
Maybe you have declined the Push-Feature after the initial installation - in this case you will never see the in-app-push-alert again and have to enable Push in the settings app again.
Try another device.
didRegisterForRemoteNotificationsWithDeviceToken not called for iOS 13 (Objective C)
What I did is I put above code (of registering for push notification) in one function and call that function every 5 seconds.
Surprisingly, I get token now, but token for iOS 13 onwards, token is not as I get before. I need to check further on this issue. Once I check, I will post an answer for this question.
But calling register push function every 5 seconds did the trick.
I am putting this answer as no one will understand Edit 1 I have above is the answer. Better to have an answer for the question.
Registering for Push Notifications does not get any response
That is not your fault. There is some issue in APNS as on 19 July, 2016.
For reference check this
didRegisterForRemoteNotificationsWithDeviceToken not called in ios8, but didRegister...Settings is
Once APNS start working , you will start receiving device token and work with push.
Related Topics
How to Determine If an Annotation Is Inside of Mkpolygonview (Ios)
How to Disable Copy Paste Option from Uitextfield Programmatically
Add "...Read More" to the End of Uilabel
Closure Cannot Implicitly Capture a Mutating Self Parameter
Detecting Color of Iphone/Ipad/Ipod Touch
How to Modify Swift_Module_Name
How to Reload Data in a Tableview from a Different Viewcontroller in Swift
Picking Two Different Images in the Same View Controller Using Imagepickercontroller in Swift
Why Nsdateformatter Is Returning Null for a 19/10/2014 in a Brazilian Time Zone
Post Request with a Simple String in Body with Alamofire
How to Display Image in iOS Push Notification
Changing Specific Text's Color Using Nsmutableattributedstring in Swift
Disable Gesture to Pull Down Form/Page Sheet Modal Presentation
Core Data and iOS 7: Different Behavior of Persistent Store
Iphone Smooth Sketch Drawing Algorithm
Detect Current Device With Ui_User_Interface_Idiom() in Swift
Cgcontextdrawimage Draws Image Upside Down When Passed Uiimage.Cgimage