ios - Local Notification Banners Don't Appear -


i making app requires notifications sent user. far, have registered notifications in app delegate:

let notiftypes: uiusernotificationtype = [.alert, .badge, .sound]     let notifsettings = uiusernotificationsettings(fortypes: notiftypes, categories: nil)     uiapplication.sharedapplication().registerusernotificationsettings(notifsettings) 

and call following code send notifications in view controller:

 let localnotification: uilocalnotification = uilocalnotification()  localnotification.alertaction = "testing notifications on ios8"  localnotification.alertbody = "here notification"  localnotification.firedate = nsdate(timeintervalsincenow: 5)  localnotification.soundname = uilocalnotificationdefaultsoundname  uiapplication.sharedapplication().schedulelocalnotification(localnotification) 

if pull down notification center panel, notification shown, there no banner if out of app, , no notification shows on lock screen if phone off. how can notifications show on lock screen/as banners if outside of app?

what see, in role of user, when notification fires depends on settings in preferences. you'd need go settings , configure app display banners , display notifications in lock screen.

also suggest purposes of testing should schedule notification @ bit later interval. saying nsdate(timeintervalsincenow: 5) - not time out of app! notification may firing while still in app — in case no banner appear.


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -