public virtual async void OnReceive(Context context, Intent intent) { NotificationBroadcastReceiver broadcastReceiver = this; if (context == null || intent == null || !(intent.get_Action() == "OpenNotification")) { return; } await MvvmCrossHelper.Init(context); bool isNewTaskRequired = broadcastReceiver.IsContextIsService(context); if (MainActivity.instance == null) { broadcastReceiver.StartNewMainActivity(context, isNewTaskRequired, intent); } else if (CrossCurrentActivity.get_Current().get_Activity() == null) { broadcastReceiver.StartNewMainActivity(context, isNewTaskRequired, intent); ((IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>()).Publish <DelayedOpenNotificationMessage>((M0) new DelayedOpenNotificationMessage((object)broadcastReceiver, NotificationBroadcastReceiver.CreatePushMessageBundle(intent.get_Extras()))); } else { await broadcastReceiver.NavigateToRootPage(); ((IMvxMessenger)Mvx.get_IoCProvider().Resolve <IMvxMessenger>()).Publish <DelayedOpenNotificationMessage>((M0) new DelayedOpenNotificationMessage((object)broadcastReceiver, NotificationBroadcastReceiver.CreatePushMessageBundle(intent.get_Extras()))); } }
protected virtual void OnCreate(Bundle bundle) { base.OnCreate(bundle); Rg.Plugins.Popup.Popup.Init((Context)this, bundle); Xamarin.Essentials.Platform.Init((Activity)this, bundle); FormsAppCompatActivity.set_ToolbarResource(2131427436); FormsAppCompatActivity.set_TabLayoutResource(2131427435); Application.set_Current(((IMvxFormsViewPresenter)Mvx.get_IoCProvider().GetSingleton <IMvxFormsViewPresenter>()).get_FormsApplication()); FormsAppCompatActivity.set_ToolbarResource(2131427436); FormsAppCompatActivity.set_TabLayoutResource(2131427435); MainActivity.instance = this; CrossCurrentActivity.get_Current().set_Activity((Activity)this); CachedImageRenderer.Init(new bool?(false)); CrossMobileAnalytics.Current.Register <GoogleMobileAnalyticsProvider>(); CrossMobileAnalytics.Current.Register <HockeyAppMobileAnalyticsProvider>(); if (((Activity)this).get_Intent().get_Data() != null) { ConfigurationRepository.SetEnvironment(((Activity)this).get_Intent().get_Data().ToString()); if (Settings.Environment != ConfigurationRepository.EnvironmentSetting.Environment) { Settings.Reset(); } } ProtectedAppsChecker.CheckProtectedAppsFeature((Context)this); }
public void SendEvent(string eventId, IDictionary <string, string> parameters) { try { Firebase.Analytics.FirebaseAnalytics instance = Firebase.Analytics.FirebaseAnalytics.GetInstance((Context)CrossCurrentActivity.get_Current().get_Activity()); if (parameters == null) { instance.LogEvent(eventId, (Bundle)null); } else { Bundle bundle = new Bundle(); foreach (KeyValuePair <string, string> parameter in (IEnumerable <KeyValuePair <string, string> >)parameters) { ((BaseBundle)bundle).PutString(parameter.Key, parameter.Value); } instance.LogEvent(eventId, bundle); } } catch (Exception ex) { CrossMobileAnalytics.Current.TrackException(ex, (IDictionary <string, string>)null, nameof(SendEvent), "/Users/admin/myagent/macMiniBlack3/_work/2/s/eKreta.Mobile/eKreta.Mobile/eKreta.Mobile.Android/Platform/FirebaseAnalytics/FirebaseAnalytics.cs", 50); } }
protected virtual void OnResume() { base.OnResume(); CrossCurrentActivity.get_Current().set_Activity((Activity)this); }
protected virtual void OnPause() { base.OnPause(); CrossCurrentActivity.get_Current().set_Activity((Activity)null); }
public void OnActivityStarted(Activity activity) { CrossCurrentActivity.get_Current().set_Activity(activity); }
public void OnActivityCreated(Activity activity, Bundle savedInstanceState) { CrossCurrentActivity.get_Current().set_Activity(activity); }