Exemplo n.º 1
0
        public AuthenticationService(IMobileServiceClient mobileService, Application application)
        {
            this.mobileService = mobileService;

            application.RegisterActivityLifecycleCallbacks(lifecycleHandler);

            lifecycleHandler.ActivityResumed += (s, e) => currentActivity = e.Activity;
        }
Exemplo n.º 2
0
        public static void Init(Android.App.Application app, bool requestPublishPermissions)
        {
            RequestPublishPermissions = requestPublishPermissions;

            app.RegisterActivityLifecycleCallbacks(activityLifecycleManager);

            FacebookApi.IsUsingNative             = true;
            FacebookApi.ShowFacebookAuthenticator = Login;
        }
Exemplo n.º 3
0
        public static void Init(Android.App.Application app)
        {
            SocialAuthManager.Current.AccountStore.SecureStore = new SecureStore();

            if (activityLifecycleManager == null)
            {
                activityLifecycleManager = new ActivityLifecycleCallbackManager();
                app.RegisterActivityLifecycleCallbacks(activityLifecycleManager);
            }
        }
Exemplo n.º 4
0
        public static void Activate(Android.App.Application app)
        {
            Native.RegisterCallBack("CustomTabs", OnActivityResult);
            OAuthApi.ShowAuthenticator = ShowAuthenticator;

            if (activityLifecycleManager == null)
            {
                activityLifecycleManager = new ActivityLifecycleCallbackManager();
                app.RegisterActivityLifecycleCallbacks(activityLifecycleManager);
            }
            IsActivated = true;
        }
Exemplo n.º 5
0
        private void HandleActivityLifeCycle()
        {
            _callbacks = new MapLifeCycleCallBacks(onPause: _internalMapView.OnPause, onResume: _internalMapView.OnResume);

            _application = Context.ApplicationContext as Android.App.Application;
            if (_application != null)
            {
                _application.RegisterActivityLifecycleCallbacks(_callbacks);
            }
            else
            {
                this.Log().Error("ApplicationContext is invalid, could not RegisterActivityLifecycleCallbacks to release GPS when application is paused.");
            }
        }
        public AutoSuspendHelper(Application hostApplication)
        {
            hostApplication.RegisterActivityLifecycleCallbacks(new ObservableLifecycle(this));

            Observable.Merge(onCreate, onSaveInstanceState).Subscribe(x => LatestBundle = x);

            RxApp.SuspensionHost.IsLaunchingNew = onCreate.Where(x => x == null).Select(_ => Unit.Default);
            RxApp.SuspensionHost.IsResuming = onCreate.Where(x => x != null).Select(_ => Unit.Default);
            RxApp.SuspensionHost.IsUnpausing = onRestart;

            RxApp.SuspensionHost.ShouldPersistState = Observable.Merge(
                onPause.Select(_ => Disposable.Empty), onSaveInstanceState.Select(_ => Disposable.Empty));

            RxApp.SuspensionHost.ShouldInvalidateState = untimelyDemise;
        }
Exemplo n.º 7
0
 public void Register(Android.App.Application application)
 {
     if (mLastApp != null)
     {
         Application app;
         mLastApp.TryGetTarget(out app);
         if (application == app)
         {
             return;
         }
         else
         {
             mLastApp = new WeakReference <Application>(application);
         }
         application.RegisterActivityLifecycleCallbacks(this);
     }
 }
        public ApplicationNavigationService(Application application)
        {
            application.RegisterActivityLifecycleCallbacks(lifecycleHandler);

            lifecycleHandler.ActivityResumed += (s, e) => currentActivity = e.Activity;
        }
Exemplo n.º 9
0
 public SecureStore(Android.App.Application app)
 {
     activityLifecycleManager = new ActivityLifecycleCallbackManager();
     app.RegisterActivityLifecycleCallbacks(activityLifecycleManager);
 }
Exemplo n.º 10
0
 public static void Register(Application app)
 {
     app.RegisterActivityLifecycleCallbacks(new ActivityLifecycleCallbacks());
 }
 /// <summary>
 /// Creates an instance of <see cref="AndroidPlatformProvider"/>.
 /// </summary>
 /// <param name="application">The Android Application</param>
 public AndroidPlatformProvider(Application application) {
     application.RegisterActivityLifecycleCallbacks(lifecycleHandler);
 }
Exemplo n.º 12
0
        protected ActivityAwareService(Application application)
        {
            lifecycleHandler.ActivityResumed += (s, e) => CurrentActivity = e.Activity;

            application.RegisterActivityLifecycleCallbacks(lifecycleHandler);
        }