Sonali
Sonali

Reputation: 2283

Xamarin IOS : Task delay issue

I have created an app using Xamarin Form. In that app, I have created an ExtendedWebView so that I can call javascript function from C#. I have given a delay of about 50 milliseconds before calling my javascript function. In all devices like Android, iOS 10, Windows 8, Windows 8.1 and Windows 10. Everything is working fine. But in iOS 11, the javascript function that I am calling is getting lagging over the time. I don't know why this is happening in ios 11. Are there any changes that have been made in ios 11 webview? I am using UIWebview. I tried to cast it into WkWebview but still having the same issue.

Task.Delay(TimeSpan.FromMilliseconds(48)).Wait();
Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
{
    if (this.WebViewContainer.Children.Count > this.AudioPage)
    {
        ((ExtendedWebview)this.WebViewContainer.Children[this.AudioPage]).Eval("timeUpdater1(" + this.Position + ")");
    }
    AudioState = _audioPlayer.GetMediaState();
});

I am using Xamarin Forms v2.3.2.127. Can it be due to out dated Xamarin Form?

Upvotes: 4

Views: 646

Answers (1)

micah hawman
micah hawman

Reputation: 106

I suggest spinning up a sample project with latest and greatest and try your code there. I'm not 100% sure but forms 2.3.2 is wayyyyy outdated as they are on 2.5.x I would also check what version of xamarin you have installed as there are updates to editors and the pipelines that make a difference in how the app is compiled and sent to the device.

(try to keep up to date if possible.)

if you have a separate machine make sure everything is updated and test it there, if not and you can't update you might check with the xamarin forums to ask people who work at xamarin if you need to truly update.

Upvotes: 1

Related Questions