I have my push notifications working perfectly now. Only thing i need to know is how to have them pop-up when the app is open. They are a important part to what im doing and do require them to show even while the user is using the app. Any ideas how?
i already have this, and it shows what i want in the log, but i dont know how to get the alert etc from this to an alert - i know how to do an alert as well, its just the extraction of the data im stuck on..
Code:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
for (id key in userInfo) {
NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]);
}
}
Discussion
The delegate receives this message when the application is running and a remote notification arrives for it. In response, the application typically connects with its provider and downloads the data waiting for it. It may also process the notification in any other way it deems useful.
The userInfo dictionary contains another dictionary that you can obtain using the aps key. You can access the contents of the aps dictionary—though you shouldn’t need to in most cases—using the following keys:
alert—The value may either be a string for the alert message or a dictionary with two keys: body and show-view. The value of the former is the alert message and the latter is a Boolean (false or true). If false, the alert’s View button is not shown. The default is to show the View button which, if the user taps it, launches the application.
badge—A number indicating the quantity of data items to download from the provider. This number is to be displayed on the application icon. The absence of a badge property indicates that any number currently badging the icon should be removed.
sound—The name of a sound file in the application bundle to play as an alert sound. If “default” is specified, the default sound should be played.
The userInfo dictionary may also have custom data defined by the provider according to the JSON schema. The properties for custom data should be specified at the same level as the aps dictionary. However, custom-defined properties should not be used for mass data transport because there is a strict size limit per notification (256 bytes) and delivery is not guaranteed.
Yeah i see all this in my log, but i cant extract just the alert message from it to output as my AlertView message. Sorry to be a pain and keep asking.