4444
4545// AppDelegate.m
4646- (BOOL)application:(UIApplication * )application didFinishLaunchingWithOptions:(NSDictionary * )launchOptions {
47- [ AEPMobileCore setLogLevel: AEPLogLevelDebug] ;
48- [ AEPMobileCore registerExtensions:@[ AEPMobileEdgeIdentity.class,
49- AEPMobileEdge.class,
50- AEPMobileEdgeConsent.class] completion:^{
51- [ AEPMobileCore configureWithAppId:@"yourAppID"] ;
47+
48+ // TODO: Set up the preferred Environment File ID from your mobile property configured in Data Collection UI
49+ NSString* ENVIRONMENT_FILE_ID = @"YOUR-APP-ID";
50+
51+ NSArray *extensionsToRegister = @[AEPMobileEdgeIdentity.class,
52+ AEPMobileEdge.class,
53+ AEPMobileEdgeConsent.class
54+ ];
55+
56+ [AEPMobileCore configureWithAppId: ENVIRONMENT_FILE_ID];
5257 ...
5358 }] ;
5459 return YES;
5964
6065Android
6166```java
62- import com.adobe.marketing.mobile.LoggingMode;
6367import com.adobe.marketing.mobile.MobileCore;
6468import com.adobe.marketing.mobile.Edge;
6569import com.adobe.marketing.mobile.edge.identity.Identity;
@@ -70,30 +74,28 @@ import android.app.Application;
7074...
7175public class MainApplication extends Application implements ReactApplication {
7276 ...
77+ // TODO: Set up the preferred Environment File ID from your mobile property configured in Data Collection UI
78+ private final String ENVIRONMENT_FILE_ID = "YOUR-APP-ID";
79+
7380 @Override
7481 public void on Create(){
7582 super.onCreate();
7683 ...
7784 MobileCore.setApplication(this);
78- MobileCore.setLogLevel(LoggingMode.DEBUG);
7985 MobileCore.configureWithAppID("yourAppID");
8086
81- Edge.registerExtension();
82- Identity.registerExtension();
83- Consent.registerExtension();
84- MobileCore.start(new AdobeCallback() {
85- @Override
86- public void call(Object o) {
87-
88- }});
87+ MobileCore.registerExtensions(
88+ Arrays.asList(Consent.EXTENSION, Identity.EXTENSION, Edge.EXTENSION),
89+ o -> Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized")
90+ );
8991 }
90- }
92+ }
9193```
9294
9395### Importing the extension
9496In your React Native application, import the Consent extension as follows:
9597``` typescript
96- import {Consent } from ' @adobe/react-native-aepedgeconsent' ;
98+ import {Consent } from " @adobe/react-native-aepedgeconsent" ;
9799```
98100
99101## API reference
0 commit comments