i have some problems with the Push Notifications. I can sent them well to my registered Devices. All works fine.
My Questions is: After clicking the VIEW button, the App is launching. At the moment without any content.
How can i add content here? This content should depend on the Push Notification i sent out.
For example: My Push Notification is about NEWS Number 1 - then after clicking VIEW i should get more informations about NEWS Number 1
and so on...
Also it should be possible to read all previous received NEWS in the App in a list, when getting back from NEWS Number 1.
You understand, what i mean?
I dont have any real idea...Would be nice if you can show me code regarding to an example.
Thanks.
Find your notifications in Notification Center 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.
Apple does not offer a way to handle a notification that arrives when your app is closed (i.e. when the user has fully quit the application or the OS had decided to kill it while it is in the background). If this happens, the only way to handle the notification is to wait until it is opened by the user.
Push notifications, when implemented properly, are resistant to interception or redirection and are, therefore, more secure than SMS.
Just implement the following code and you are good to go:
// will be called if the app was not active
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self applicationDidFinishLaunching:application];
if (launchOptions != nil)
{
NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (dictionary != nil)
{
// get the necessary information out of the dictionary
// (the data you sent with your push message)
// and load your data
}
}
return YES;
}
// will be called when in foreground
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// get the necessary information out of the dictionary
// (the data you sent with your push message)
// and load your data
}
You can find a well-known tutorial on APNS here: http://www.raywenderlich.com/3525/apple-push-notification-services-tutorial-part-2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With