{"payload":{"allShortcutsEnabled":false,"fileTree":{"docs/unity":{"items":[{"name":"enumerations.md","path":"docs/unity/enumerations.md","contentType":"file"},{"name":"get-started.md","path":"docs/unity/get-started.md","contentType":"file"},{"name":"library-calls.md","path":"docs/unity/library-calls.md","contentType":"file"},{"name":"lifecycle.md","path":"docs/unity/lifecycle.md","contentType":"file"},{"name":"methods.md","path":"docs/unity/methods.md","contentType":"file"},{"name":"project.md","path":"docs/unity/project.md","contentType":"file"}],"totalCount":6},"docs":{"items":[{"name":"android","path":"docs/android","contentType":"directory"},{"name":"blackberry","path":"docs/blackberry","contentType":"directory"},{"name":"ios","path":"docs/ios","contentType":"directory"},{"name":"unity","path":"docs/unity","contentType":"directory"},{"name":"universal-windows","path":"docs/universal-windows","contentType":"directory"},{"name":"windows-appstore","path":"docs/windows-appstore","contentType":"directory"},{"name":"xamarin","path":"docs/xamarin","contentType":"directory"}],"totalCount":7},"":{"items":[{"name":"docs","path":"docs","contentType":"directory"},{"name":"samples","path":"samples","contentType":"directory"},{"name":"sdks","path":"sdks","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".npmignore","path":".npmignore","contentType":"file"},{"name":"LICENSE.md","path":"LICENSE.md","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"package.json","path":"package.json","contentType":"file"},{"name":"plugin.xml","path":"plugin.xml","contentType":"file"}],"totalCount":9}},"fileTreeProcessingTime":4.690983,"foldersToFetch":[],"repo":{"id":16493963,"defaultBranch":"master","name":"mobile-services","ownerLogin":"Adobe-Marketing-Cloud","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2014-02-03T21:43:40.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1440554?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1618423338.265981","canEdit":false,"refType":"branch","currentOid":"bf5c2668ebc79218b2ddf4694ff9952fa52be892"},"path":"docs/unity/lifecycle.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/Adobe-Marketing-Cloud/mobile-services/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"lifecycle.md","displayUrl":"https://github.com/Adobe-Marketing-Cloud/mobile-services/blob/master/docs/unity/lifecycle.md?raw=true","headerInfo":{"blobSize":"1001 Bytes","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"993a4cf","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FAdobe-Marketing-Cloud%2Fmobile-services%2Fblob%2Fmaster%2Fdocs%2Funity%2Flifecycle.md%3Flang%3Dko-KR","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Implement Lifecycle","anchor":"implement-lifecycle","htmlText":"Implement Lifecycle"},{"level":2,"text":"iOS","anchor":"ios","htmlText":"iOS"},{"level":2,"text":"Android","anchor":"android","htmlText":"Android"}],"lineInfo":{"truncatedLoc":"51","truncatedSloc":"40"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/Adobe-Marketing-Cloud/mobile-services/blob/master/docs/unity/lifecycle.md?lang=ko-KR","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/Adobe-Marketing-Cloud/mobile-services/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/Adobe-Marketing-Cloud/mobile-services/raw/master/docs/unity/lifecycle.md","renderImageOrRaw":false,"richText":"

Implement Lifecycle

\n

For more information about the metrics and dimensions that can be measured automatically by the mobile library after lifecycle is implemented, see Lifecycle Metrics in Android or Lifecycle in iOS.

\n

iOS

\n

Lifecycle metrics are automatically collected in iOS.

\n

Android

\n

In your Unity script, you set the application context for the Android SDK. Add the following code to the Awake() function of your FIRST scene:

\n
void Awake()\n {\n  ...\n  ADBMobile.SetContext();\n  ...\n }
\n

To collect lifecycle metrics, add the following code to all of your scene scripts:

\n
void OnEnable()\n {\n  ...\n  ADBMobile.CollectLifecycleData (); \n  ...\n }\n \n void OnDisable()\n {\n  ...\n  ADBMobile.PauseCollectingLifecycleData (); \n  ...\n }\n  \n void OnApplicationPause(bool isPaused) \n {\n  ...\n  if (isPaused) {\n   ADBMobile.PauseCollectingLifecycleData (); \n  }  \n  else {\n   ADBMobile.CollectLifecycleData(); \n  }\n  ...\n }
\n
","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"Implement Lifecycle","kind":"section_1","ident_start":2,"ident_end":21,"extent_start":0,"extent_end":1001,"fully_qualified_name":"Implement Lifecycle","ident_utf16":{"start":{"line_number":0,"utf16_col":2},"end":{"line_number":0,"utf16_col":21}},"extent_utf16":{"start":{"line_number":0,"utf16_col":0},"end":{"line_number":51,"utf16_col":0}}},{"name":"iOS","kind":"section_2","ident_start":276,"ident_end":279,"extent_start":273,"extent_end":336,"fully_qualified_name":"iOS","ident_utf16":{"start":{"line_number":4,"utf16_col":3},"end":{"line_number":4,"utf16_col":6}},"extent_utf16":{"start":{"line_number":4,"utf16_col":0},"end":{"line_number":8,"utf16_col":0}}},{"name":"Android","kind":"section_2","ident_start":339,"ident_end":346,"extent_start":336,"extent_end":1001,"fully_qualified_name":"Android","ident_utf16":{"start":{"line_number":8,"utf16_col":3},"end":{"line_number":8,"utf16_col":10}},"extent_utf16":{"start":{"line_number":8,"utf16_col":0},"end":{"line_number":51,"utf16_col":0}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/Adobe-Marketing-Cloud/mobile-services/branches":{"post":"YJwdV8ypWa20vp5GFLDn7ukBZBb0pz0ep57sYsgFuHJYwSGZDSWyPkxSo7XB4I5hhsHvLjk1M66ufYOFwMtEZA"},"/repos/preferences":{"post":"FKItC6ln-djEYGXb9AVNSGQrDB2sK9Zn11-eCQt6g0ZxFKGlWZqzN_MFptIsK8Js1UuhQDtHn5PRmmoNtoKy2w"}}},"title":"mobile-services/docs/unity/lifecycle.md at master ยท Adobe-Marketing-Cloud/mobile-services"}