Example #1
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     UserDialogs.Init(this);
     TabLayoutResource = Resource.Layout.Tabbar;
     ToolbarResource   = Resource.Layout.Toolbar;
     Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);
     base.OnCreate(savedInstanceState);
     global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
     LoadApplication(new App());
     FirebasePushNotificationManager.ProcessIntent(this, Intent);
 }
Example #2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Rg.Plugins.Popup.Popup.Init();
            global::Xamarin.Forms.Forms.Init();
            global::Xamarin.FormsMaps.Init();
            LoadApplication(new App());

            FirebasePushNotificationManager.Initialize(options, true);

            return(base.FinishedLaunching(app, options));
        }
Example #3
0
        /// <summary>
        /// Invoked when the application received a remote notification.
        /// </summary>
        /// <param name="data">The notification data dictionary.</param>
        /// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
        public static async Task DidReceiveMessageAsync(NSDictionary data)
        {
            Log.Debug(Strings.ReceivedNotification, data);

            if (ContainsPullRefreshRequest(data))
            {
                await NotifoIO.DidReceivePullRefreshRequestAsync();
            }

            FirebasePushNotificationManager.DidReceiveMessage(data);
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            CachedImageRenderer.Init(enableFastRenderer: true);
            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
        }
Example #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
            CrossFirebasePushNotification.Current.Subscribe(new string[] { "all" });
        }
Example #6
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            LoadApplication(new App());

            //FCM Integration
            FirebasePushNotificationManager.Initialize(options, true);

            return(base.FinishedLaunching(app, options));
        }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Forms.SetFlags(new[]
            {
                "Expander_Experimental"
            });

            HtmlLabelRenderer.Initialize();
            global::Xamarin.Forms.Forms.Init();

            Rg.Plugins.Popup.Popup.Init();
            XF.Material.iOS.Material.Init();

            IQKeyboardManager.SharedManager.Enable                     = true;
            IQKeyboardManager.SharedManager.EnableAutoToolbar          = true;
            IQKeyboardManager.SharedManager.ShouldResignOnTouchOutside = true;
            IQKeyboardManager.SharedManager.PreviousNextDisplayMode    = IQPreviousNextDisplayMode.AlwaysHide;

            FlowListView.Init();

            LoadApplication(new App());

            FirebasePushNotificationManager.Initialize(options, true);
            FirebasePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Badge | UNNotificationPresentationOptions.Sound;

            UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
            Syncfusion.XForms.iOS.RichTextEditor.SfRichTextEditorRenderer.Init();

            var result = base.FinishedLaunching(app, options);

            app.KeyWindow.TintColor = UIColor.Gray;

            // Color of the tabbar background:
            UITabBar.Appearance.BarTintColor = UIColor.FromRGB(247, 247, 247);

            // Color of the selected tab text color:
            UITabBarItem.Appearance.SetTitleTextAttributes(
                new UITextAttributes()
            {
                TextColor = UIColor.FromRGB(0, 122, 255)
            },
                UIControlState.Selected);

            // Color of the unselected tab icon & text:
            UITabBarItem.Appearance.SetTitleTextAttributes(
                new UITextAttributes()
            {
                TextColor = UIColor.FromRGB(146, 146, 146)
            },
                UIControlState.Normal);

            return(result);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            Forms.Init(this, savedInstanceState);

            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
        }
Example #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.SetTheme(Resource.Style.MainTheme);
            base.OnCreate(savedInstanceState);

            //START FOR FCM
            IsPlayServicesAvailable(); //You can use this method to check if play services are available.
            CreateNotificationChannel();
            //END FOR FCM

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            Forms.Init(this, savedInstanceState);

            //Start Plugin Initialization

            //GOOGLE MAPS
            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState);

            //PopUps
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);

            //PERMISSIONS PLUGIN
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

            //End Plugin Initialization

            //FOR DEVICE ID
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);
            //END FOR DEVICE ID

            //FOR QR/BAR SCANNER
            global::ZXing.Net.Mobile.Forms.Android.Platform.Init();
            //END FOR QR/BAR SCANNER

            LoadApplication(new App());

            //FOR FCM PUSH NOTIFICATIONS
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
            //END FCM PUSH NOTIFICATIONS

            //VERIFICO LA INFO QUE RECIBO DE LA PUSH NOTIFICATION DE FCM

            /*Bundle bundle = Intent.Extras;
             * System.Diagnostics.Debug.WriteLine(bundle);
             * if (bundle != null)
             * {
             *  Xamarin.Forms.Application.Current.MainPage = new MenuPage();
             *  Xamarin.Forms.Application.Current.MainPage.Navigation.PushModalAsync(new PaymentPopUpView());
             * }*/
        }
Example #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);

            Microsoft.AppCenter.AppCenter.Start("c85c73c5-c73d-4870-8dca-9bd1cb8edab8", typeof(Analytics), typeof(Crashes));
        }
Example #11
0
        public override void OnCreate()
        {
            base.OnCreate();
            RegisterActivityLifecycleCallbacks(this);
            //If debug you should reset the token each time.
//#if DEBUG
            //FirebasePushNotificationManager.Initialize(this, new NotificationUserCategory[]
            //{
            //new NotificationUserCategory("message",new List<NotificationUserAction> {
            //    new NotificationUserAction("Reply","Reply",NotificationActionType.Foreground),
            //    new NotificationUserAction("Forward","Forward",NotificationActionType.Foreground)

            //}),
            //new NotificationUserCategory("request",new List<NotificationUserAction> {
            //    new NotificationUserAction("Accept","Accept",NotificationActionType.Default,"check"),
            //    new NotificationUserAction("Reject","Reject",NotificationActionType.Default,"cancel")
            //})

            //}, true);
//#else

//#endif

            FirebasePushNotificationManager.Initialize(this, new NotificationUserCategory[]
            {
                new NotificationUserCategory("message", new List <NotificationUserAction> {
                    new NotificationUserAction("Reply", "Reply", NotificationActionType.Foreground),
                    new NotificationUserAction("Forward", "Forward", NotificationActionType.Foreground)
                }),
                new NotificationUserCategory("request", new List <NotificationUserAction> {
                    new NotificationUserAction("Accept", "Accept", NotificationActionType.Default, "check"),
                    new NotificationUserAction("Reject", "Reject", NotificationActionType.Default, "cancel")
                })
            }, false);


            //CrossFirebasePushNotification.Current.OnNotificationReceived += (s, p) =>
            //{
            //    System.Diagnostics.Debug.WriteLine("NOTIFICATION RECEIVED", p.Data);

            //};

            //Set the default notification channel for your app when running Android Oreo
            if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
            {
                //Change for your default notification channel id here
                FirebasePushNotificationManager.DefaultNotificationChannelId = "DefaultChannel";

                //Change for your default notification channel name here
                FirebasePushNotificationManager.DefaultNotificationChannelName = "General";
            }
        }
        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            //if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
            //{
            //    byte[] result = new byte[deviceToken.Length];
            //    Marshal.Copy(deviceToken.Bytes, result, 0, (int)deviceToken.Length);
            //    deviceToken = BitConverter.ToString(result).Replace("-", "");
            //    Debug.WriteLine($"Device Token iOS: " + deviceToken);
            //}

            FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
            UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
        }
Example #13
0
        public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action <UIBackgroundFetchResult> completionHandler)
        {
            if (application.ApplicationState == UIApplicationState.Inactive)
            {
                var data = PushNotificationHandler.GetParameters(userInfo);
                App.OnNotificationOpened(null, new FirebasePushNotificationResponseEventArgs(data));
                completionHandler(UIBackgroundFetchResult.NewData);
                return;
            }

            FirebasePushNotificationManager.DidReceiveMessage(userInfo);
            completionHandler(UIBackgroundFetchResult.NewData);
        }
Example #14
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            App.ScreenWidth  = UIScreen.MainScreen.Bounds.Width;
            App.ScreenHeight = UIScreen.MainScreen.Bounds.Height;

            Rg.Plugins.Popup.Popup.Init();
            FormsMaps.Init();
            Forms.SetFlags("CollectionView_Experimental");
            global::Xamarin.Forms.Forms.Init();
            CachedImageRenderer.Init();
            new SfRatingRenderer();
            Material.Init();
            ImageCircleRenderer.Init();
            //Distribute.DontCheckForUpdatesInDebug();

            LoadApplication(new App());
            //FirebasePushNotificationManager.Initialize(options, true);


            FirebasePushNotificationManager.Initialize(options, new NotificationUserCategory[]
            {
                new NotificationUserCategory("message", new List <NotificationUserAction> {
                    new NotificationUserAction("Reply", "Reply", NotificationActionType.Foreground)
                }),
                new NotificationUserCategory("request", new List <NotificationUserAction> {
                    new NotificationUserAction("Accept", "Accept"),
                    new NotificationUserAction("Reject", "Reject", NotificationActionType.Destructive)
                })
            });
            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                var authOptions = UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound;
                UNUserNotificationCenter.Current.RequestAuthorization(authOptions, (granted, error) =>
                {
                    Console.WriteLine(granted);
                });
                UNUserNotificationCenter.Current.Delegate = new MyNotificationCenterDelegate();
            }
            else
            {
                // iOS 9 <=
                var allNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound;
                var settings             = UIUserNotificationSettings.GetSettingsForTypes(allNotificationTypes, null);
                UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
            }


            UIApplication.SharedApplication.StatusBarHidden = true;
            return(base.FinishedLaunching(app, options));
        }
Example #15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            global::Xamarin.Forms.Forms.SetFlags("SwipeView_Experimental");
            UserDialogs.Init(this);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
            Window.SetStatusBarColor(Color.FromHex("#333333").ToAndroid());

            base.OnCreate(savedInstanceState);
            CrossCurrentActivity.Current.Init(this, savedInstanceState);
            Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
        }
Example #17
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
            global::Xamarin.Forms.Forms.Init();
            DependencyService.Register <IFacebookService, FacebookService>();
            LoadApplication(new App());

            FirebasePushNotificationManager.Initialize(options, true);
            FirebasePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert;

            global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init(); // google sign
            ImageCircleRenderer.Init();
            return(base.FinishedLaunching(app, options));
        }
Example #18
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            CrossCurrentActivity.Current.Init(this, savedInstanceState);
            ZXing.Net.Mobile.Forms.Android.Platform.Init();
            MobileBarcodeScanner.Initialize(Application);
            Xamarin.FormsMaps.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            FirebasePushNotificationManager.ProcessIntent(this, Intent);

            LoadApplication(new App());
        }
Example #19
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            LibVLCSharpFormsRenderer.Init();
            SQLitePCL.Batteries_V2.Init();
            Rg.Plugins.Popup.Popup.Init();
            global::Xamarin.Forms.Forms.Init();
            ZXing.Net.Mobile.Forms.iOS.Platform.Init();
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
            ImageCircleRenderer.Init();
            CrossMediaManager.Current.Init();
            LoadApplication(new App());

            FirebasePushNotificationManager.Initialize(options, true);
            return(base.FinishedLaunching(app, options));
        }