When a push notification appears, the user immediately clicks the application, the push notification remains in the notification center. How can I get a message from the notification center? I want to get it and save it locally so that users can view them later.
I can save a push notification if I click on a warning from the notification center when a push notification arrives. or I can save a push notification when the application is running.
in AppDelegate.m
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [PFPush handlePush:userInfo]; //save the alert [FunctionNSObject savePushNotification:userInfo]; }
in MyTableViewController.m
- (void)viewDidLoad { [super viewDidLoad]; //load push notification from file sortedMessages = [FunctionNSObject loadPushNotification]; }
- push- , (, ), . , , , , , , - , , - . APNS - , .
, Facebook Whatsapp, , , APNS "", .
, APNS, APNS , , , , .
didFinishLaunchingWithOptions
if ([[launchOptions allKeys] containsObject:UIApplicationLaunchOptionsRemoteNotificationKey]) { id userInfo=[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; }
, ,
Source: https://habr.com/ru/post/1539221/More articles:How to listen to network traffic on an interface / device using Java? - javaHow to upload instagram images in web browser to pc? - instagramHow to warn start and end dates of next week - jqueryHow to implement recursive sqlite3 function on Android devices - androidCan I bend a UISlider in half to make a 90 ° angle? - iosInfiniband in Java - javaGet URL of selected tab from extension - javascriptЭкспонировать запись файла на веб-страницу с расширением Firefox - javascriptInconsistent default button behavior in WP8.1 Universal or Silverlight 8.1 / Windows 8.1 / earlier - win-universal-appГде Rails 4 хранит токен аутентификации для защиты CSRF? - securityAll Articles