Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Use ionicPopup.alert in push.on - phonegap-push-plugin

$
0
0

@bongo wrote:

Hello,

I have implemented push notification inside my ionic app using phonegap-push-plugin.
Everything working fine except in the push.on ('notification'.
The default code include a simple alert(); when a notification is received. Which not really sexy.
I would like to use ionicPopup. But can't manage to make it work.
I always get an error like alert undefined...

I am new to Angular so maybe this is not the right way.
In my app.js I have the push notification code:

push.on('notification', function(data, $ionicPopup) {
$ionicPopup.alert({
title: data.title,
template: data.message
});
});

Nothing happens here, an error undefined.
It is working if I use alert(data.message).

Do I need to create a controller, a service ? And trigger it in that push.on function ? How to do that if this is it?
Any help would be great.

Best regards,

Quentin

Best regards,

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>