void OnApplicationFocus(bool focus)
 {
     if (analyticsManager != null)
     {
         if (focus)
         {
             analyticsManager.ResumeSession();
         }
         else
         {
             analyticsManager.PauseSession();
         }
     }
 }
Beispiel #2
0
        public void Init()
        {
            var config = new MobileAnalyticsManagerConfig();

            config.AllowUseDataNetwork = true;                                                      // Override the default Mobile Analytics Manager configuration if you need.

            _manager = MobileAnalyticsManager.GetOrCreateInstance(_amazonMobileAnalyticsAppId,      //Amazon Mobile Analytics App ID
                                                                  new CognitoAWSCredentials(
                                                                      _amazonCognitoIdentityPoolId, //Amazon Cognito Identity Pool ID
                                                                      RegionEndpoint.USEast1),
                                                                  RegionEndpoint.USEast1,
                                                                  config);

            _manager.ResumeSession();

            Enabled = true;
        }
 protected override void OnResume()
 {
     _manager.ResumeSession();
     base.OnResume();
 }