Skip to content

Commit

Permalink
Merge pull request #251 from cacheung/migrationDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
praveek authored Mar 9, 2023
2 parents 18a9aa1 + a88ece3 commit 29a1961
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 124 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
23 changes: 17 additions & 6 deletions apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,31 @@ - (BOOL)application:(UIApplication *)application
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[AEPMobileCore setLogLevel:AEPLogLevelTrace];
[AEPMobileCore
configureWithAppId:@"YOUR-APP-ID"];
const UIApplicationState appState = application.applicationState;
[AEPMobileCore
registerExtensions:@[
AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
AEPMobileLifecycle.class, AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class,
AEPMobileCampaignClassic.class, AEPMobileAssurance.class
]
completion:^{
[AEPMobileCore
configureWithAppId:@"YOUR-APP-ID"];
}];
] completion:^{
if (appState != UIApplicationStateBackground) {
[AEPMobileCore lifecycleStart:nil];
}
}];
return YES;
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
[AEPMobileCore lifecyclePause];
}

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

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#if DEBUG
return
Expand Down
Loading

0 comments on commit 29a1961

Please sign in to comment.