objective c - Receiving APNS notification but cant display on device in ios -
Hello everyone, I'm trying to implement But my problem is how I I can display push in device like other push notifications Currently I have Thanks in advance for both upwards. Firstly check these applications through these methods to verify that if your registered successfully. APNS then If your application is in active state show UIAlertView. Its not you need to show a UILocalNotification. 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 ******}
IOS 7.0 and XCode Version 5.1.1 (5B1008)
- (void) application: (UIApplication *) application didRegisterForRemoteNotificationsWithDeviceToken: (NSData *) deviceToken {} - (void) application: (UIApplication *) application didFailToRegisterForRemoteNotificationsWithError: (NSError *] Error { }
- (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]; }}
Comments
Post a Comment