我想每天在xamarin.ios上播放AVplayer,每天播放5次,例如(1 PM,2Pm,3Pm,4Pm,5Pm)。我尝试了5次通知期间。但是通知方法无法播放avplayer ...请帮助我如何在给定时间播放5次avplayer?
答案 0 :(得分:0)
您能否告知在本地通知期间触发哪种方法 手机锁定时会发生
应用终止后,您可以尝试:
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
UILocalNotification localNotif = launchOptions.ObjectForKey(UIApplication.LaunchOptionsLocalNotificationKey) as UILocalNotification;
if (localNotif != null)
{
//check if it is your local notification
//localNotif.UserInfo;
//Try add your method here
}
return true;
}
如果您的应用程序在后台运行,则可以尝试在此处添加方法:
public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification)
{
base.ReceivedLocalNotification(application, notification);
//Add your method here
}