test gprs test gprs - 3 months ago 20
Swift Question

APNS Save Notifications

I am working on

iOS
notifications with
APNS
. I can send and receive notifications. I want to save this notifications on phone. For example my apps receives daily temperature status notification via
APNS
and this message like "temp: 25C 16.08.2016". I want to save this message in phone user defaults when notification receive. When user want to see past temperatures i want to show list include notification messages. List like;

16.08.2016 25C

15.08.2016 26C

14.08.2016 21C
.
.
.

Answer

You can get it in AppDelegate in application:didReceiveRemoteNotification: method from userInfo.