C# 클래스 Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManager

MobileAnalyticsManager is the entry point to recording analytic events for your application
상속: IDisposable
파일 보기 프로젝트 열기: aws/aws-sdk-net 1 사용 예제들

Private Properties

프로퍼티 타입 설명
GetOrCreateInstanceHelper MobileAnalyticsManager
MobileAnalyticsManager System
OnRaiseErrorEvent void

공개 메소드들

메소드 설명
AddCustomAttributeToClientContext ( string key, string value ) : void

Adds client context custom attribute Refer Rest API for more information

Dispose ( ) : void

Implement the dispose pattern

GetInstance ( string appID ) : MobileAnalyticsManager

Gets Mobile Analytics Manager instance by Application ID. Returns Mobile Analytics Manager instance if it's found. Throws InvalidOperationException if the instance has not been instantiated.

GetOrCreateInstance ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint ) : MobileAnalyticsManager

Gets or creates Mobile Analytics Manager instance. If the instance already exists, returns the instance; otherwise creates new instance and returns it.

GetOrCreateInstance ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig ) : MobileAnalyticsManager

Gets or creates Mobile Analytics Manager instance. If the instance already exists, returns the instance; otherwise creates new instance and returns it.

PauseSession ( ) : void

Pauses the current session. PauseSession() is the entry point into the Amazon Mobile Analytics SDK where sessions can be paused. Session is created and started immediately after instantiating the MobileAnalyticsManager object. The session remains active until it is paused. When in a paused state, the session time will not accumulate. When resuming a session, if enough time has elapsed from when the session is paused to when it's resumed, the session is ended and a new session is created and started. Otherwise, the paused session is resumed and the session time continues to accumulate. Currently session time out default value is 5 seconds. For example, on Android platform, when MobileAnalyticsManager is first instantiated, it creates Session 1. As the user transitions from activity to activity, the old activity will pause the current session, and the new activity will immediately resume the current session. In this case, Session 1 remains active and accumulates session time. The user continues to use the App for a total of 3 minutes, at which point, the user receives a phone call. When transitioning to the phone call, the current activity will pause the session and then transition to the phone app. In this case Session 1 remains paused while the phone call is in progress and session time does not accumulate. After completing the phone call a few minutes later, the user returns to the App and the activity will resume Session 1. Since enough time has elapsed since resuming Session 1, Session 1 will be ended with a play time of 3 minutes. Session 2 will then be immediately created and started. In order for MobileAnalyticsManager to track sessions, you must call the PauseSession() and ResumeSession() in each activity of your app. The example below shows how to pause and resume session in Xamarin Android public class MainActivity : Activity { private static MobileAnalyticsManager _manager = null; protected override void OnCreate(Bundle bundle) { _manager = MobileAnalyticsManager.GetOrCreateInstance(YourAppId, YourCredential, RegionEndpoint.USEast1, YourConfig); base.OnCreate(bundle); } protected override void OnResume() { await _manager.ResumeSession(); base.OnResume(); } protected override void OnPause() { await _manager.PauseSession(); base.OnPause(); } }

RecordEvent ( CustomEvent customEvent ) : void

Records the custom event to the local persistent storage. Background thread will deliver the event later.

ResumeSession ( ) : void

Resume the current session. ResumeSession() is the entry point into the Amazon Mobile Analytics SDK where sessions can be resumed. Session is created and started immediately after instantiating the MobileAnalyticsManager object. The session remains active until it is paused. When in a paused state, the session time will not accumulate. When resuming a session, if enough time has elapsed from when the session is paused to when it's resumed, the session is ended and a new session is created and started. Otherwise, the paused session is resumed and the session time continues to accumulate. Currently session time out default value is 5 seconds. For example, on Android platform, when MobileAnalyticsManager is first instantiated, it creates Session 1. As the user transitions from activity to activity, the old activity will pause the current session, and the new activity will immediately resume the current session. In this case, Session 1 remains active and accumulates session time. The user continues to use the App for a total of 3 minutes, at which point, the user receives a phone call. When transitioning to the phone call, the current activity will pause the session and then transition to the phone app. In this case Session 1 remains paused while the phone call is in progress and session time does not accumulate. After completing the phone call a few minutes later, the user returns to the App and the activity will resume Session 1. Since enough time has elapsed since resuming Session 1, Session 1 will be ended with a play time of 3 minutes. Session 2 will then be immediately created and started. In order for MobileAnalyticsManager to track sessions, you must call the PauseSession() and ResumeSession() in each activity of your app. The example below shows how to pause and resume session in Xamarin Android public class MainActivity : Activity { private static MobileAnalyticsManager _manager = null; protected override void OnCreate(Bundle bundle) { _manager = MobileAnalyticsManager.GetOrCreateInstance(YourAppId, YourCredential, RegionEndpoint.USEast1, YourConfig); base.OnCreate(bundle); } protected override void OnResume() { await _manager.ResumeSession(); base.OnResume(); } protected override void OnPause() { await _manager.PauseSession(); base.OnPause(); } }

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Implement the dispose pattern

비공개 메소드들

메소드 설명
GetOrCreateInstanceHelper ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig ) : MobileAnalyticsManager
MobileAnalyticsManager ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig ) : System
OnRaiseErrorEvent ( MobileAnalyticsErrorEventArgs eventArgs ) : void

메소드 상세

AddCustomAttributeToClientContext() 공개 메소드

Adds client context custom attribute Refer Rest API for more information
public AddCustomAttributeToClientContext ( string key, string value ) : void
key string Key.
value string Value.
리턴 void

Dispose() 공개 메소드

Implement the dispose pattern
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Implement the dispose pattern
protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

GetInstance() 공개 정적인 메소드

Gets Mobile Analytics Manager instance by Application ID. Returns Mobile Analytics Manager instance if it's found. Throws InvalidOperationException if the instance has not been instantiated.
public static GetInstance ( string appID ) : MobileAnalyticsManager
appID string Amazon Mobile Analytics Application ID.
리턴 MobileAnalyticsManager

GetOrCreateInstance() 공개 정적인 메소드

Gets or creates Mobile Analytics Manager instance. If the instance already exists, returns the instance; otherwise creates new instance and returns it.
public static GetOrCreateInstance ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint ) : MobileAnalyticsManager
appID string Amazon Mobile Analytics Application ID.
credentials Amazon.Runtime.AWSCredentials AWS Credentials.
regionEndpoint RegionEndpoint Region endpoint.
리턴 MobileAnalyticsManager

GetOrCreateInstance() 공개 정적인 메소드

Gets or creates Mobile Analytics Manager instance. If the instance already exists, returns the instance; otherwise creates new instance and returns it.
public static GetOrCreateInstance ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig ) : MobileAnalyticsManager
appID string Amazon Mobile Analytics Application ID.
credentials Amazon.Runtime.AWSCredentials AWS Credentials.
regionEndpoint RegionEndpoint Region endpoint.
maConfig MobileAnalyticsManagerConfig Amazon Mobile Analytics Manager configuration.
리턴 MobileAnalyticsManager

PauseSession() 공개 메소드

Pauses the current session. PauseSession() is the entry point into the Amazon Mobile Analytics SDK where sessions can be paused. Session is created and started immediately after instantiating the MobileAnalyticsManager object. The session remains active until it is paused. When in a paused state, the session time will not accumulate. When resuming a session, if enough time has elapsed from when the session is paused to when it's resumed, the session is ended and a new session is created and started. Otherwise, the paused session is resumed and the session time continues to accumulate. Currently session time out default value is 5 seconds. For example, on Android platform, when MobileAnalyticsManager is first instantiated, it creates Session 1. As the user transitions from activity to activity, the old activity will pause the current session, and the new activity will immediately resume the current session. In this case, Session 1 remains active and accumulates session time. The user continues to use the App for a total of 3 minutes, at which point, the user receives a phone call. When transitioning to the phone call, the current activity will pause the session and then transition to the phone app. In this case Session 1 remains paused while the phone call is in progress and session time does not accumulate. After completing the phone call a few minutes later, the user returns to the App and the activity will resume Session 1. Since enough time has elapsed since resuming Session 1, Session 1 will be ended with a play time of 3 minutes. Session 2 will then be immediately created and started. In order for MobileAnalyticsManager to track sessions, you must call the PauseSession() and ResumeSession() in each activity of your app. The example below shows how to pause and resume session in Xamarin Android public class MainActivity : Activity { private static MobileAnalyticsManager _manager = null; protected override void OnCreate(Bundle bundle) { _manager = MobileAnalyticsManager.GetOrCreateInstance(YourAppId, YourCredential, RegionEndpoint.USEast1, YourConfig); base.OnCreate(bundle); } protected override void OnResume() { await _manager.ResumeSession(); base.OnResume(); } protected override void OnPause() { await _manager.PauseSession(); base.OnPause(); } }
public PauseSession ( ) : void
리턴 void

RecordEvent() 공개 메소드

Records the custom event to the local persistent storage. Background thread will deliver the event later.
public RecordEvent ( CustomEvent customEvent ) : void
customEvent CustomEvent The Mobile Analytics event.
리턴 void

ResumeSession() 공개 메소드

Resume the current session. ResumeSession() is the entry point into the Amazon Mobile Analytics SDK where sessions can be resumed. Session is created and started immediately after instantiating the MobileAnalyticsManager object. The session remains active until it is paused. When in a paused state, the session time will not accumulate. When resuming a session, if enough time has elapsed from when the session is paused to when it's resumed, the session is ended and a new session is created and started. Otherwise, the paused session is resumed and the session time continues to accumulate. Currently session time out default value is 5 seconds. For example, on Android platform, when MobileAnalyticsManager is first instantiated, it creates Session 1. As the user transitions from activity to activity, the old activity will pause the current session, and the new activity will immediately resume the current session. In this case, Session 1 remains active and accumulates session time. The user continues to use the App for a total of 3 minutes, at which point, the user receives a phone call. When transitioning to the phone call, the current activity will pause the session and then transition to the phone app. In this case Session 1 remains paused while the phone call is in progress and session time does not accumulate. After completing the phone call a few minutes later, the user returns to the App and the activity will resume Session 1. Since enough time has elapsed since resuming Session 1, Session 1 will be ended with a play time of 3 minutes. Session 2 will then be immediately created and started. In order for MobileAnalyticsManager to track sessions, you must call the PauseSession() and ResumeSession() in each activity of your app. The example below shows how to pause and resume session in Xamarin Android public class MainActivity : Activity { private static MobileAnalyticsManager _manager = null; protected override void OnCreate(Bundle bundle) { _manager = MobileAnalyticsManager.GetOrCreateInstance(YourAppId, YourCredential, RegionEndpoint.USEast1, YourConfig); base.OnCreate(bundle); } protected override void OnResume() { await _manager.ResumeSession(); base.OnResume(); } protected override void OnPause() { await _manager.PauseSession(); base.OnPause(); } }
public ResumeSession ( ) : void
리턴 void