I am using the following library to generate push notifications.
https://github.com/edamov/pushok
I got the push notifications working but I don't know how to extract the response in Swift 3.
Here is what I have.
// Push notification received
func application(_ application: UIApplication, didReceiveRemoteNotification data: [AnyHashable : Any]) {
// Print notification payload data
print("Push notification received: \(data)")
let aps = data[AnyHashable("aps")]!
print(aps)
}
I can create the push notifications and the console message works but prints out this...
Push notification received: [AnyHashable("samplekey"): samplevalue, AnyHashable("aps"): {
alert = {
body = hey;
title = "Hello!";
};
sound = default;
}]
{
alert = {
body = hey;
title = "Hello!";
};
sound = default;
}
So my question is how do I access the data inside of alert for the 'body' and 'title'?
I tried accessing the variables but I keep getting errors because I'm not sure how I'm supposed to access it and could not find any documentation on this subject in any tutorials.
push-notification
in laravel – Kimmy