如何使用Xamarin.ios在IOS中运行后台任务?

时间:2018-11-14 05:45:32

标签: c# xaml xamarin xamarin.forms xamarin.ios

我已经为后台任务功能编写了代码。但无法执行PerformFetch方法。

 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
        global::Xamarin.Forms.Forms.Init();

            UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(MINIMUM_BACKGROUND_FETCH_INTERVAL);

            LoadApplication(new App());

            return base.FinishedLaunching(app, options);
        }

 public override void PerformFetch(UIApplication application, Action<UIBackgroundFetchResult> completionHandler)
        {
            base.PerformFetch(application, completionHandler);
            Helper.Value = DateTime.Now.ToShortDateString();
        }

0 个答案:

没有答案