objective c - Receiving APNS notification but cant display on device in ios -


Hello everyone, I'm trying to implement pushnotification . For this I have read the official document of apples, for push notification and also read the Reverendlich blog and I understand the flow of handwriting very well. I have created the development and production certificate, profile and its work is fine and it was successfully sent and received -

  - (zero) application: (UIApplication *) Application DidReiveiveRemoteNotification: Display the message (NSDictionary *) in userInfo {*** uialertview *** message ******}   

But my problem is how I I can display push in device like other push notifications

Currently I have IOS 7.0 and XCode Version 5.1.1 (5B1008)

Thanks in advance for both upwards.

Firstly check these applications through these methods to verify that if your registered successfully. APNS

  - (void) application: (UIApplication *) application didRegisterForRemoteNotificationsWithDeviceToken: (NSData *) deviceToken {} - (void) application: (UIApplication *) application didFailToRegisterForRemoteNotificationsWithError: (NSError *] Error { }   

then - (minus) application: application (UIApplication *) Risevremo Information: (NSDictionary *) userInfo {NSDictionary * notification = UserInfo; NSString * title = [(NSDictionary *) [(NSDictionary *) [notification value ForKey: @ "APS"] valueForKey: @ "warning"] valueForKey: @ "title"]; NSString * body = [(NSDictionary *) [(NSDictionary *) [ Notification Price ForKey: @ "APS"] valueForKey: @ "Warning"] valueForKey: @ "body"]; if ([[UIApplicatio n Share app] applicationState] == UIApplicationStateActive {} else if ([[UIApplication sharing application] applicationState] == shared UIApplicationStateInactive || [[UIApplication application] applicationState] == UIApplicationStateBackground) {UILocalNotification * Local Information [[UILocalNotification alloc ] in this]; localNotification.userInfo = userInfo; Local notification. SoundName = UILocalNotificationDefaultSoundName; localNotification.alertBody = body; Local notifications. FireDate = [NSDT Date]; [[UIApplication shared applicant] schedule local notifications: Local Notification]; }}

If your application is in active state show UIAlertView. Its not you need to show a UILocalNotification.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -