Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make iPhone app asks to register device for push notification multiple times

I have used the following code to register my app to receive push notification, and I got the alert that asks me to register for push notification and I accidentally press cancel. Now I want to have the alert again so I can fire the delegate method in order to get the device token. But I don't get this alert any more and every time I open the settings I found that the notification is turned off for the app. I tried to delete the app from device, change app version, delete testing profile ,clean the target even I reset all the iPhone settings, but still was not able to solve this.I would very much appreciate any help, thanks

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     UIRemoteNotificationTypeBadge | 
     UIRemoteNotificationTypeAlert | 
     UIRemoteNotificationTypeSound];  
like image 734
Sarah Avatar asked Jun 13 '11 11:06

Sarah


People also ask

How do I make push notifications engage more?

Just make sure your push notification adheres to these three tenets: It's relevant and timely: The user's behavior, location, or preference triggers the notification. It's personal: The content of the push appeals to the user as an individual. It's actionable: The push makes it clear what the user should do next.

Can you set notifications for certain times?

On Android, you will need to open Settings. Then choose Sound>Do Not Disturb>Schedules. On this screen, you have several options to set the days and times for Do Not Disturb, choose which apps to apply it to, and set exceptions.

How do I get multiple notifications on iPhone iOS 15?

To see your notifications in Notification Center, do any of the following: On the Lock Screen: Swipe up from the middle of the screen. On other screens: Swipe down from the top center. Then you can scroll up to see older notifications, if there are any.

How often should an app send push notifications?

As a rule of thumb, do not send more than 3-5 notifications every week. Even then, make sure that the notifications have something relevant for the user. Understand how users would use your app in their daily lives and identify opportunities to enhance that experience using push messages.


1 Answers

Apple's recommended way to reset the notification

During development only, of course.

If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by following these steps:

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

Don't forget to turn it off completely and back on.

like image 93
Jamon Holmgren Avatar answered Sep 24 '22 18:09

Jamon Holmgren