swift - Save data from ios push notification if app is not running(Parse) -
i using parse push notification service.
if app running , data notification in following delegate function.
func application(application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject]) { pfpush.handlepush(userinfo) println(userinfo) if application.applicationstate == uiapplicationstate.inactive { } } but in case if app not running, , notification generates, dont, konw function used generate notification , data notification.
if app not running (background or foreground) way notification payload data when user opens app tapping on notification. if happens can use didfinishlaunchingwithoptions method retrieve data. other that, best way store payload data store in server side database send out notification. can make request retrieve notifications. give mechanism manage badge counts.
Comments
Post a Comment