Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not getting push notification alert request iPhone

I am very new to this development, so please help me

I am starting push notification using this code

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

But, on my device I am not getting push notification user permission alert saying "App Name" Would like to send Notifications

I found that if device is jail broken, then we don't receive permission alert message, but my device is not jail broken.

edited

I am also getting push notifications on my device, just not getting permission alert on first start.

Any help on this will be really thankful.

like image 307
P.J Avatar asked Sep 05 '12 12:09

P.J


People also ask

Why am I not getting push notifications on my iPhone?

You can fix an iPhone that's not getting notifications by restarting it or making sure notifications are turned on. You should also make sure your iPhone is connected to the internet so apps can receive notifications. If all else fails, you should try resetting the iPhone — just make sure to back it up first.

Why am I not getting my push notifications?

Make sure notifications are enabled for the apps you want. Check your battery-saving settings. You can adjust power settings on your Android to disable apps or app features when the battery drops below a certain level. Battery Saver Mode is a common culprit for notification issues.


2 Answers

from: https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42

  1. Delete your app from the device.
  2. Turn the device off completely and turn it back on.
  3. Go to Settings > General > Date & Time and set the date ahead a day or more.
  4. Turn the device off completely again and turn it back on.

  5. Re-install the app

I just tested on iOS 7.1 and it worked. note this requires turning off the device TWICE.

like image 186
codeinthesky Avatar answered Sep 28 '22 11:09

codeinthesky


I found that push notifications permission alert comes only first time application is started, even if we delete application, permission alert will not come. Even if application is uninstalled for more than 7 days, still permission alert will not come.

When I tested my application on different devices, I found this issue, that permission alert comes only once, first time application run.

Hope this information helps others who also faced same issue..

like image 30
P.J Avatar answered Sep 28 '22 09:09

P.J