Is it possible to pop up local notifications while the iphone app is on screen?

后端 未结 3 1474
礼貌的吻别
礼貌的吻别 2021-01-04 23:40

I need a local notification for an iphone app to pop up while the app is active. Is this possible? If so how?

3条回答
  •  醉酒成梦
    2021-01-05 00:26

    - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
    

    is called if you have a notification scheduled and the app is already running..it is a UIApplication delegate method..

    here you can do your custom code..by accessing the notification...

    edit :

    if you want to present a notification right now .. then you can just set the notification fire date to past...it will be fired..then you can create a alert view in the above given UIapplication method

提交回复
热议问题