1

I have the latest Notification ANE for iOS at the moment and I have a couple of questions about set up and display of these notifications

When I set up categories is it necessary to set all the parameters that appear in the example to show actions?(or for example we can set up categories without including .setIcon( "ic_stat_distriqt_default" ) for example) This is the code I am using to set up a category:

        service.categories.push(
                new CategoryBuilder()
                        .setIdentifier( Constants.REMINDER_CATEGORY )
                        .addAction(
                        new ActionBuilder()
                                .setTitle( "Snooze" )
                                .setIdentifier( "ACCEPT_IDENTIFIER" )
                                .build()
                        )
                        .addAction(
                        new ActionBuilder()
                                .setTitle( "Accept" )
                                .setDestructive( true )
                                .setIdentifier( "DELETE_IDENTIFIER" )
                                .build()
                        )
                        .build()
        );

One the other hand I am using for now two types of notification, simple and delayed. Simple notification is being displayed normally in notifications box and the event is being dispatched, however delayed notifications is not being displayed in notifications box but event is being dispatched.(Both cases with App open) Is this the normal behaviour of delayed notification? Will App dispatch and receive a delayed notification even if it's closed?

Here it's my code for both cases:

//simple notification
public function notifySimple(vo:LocalNotificationVO):void{
    if (Notifications.isSupported)
    {
        _service.notify(
                new NotificationBuilder()
                        .setId( vo.id )
                        .setAlert( vo.type )
                        .setTitle( vo.tittle +": "+vo.body) 
                        .setBody( vo.body )
//                            .setSound( vo.soundPath )
                        .enableVibration(vo.enableVibration)
                        .setPayload( vo.payload )
                        .build()
        );
    }
}
//Delayed notification
public function setReminderNotification(vo:LocalNotificationVO):void
{
    if (Notifications.isSupported)
    {
        _service.notify(
                new NotificationBuilder()
                        .setId( vo.id )
                        .setDelay( vo.delay ) // Show the notification 5 seconds in the future
                        .setRepeatInterval( NotificationRepeatInterval.REPEAT_NONE ) // Repeat the notification every hour
                        .setAlert( vo.tittle )
                        .setTitle( vo.body ) //
                        .setBody( vo.body ) //Body is not displayed
//                            .setSound( vo.soundPath ) //SOUNDS DISABLED FOR NOW
//                            .enableVibration(vo.enableVibration)
//                            .setPayload( vo.payload )
//                            .setCategory( Constants.REMINDER_CATEGORY )
                        .build()
        );
    }
}

Being LocalNotificationVO (With getters that I didn't include):

public function LocalNotificationVO(id:int,
                                    type:String,
                                    tittle:String,
                                    body:String,
                                    payload:String,
                                    delay:int = 0,
                                    enableVibration:Boolean = true,
                                    soundPath:String = "") {
    _id = id;
    _type = type;
    _tittle = tittle;
    _body = body;
    _payload = payload;
    _delay = delay;
    _enableVibration = enableVibration;
    _soundPath = soundPath;
}

Thank you very much in advance

sdvr
  • 41
  • 5

0 Answers0