I am applying for WordPress with ionic. But I have a problem?
I want to go to the article when I click on the notification. How ? I’m using OneSignal.
My codes:
var notificationOpenedCallback = function(jsonData) {
console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
};
window.plugins.OneSignal
.startInit(" app - id ")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
There is no navigation performed on your handler.
Should look like this:
.run(function($ionicPlatform, $state) {
$ionicPlatform.ready(function() {
var notificationOpenedCallback = function(jsonData) {
if (jsonData.additionalData) {
if (jsonData.additionalData.myappurl)
$state.go('app.post', {'postId': + jsonData.additionalData.myKey});
}
}
})
// the rest of your code
})
1 Like
thanks your comments
I added these codes. But there is one more responsibility?
How do I add the post ID when sending a notification via Onesignal?
Options >> Collapse Key / ID? is Correct ?
example : http://i.hizliresim.com/1V1m7B.png
I use Additional Data for everything i send from the server. I think Collapse Key is used for a different purpose, which is to stack/replace an existing unread notification.
thanks your comments @thesourav