Skip to content

Commit

Permalink
Update lifecycleStart to nil for ios initialization in the docs
Browse files Browse the repository at this point in the history
Update lifecycleStart to nil for ios initialization in the docs
  • Loading branch information
cacheung committed Mar 9, 2023
1 parent 9ba2fe3 commit 8018f56
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 29 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,20 @@ Initializing the SDK should be done in native code inside your `AppDelegate` (iO
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore configureWithAppId:@"yourAppID"];

const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions: @[
AEPMobileLifecycle.class,
AEPMobileSignal.class,
AEPMobileEdge.class,
AEPMobileEdgeIdentity.class,
AEPMobileEdgeConsent.class,
] completion:^{
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
//enable this for Lifecycle. See Note for collecting Lifecycle metrics.
}
];

] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil}];
}
}];
return YES;
}

Expand Down
7 changes: 3 additions & 4 deletions apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ - (BOOL)application:(UIApplication *)application
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class,
AEPMobileCampaignClassic.class, AEPMobileAssurance.class
]
completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
Expand Down
10 changes: 7 additions & 3 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public class MainApplication extends Application implements ReactApplication {

[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore configureWithAppId:@"yourAppID"];

const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions: @[
AEPMobileUserProfile.class,
AEPMobileIdentity.class,
Expand All @@ -164,9 +167,10 @@ public class MainApplication extends Application implements ReactApplication {
AEPMobilePlaces.class,
AEPMobileAssurance.class,
] completion:^{
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
];
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
// --- 4. end ----

...
Expand Down
2 changes: 1 addition & 1 deletion packages/assurance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ iOS

[AEPMobileCore registerExtensions: @[AEPMobileLifecycle.class, AEPMobileAssurance.class] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
Expand Down
2 changes: 1 addition & 1 deletion packages/campaignclassic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ iOS

[AEPMobileCore registerExtensions: @[ AEPCampaignClassic.class] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
[AEPMobileCore lifecycleStart:nil}];
}
}];
return YES;
Expand Down
6 changes: 3 additions & 3 deletions packages/messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ iOS
const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions: @[AEPMobileEdgeIdentity.class, AEPMobileEdge.class, AEPMobileMessaging.class, AEPMobileOptimize.class] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil}];
}
}];
return YES;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/optimize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ iOS
const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions: @[AEPMobileEdge.class, AEPMobileEdgeIdentity.class, AEPMobileOptimize.class] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
}
Expand Down
9 changes: 6 additions & 3 deletions packages/places/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ iOS
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore configureWithAppId:@"yourAppID"];

const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions:@[AEPEdge.class, AEPMobilePlaces.class] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
}
Expand Down
14 changes: 9 additions & 5 deletions packages/target/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ iOS

@implementation AppDelegate
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelTrace];
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
[AEPMobileCore configureWithAppId:@"yourAppID"];

const UIApplicationState appState = application.applicationState;

[AEPMobileCore registerExtensions: @[AEPMobileEdge.class, AEPMobileTarget.class] completion:^{
[AEPMobileCore configureWithAppId:@"yourAppID"];
[AEPMobileCore lifecycleStart:@{@"contextDataKey": @"contextDataVal"}];
}
];
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
}
@end
Expand Down

0 comments on commit 8018f56

Please sign in to comment.