Forum Xamarin.Forms

Timeout exceptions generated whenever onReceive gets triggered

russferns22russferns22 Member ✭✭
edited August 2018 in Xamarin.Forms

I've basically tried all work arounds possible,referred to many online solutions for a possible solution but I keep getting this timeout exception whenever my phone attempts to detect an incoming call I end up receiving a timeout exception. I even implemented the same app in android studio and it worked perfectly fine but wont wok for xamarin forms.

IncomingCallReceiver is my class which handles the receiver:

[BroadcastReceiver(Enabled = true)]
[IntentFilter(new[] { "android.intent.action.ACTION_PHONE_STATE_CHANGED" })]
public class IncomingCallReceiver : BroadcastReceiver
private static readonly string TAG = "IncomingCallReceiver";
public override void OnReceive(Context context, Intent intent)
{ Console.WriteLine("Receiver start");
Toast.MakeText(context, " Receiver start ", ToastLength.Long).Show(); }
catch (Exception e)
{ string s = e.StackTrace; }

Sign In or Register to comment.