public override void OnCreate()
        {
            base.OnCreate();

            //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
                AzurePushNotificationManager.DefaultNotificationChannelId = "DefaultChannel";

                //Change for your default notification channel name here
                AzurePushNotificationManager.DefaultNotificationChannelName = "General";
            }

            #if DEBUG
            AzurePushNotificationManager.Initialize(this, AzureConstants.ListenConnectionString, AzureConstants.NotificationHubName, true);
            #else
            AzurePushNotificationManager.Initialize(this, AzureConstants.ListenConnectionString, AzureConstants.NotificationHubName, false);
            #endif


            //Handle notification when app is closed here
            CrossAzurePushNotification.Current.OnNotificationReceived += (s, p) =>
            {
            };
        }
        //
        // 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)
        {
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());
            AzurePushNotificationManager.Initialize(AzureConstants.ListenConnectionString, AzureConstants.NotificationHubName, options);
            AzurePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Badge;

            return(base.FinishedLaunching(app, options));
        }
Beispiel #3
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)
        {
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());
            KeyboardOverlapRenderer.Init();
            AzurePushNotificationManager.Initialize(Constants.ListenConnectionString, Constants.NotificationHubName, options, true);
            AzurePushNotificationManager.CurrentNotificationPresentationOption = UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Badge;
            CrossAzurePushNotification.Current.RegisterAsync(new string[] { "ios", "general" });


            ZXing.Net.Mobile.Forms.iOS.Platform.Init();


            return(base.FinishedLaunching(app, options));
        }
Beispiel #4
0
        public override void OnCreate()
        {
            base.OnCreate();
            Xamarin.Essentials.Platform.Init(this);

            if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
            {
                AzurePushNotificationManager.DefaultNotificationChannelId   = "SalesWorkforce";
                AzurePushNotificationManager.DefaultNotificationChannelName = "SalesWorkforce";
            }

            //AzurePushNotificationManager.IconResource = MyOSMv2.Droid.Resource.Drawable.logo_notification;

#if DEBUG
            AzurePushNotificationManager.Initialize(this, AppConstants.APNHubConnectionString, AppConstants.APNHubName, resetToken: false, autoRegistration: false);
#else
            AzurePushNotificationManager.Initialize(this, AppConstants.APNHubConnectionString, AppConstants.APNHubName, resetToken: false, autoRegistration: false);
#endif
            CrossAzurePushNotification.Current.OnNotificationReceived += (s, p) =>
            {
            };
        }