I'm implementing a solution to generate pass for passbook . I can generate the pass and update it manually via the webServiceURL field and over https.
However, if the pass has the automatic update option checked and if i update a field in the pass, nothing happen. No notification, no update. I don't know why because if i launch an update manually it works.
You have to send a push notification to registered devices, i.e. that has your pass installed (see Your Server Sends a Push Notification When Something Changes), assuming that you have implemented Passbook registration end point (see Devices Register for Updates and Registering a Device to Receive Push Notifications for a Pass
Related
I had my app for iOS 9 implementing application(_:didRegisterForRemoteNotificationsWithDeviceToken:) that gets invoked whether or not user accepts to receive Push Notifications, hence I get and store on the remote server the device token in both cases.
Now with iOS 10 this delegate method never gets called if user does not accept to receive Push Notifications... Is there any other way to get the device token in such a case?
You can't. If user doesn't accept notifications, you can't get any token for this.
This is the fact when user not accept to receive notification then application will not generate device token or sometime by mistake click on don't allow option, so whenever you want to need app required Push notification need to show any popup(Alert view) message there for why you need push notification access inside app then second time give some tutorial/advice/guidance for how user enable manually push notification service from iOS device Setting option.
I am launch an major update to my Application and was wondering If I could detect if the user doesn't update the Application to send an alert to the user, like in Chrome it displays an alert if you don't update the Application.
The Image:
I think Chrome looks for a new released version on server and then displays the message. To inform your application about the update, try sending PUSH notifications to your application. Handle the information from the PUSH notification such that you can use it to check if the application is updated or not. Probably you can add a version number to your Message body.
Once you have a new version ready on App Store, send a PUSH notification to the devices registered for your app and that should tell the user that an update is available. Subsequently, you can use timer to check if the app is updated to latest version.
However, the primary requirement here is to have a web-server to store the APNS tokens of the devices interested in getting updates.
Use NSTimer method after detection and give particular time to it and throw a method in
which you give alert view & message to alert. and when user update stop NSTimer.
Is it possible to tell user what were about recently received push notifications ? I mean, if user clicks cancel when push was received, there is a badge on the icon of my application, but that's all. I think this is not user friendly and such notifications have no sense. When user opens an application, he knows that there is something new in it, but don't know exactly what. Do I need to make some requests to my web server to have information about my last pushes or I'm missing something and there is another way ?
From the implementations of push notifications I've worked with so far, you'll need to make a call to your server when the app actually starts up in order for the app to know what the new information is. I don't believe there's any way to store received push notifications unless your app is opened and handling them in the app delegate. Otherwise if push notification is closed it's discarded.
In all the apps I've worked with that utilized push notifications there was a place in the app where all the recent notifications were displayed after a call to the server was made to get the whole list.
I have implemented all recommended methods in AppDelegate to get working Remote Notifications service.
I can accept them while running, while launching and while turned off.
But there is an issue, since I can't work with many received notifications while in background. I can work only with latest notification.
What is recommended manual to do that? How can I got all notifications received while in background? Is it only solvable via manual call to my service provider (sender of apns data)?
With all the projects I've worked on there hasn't been a way to locally store this information if the push notification is dismissed. In all those cases we used a small file on the server that the app would connect to and pull when it became active again. There was also some place in the app where the user could see all their notifications which, again, were stored on the server for quick retrieval.
With the way I understand push notifications to be setup, if the notification is dismissed the system discards it. It'll perform anything it's supposed to do (such as update the badge number and play the correct sound) but any additional information specific to that notification is lost.
Not sure if this helps, but if you just want to know how many notifications you have missed while you were in background. You can create a variable which contains notification number and store this in the app every time you handle notification. When you come out of background and receive a new notification you can subtract the new number with the stored number to find out the number of missed notifications. I don't think there is a way where iOS can give you complete data associated with all the notification device have received while the app was in background.
The best solution is to keep a list of sent notifications with all relevant data on your server, so the app can access that data when it launches. Sending multiple notifications with data that is not stored on the server can be risky, because the application only receives the notification when the user opens the app from that notification, so if they tap on one notification, the app will only every receive that one.
If you have them all in a list on your server, the app can simply go and pull that list down, and process it, making sure no data is lost.
How do you handle users who initially disable push notifications? I keep a record of push id's using EASYAPNS and I'm concerned that if someone disables push notifications, they'll miss out on some great features of my app.
What do you do if they want to enable notifications later on? If I create a settings tab for push notifications and they later on enable them, will the app then and there generate a push id, or is it a one time thing and they're out of luck if they don't register for notifications the first time the app launches?
Thanks
According to Apple's Local and Push Notifications Programming Guide,
"an application should register every time it launches and give its provider the current token.
(...)
Users can thereafter modify the enabled notification types in the Notifications preference of the Settings application, and you can retrieve the currently enabled notification types by calling the enabledRemoteNotificationTypes method."
The user can always go to the iPhone Settings and enable or disable notifications for your app, doesn't matter if he initially had it enabled or not.
You don't need to write the code for setting of Push Notification. iPhone itself has a feature to enable or disable Push Notifications, but application must have implemented the code ofr Push Notification.