예제 #1
0
        public override void OnMAMCreate()
        {
            // Register the notification receivers
            IMAMNotificationReceiverRegistry registry = MAMComponents.Get <IMAMNotificationReceiverRegistry>();

            registry.RegisterReceiver(new MAMNotificationReceiver(), MAMNotificationType.MamEnrollmentResult);

            base.OnMAMCreate();
        }
예제 #2
0
        public EnrollmentService(ILoggingService loggingService)
        {
            _loggingService        = loggingService;
            _enrollmentManager     = MAMComponents.Get <IMAMEnrollmentManager>();
            _notificationRegistery = MAMComponents.Get <IMAMNotificationReceiverRegistry>();

            _authenticationResult = null;
            _registerError        = null;
            Endpoint           = null;
            RegisteredAccounts = new List <string>();

            _notificationRegistery.RegisterReceiver(this, MAMNotificationType.MamEnrollmentResult);
            _notificationRegistery.RegisterReceiver(this, MAMNotificationType.RefreshPolicy);
            _enrollmentManager.RegisterAuthenticationCallback(new MAMWEAuthCallback());
        }
        public override void OnMAMCreate()
        {
            // as per Intune SDK doc, callback registration must be done here.
            // https://docs.microsoft.com/en-us/mem/intune/developer/app-sdk-android
            IMAMEnrollmentManager mgr = MAMComponents.Get <IMAMEnrollmentManager>();

            mgr.RegisterAuthenticationCallback(new MAMWEAuthCallback());

            // Register the notification receivers to receive MAM notifications.
            // Along with other, this will receive notification that the device has been enrolled.
            IMAMNotificationReceiverRegistry registry = MAMComponents.Get <IMAMNotificationReceiverRegistry>();

            registry.RegisterReceiver(new EnrollmentNotificationReceiver(), MAMNotificationType.MamEnrollmentResult);

            base.OnMAMCreate();
        }
예제 #4
0
        public override void OnMAMCreate()
        {
            // Register the MAMAuthenticationCallback as soon as possible.
            // This will handle acquiring the necessary access token for MAM.
            IMAMEnrollmentManager mgr = MAMComponents.Get <IMAMEnrollmentManager>();

            mgr.RegisterAuthenticationCallback(new MAMWEAuthCallback());

            // Register the notification receivers to receive MAM notifications.
            // Applications can receive notifications from the MAM SDK at any time.
            // More information can be found here: https://docs.microsoft.com/en-us/intune/app-sdk-android#register-for-notifications-from-the-sdk
            IMAMNotificationReceiverRegistry registry = MAMComponents.Get <IMAMNotificationReceiverRegistry>();

            foreach (MAMNotificationType notification in MAMNotificationType.Values())
            {
                registry.RegisterReceiver(new ToastNotificationReceiver(this), notification);
            }
            registry.RegisterReceiver(new EnrollmentNotificationReceiver(this), MAMNotificationType.MamEnrollmentResult);
            registry.RegisterReceiver(new WipeNotificationReceiver(this), MAMNotificationType.WipeUserData);

            base.OnMAMCreate();
        }