Adobe-Marketing-Cloud / aep-sdks-documentation

Documentation repository for the Adobe Experience Platform Mobile SDKs
MIT License
26 stars 106 forks source link

Different lifecycle tracking behaviours #481

Open Vacxe opened 3 years ago

Vacxe commented 3 years ago

Base on documentation

We need to implement

   @Override  
   public void onResume() {  
      MobileCore.setApplication(getApplication());
      MobileCore.lifecycleStart(null);
   }

and

   @Override
   public void onPause() {
      MobileCore.lifecyclePause();
   }

for each Activity classes on Android.

However for iOS

- (void) sceneWillEnterForeground:(UIScene *)scene {
   [ACPCore lifecycleStart:nil];
}

and

- (void) sceneDidEnterBackground:(UIScene *)scene {
   [ACPCore lifecyclePause];
}
 - (void) applicationDidEnterBackground:(UIApplication *)application {
    [ACPCore lifecyclePause];
 }

- (void) applicationWillEnterForeground:(UIApplication *)application {
    [ACPCore lifecycleStart:nil];
}

I think this two implementation will have a different behaviors.

For IOS library have a global application lifecycle tracking for Android doesn't.

Is it possible to track sessions similar with iOS way? Because each navigation between activities creating a new session on Android.

praschetan commented 3 years ago

@shalehaha , @sbenedicadb - can you take a look at this, please?