freshplanet / ANE-Push-Notification

Air Native Extension (iOS and Android) for Push Notification
Apache License 2.0
205 stars 104 forks source link

Can't send local notifications #19

Closed vrcmarcos closed 11 years ago

vrcmarcos commented 11 years ago

Hi,

I can't figure how to setup a local notification. I think I'm doing all configurations right and the app don't send a local notification. My code:

var _pushNotification:PushNotification = PushNotification.getInstance(); _pushNotification.registerForPushNotification(GOOGLE_PROJECT_ID); _pushNotification.sendLocalNotification("test", 1369827600, "test");

1369827600 = 05/29/2013, 11:40:00 AM in seconds ( Since 1/1/1970 ) and, when I install the apk on my phone, the phone hour was 05/29/2013, 11:32.

This is a real issue or am I doing something wrong?

vrcmarcos commented 11 years ago

Sorry. The problem was on my side. When I get the timestamp param with new Date().getTime(), I was able to see the Local Notification.

esdebon commented 10 years ago

Then what is the correct way to do it?

Im using:

public function local(msg:String, min:int, title:String):void{ _pushNotification.sendLocalNotification(msg, ((min * 60 * 1000) + new Date().getTime()), title); }

But no works

esdebon commented 10 years ago

Ok, with this function the local notifications works

public function local(msg:String, seg:int, title:String):void{
        if(PushNotification.getInstance().isPushNotificationSupported){
            push.sendLocalNotification(msg, (((seg *  1000) + new Date().getTime())/1000), title);
        }
    }