Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
eaa0c3f
Merge pull request #219 from adobe/main
cacheung Jan 18, 2023
4992e0d
fix: defer to root project sdk version gradle params (#223)
kevindice Jan 26, 2023
1b8e98b
Bump up package versions to adopt Android 2.0 (#226)
yangyansong-adbe Feb 23, 2023
e3e52b9
Update SDK installation steps for Android 2.0 integration (#232)
yangyansong-adbe Feb 23, 2023
d35103f
Add location hint in Edge extension
cacheung Feb 27, 2023
a8e2bdf
update AndroidManifest file and location hint clean up
cacheung Feb 28, 2023
855ad72
rename a title in the sample app
cacheung Feb 28, 2023
ecd216e
Add location hint unit tests
cacheung Feb 28, 2023
a15a4f6
Commented out a failing Target unit test
cacheung Feb 28, 2023
56c3894
Update yarn.lock
cacheung Mar 1, 2023
9fc172d
Merge branch 'edge' of github.com:adobe/aepsdk-react-native into loca…
cacheung Mar 2, 2023
d373124
Update circle ci node version
cacheung Mar 2, 2023
67547f5
commented out a target test
cacheung Mar 2, 2023
62bee56
Comment out few optimize tests
cacheung Mar 2, 2023
6102ad8
Remove optimizeTest and update xcode version
cacheung Mar 2, 2023
00e612a
revert xcode version
cacheung Mar 2, 2023
48b83f9
ci unit test update
cacheung Mar 3, 2023
705e3cd
remove more test
cacheung Mar 3, 2023
c505450
Fix compilation errors in Target, Places and Campaign classic
praveek Mar 3, 2023
e76fe82
update config for unit test
cacheung Mar 3, 2023
4b05306
add back Optimize and Target tests
cacheung Mar 3, 2023
b3d65ef
Update circle ci
praveek Mar 3, 2023
bb7bef9
Update config for unit tests
praveek Mar 3, 2023
8762ac9
Merge pull request #240 from praveek/staging
praveek Mar 3, 2023
1f14f09
Update consent readme doc for registration information
cacheung Mar 3, 2023
ec92c5f
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into c…
cacheung Mar 3, 2023
6ee8c4d
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into l…
cacheung Mar 3, 2023
b563aed
Merge pull request #241 from cacheung/consentUpdate
cacheung Mar 3, 2023
e88ac64
Merge pull request #242 from adobe/consent
cacheung Mar 3, 2023
0bb93b5
update sample app, add an unit test and update doc
cacheung Mar 4, 2023
c339593
Update Edge Readme registration info
cacheung Mar 6, 2023
2918864
Update EdgeIdentity readme registration info
cacheung Mar 6, 2023
63eda9f
Update readme for format
cacheung Mar 6, 2023
904b1bd
Assurance -> Staging (#243)
yangyansong-adbe Mar 6, 2023
a2f0fd2
Merge pull request #237 from cacheung/locationhint
cacheung Mar 6, 2023
6ed7718
Update docs for Campaign/Messaging/Optimize/Places/Target with Androi…
yangyansong-adbe Mar 6, 2023
d58e186
Merge pull request #245 from cacheung/edgedocs
cacheung Mar 6, 2023
7ac77e4
Bump up Assurance version to 4.0.0 (#246)
yangyansong-adbe Mar 6, 2023
2236efe
Fix compilation errors in messaging wrapper
praveek Mar 6, 2023
105a575
Merge branch 'staging' of https://github.com/adobe/aepsdk-react-nativ…
praveek Mar 6, 2023
5debec9
Fix messaging dependencies
praveek Mar 7, 2023
659e290
messaging 2.x doc updates
rymorale Mar 7, 2023
3fa27e1
fix some wording
rymorale Mar 7, 2023
c4369bc
Remove optimize dependency from messaging
praveek Mar 7, 2023
2e51261
Merge pull request #248 from praveek/staging
praveek Mar 7, 2023
1d2cf65
Merge remote-tracking branch 'upstream/staging' into messaging-2.x-do…
rymorale Mar 7, 2023
dcf62ed
add lifecycle extension to init steps
rymorale Mar 7, 2023
21ca840
fix: Assurance is not registered. (#250)
yangyansong-adbe Mar 8, 2023
f361c2b
Merge pull request #249 from rymorale/messaging-2.x-doc-updates
rymorale Mar 8, 2023
a22113f
update migration doc to work with 2.x
cacheung Mar 8, 2023
7328b22
update migration doc
cacheung Mar 8, 2023
22fa39d
update import and link info for migration doc
cacheung Mar 8, 2023
a5de1b2
Remove semi-colon for Syntax in the doc
cacheung Mar 8, 2023
792fac2
fix acc api call (#254)
rymorale Mar 8, 2023
c6a0b96
Merge pull request #252 from cacheung/syntax
cacheung Mar 8, 2023
18a9aa1
Review updates (#253)
swarna04 Mar 8, 2023
95f4d30
Merge branch 'staging' of github.com:adobe/aepsdk-react-native into m…
cacheung Mar 9, 2023
9ba2fe3
Update lifecycle ios implementation in docs
cacheung Mar 9, 2023
8018f56
Update lifecycleStart to nil for ios initialization in the docs
cacheung Mar 9, 2023
a88ece3
Remove CampaignClassic from migration doc and update assurance readme
cacheung Mar 9, 2023
29a1961
Merge pull request #251 from cacheung/migrationDoc
praveek Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 2.1
jobs:
unit-test:
docker:
- image: cimg/node:16.6.2
- image: cimg/node:19.7.0

steps:
- checkout
Expand All @@ -21,7 +21,7 @@ jobs:

- run:
name: Unit Tests
command: yarn tests:jest
command: yarn tests:jest --watchAll=false --runInBand

build-sample-app-android:
docker:
Expand Down Expand Up @@ -50,7 +50,9 @@ jobs:
# CircleCI puts xcode app in consistent path, RN looks for versioned path
- run:
name: Move xcode
command: cd /Applications && mv Xcode.app Xcode-13.0.app
command: |
cd /Applications && mv Xcode.app Xcode-13.0.app
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/Xcode-13.0.app/Contents/Developer/Applications/Simulator.app

- run:
name: Install latest NodeJS
Expand Down
125 changes: 66 additions & 59 deletions README.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion apps/AEPSampleApp/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />

</intent-filter>
<intent-filter>
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="assurance" />
</intent-filter>
</activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
package com.aepsampleapp;

import com.adobe.marketing.mobile.MobileCore;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
Expand All @@ -35,6 +36,19 @@ protected ReactActivityDelegate createReactActivityDelegate() {
return new MainActivityDelegate(this, getMainComponentName());
}

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

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

public static class MainActivityDelegate extends ReactActivityDelegate {
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
super(activity, mainComponentName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,20 @@

import android.app.Application;
import android.content.Context;
import com.adobe.marketing.mobile.AdobeCallback;
import com.adobe.marketing.mobile.Assurance;
import com.adobe.marketing.mobile.Edge;
import com.adobe.marketing.mobile.InvalidInitException;
import com.adobe.marketing.mobile.Extension;
import com.adobe.marketing.mobile.Lifecycle;
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.Messaging;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Signal;
import com.adobe.marketing.mobile.UserProfile;
import com.adobe.marketing.mobile.edge.consent.Consent;
import com.adobe.marketing.mobile.edge.identity.Identity;
import com.adobe.marketing.mobile.optimize.Optimize;
import com.adobe.marketing.mobile.Places;
import com.adobe.marketing.mobile.Target;
import com.aepsampleapp.newarchitecture.MainApplicationReactNativeHost;
import com.adobe.marketing.mobile.InvalidInitException;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
Expand All @@ -39,6 +36,7 @@
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {
Expand Down Expand Up @@ -89,16 +87,15 @@ public void onCreate() {
}

/**
* Loads Flipper in React Native templates. Call this in the onCreate method
* with something like initializeFlipper(this,
* getReactNativeHost().getReactInstanceManager());
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void
initializeFlipper(Context context,
ReactInstanceManager reactInstanceManager) {
ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
Expand All @@ -108,7 +105,7 @@ public void onCreate() {
Class<?> aClass = Class.forName("com.aepsampleapp.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class,
ReactInstanceManager.class)
ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
Expand All @@ -119,28 +116,21 @@ public void onCreate() {
} catch (InvocationTargetException e) {
e.printStackTrace();
}

try {
Edge.registerExtension();
Identity.registerExtension();
Messaging.registerExtension();
UserProfile.registerExtension();
Lifecycle.registerExtension();
Signal.registerExtension();
Consent.registerExtension();
Assurance.registerExtension();
Places.registerExtension();
Target.registerExtension();
Optimize.registerExtension();
} catch (InvalidInitException e) {
e.printStackTrace();
}
MobileCore.configureWithAppID("YOUR-APP-ID");
MobileCore.start(new AdobeCallback() {
@Override
public void call(Object o) {
MobileCore.lifecycleStart(null);
}
List<Class<? extends Extension>> extensions = Arrays.asList(
Lifecycle.EXTENSION,
Signal.EXTENSION,
Edge.EXTENSION,
com.adobe.marketing.mobile.edge.identity.Identity.EXTENSION,
Messaging.EXTENSION,
UserProfile.EXTENSION,
Assurance.EXTENSION,
Places.EXTENSION,
Target.EXTENSION,
Optimize.EXTENSION,
Consent.EXTENSION);
MobileCore.registerExtensions(extensions, o -> {
MobileCore.lifecycleStart(null);
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions apps/AEPSampleApp/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand All @@ -22,7 +22,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.android.tools.build:gradle:7.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
24 changes: 23 additions & 1 deletion apps/AEPSampleApp/extensions/EdgeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {NavigationProps} from '../types/props';
const EdgeView = ({navigation}: NavigationProps) => {
const [version, setVersion] = useState('');
const [eventHandles, setEventHandles] = useState('');
const [locationHint, getlocationHintText] = useState('');

Edge.extensionVersion().then(version => setVersion(version));

Expand All @@ -31,7 +32,18 @@ const EdgeView = ({navigation}: NavigationProps) => {
let eventHandlesStr = JSON.stringify(eventHandles);
console.log('AdobeExperienceSDK: EdgeEventHandles = ' + eventHandlesStr);
setEventHandles(eventHandlesStr);
});
})
}

function getLocationHint() {
Edge.getLocationHint().then(hint => {
let locationStr = hint;
console.log('AdobeExperienceSDK: location hint = ' + locationStr);
if (hint == null) {
locationStr = "null";
}
getlocationHintText(locationStr);
})
}

return (
Expand All @@ -45,6 +57,16 @@ const EdgeView = ({navigation}: NavigationProps) => {
onPress={() => sendEvent('datasetIdExample')}
/>
<Text style={styles.text}>Response event handles: {eventHandles}</Text>
<Button
title="setLocationHint(va6)"
onPress={() => Edge.setLocationHint('va6')}
/>
<Button
title="setLocationHint(null))"
onPress={() => Edge.setLocationHint(null)}
/>
<Button title="getLocationHint()" onPress={() => getLocationHint()} />
<Text style={styles.text}>Location Hint: {locationHint}</Text>
</ScrollView>
</View>
);
Expand Down
17 changes: 2 additions & 15 deletions apps/AEPSampleApp/extensions/OptimizeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const ViewTypes = {
content: 1,
};

const TARGET_OFFER_TYPE_TEXT = 'text/plain';
const TARGET_OFFER_TYPE_JSON = 'application/json';
const TARGET_OFFER_TYPE_HTML = 'text/html';

Expand Down Expand Up @@ -113,26 +112,14 @@ export default ({navigation}: any) => {
setImageProposition(propositions.get(decisionScopeImage.getName()));
setHtmlProposition(propositions.get(decisionScopeHtml.getName()));
setJsonProposition(propositions.get(decisionScopeJson.getName()));
setTargetProposition(
propositions.get(decisionScopeTargetMbox.getName()),
);
setTargetProposition(propositions.get(decisionScopeTargetMbox.getName()));
}
},
});

const renderTargetOffer = () => {
if (targetProposition?.items) {
if (targetProposition.items[0].format === TARGET_OFFER_TYPE_TEXT) {
return (
<Text
style={{margin: 10, fontSize: 18}}
onPress={() => {
targetProposition?.items[0].tapped(targetProposition);
}}>
{targetProposition.items[0].content}
</Text>
);
} else if (targetProposition.items[0].format === TARGET_OFFER_TYPE_JSON) {
if (targetProposition.items[0].format === TARGET_OFFER_TYPE_JSON) {
return (
<Text
style={{margin: 10, fontSize: 18}}
Expand Down
25 changes: 18 additions & 7 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
]
completion:^{
[AEPMobileCore
configureWithAppId:@"YOUR-APP-ID"];
}];
AEPMobileCampaignClassic.class, AEPMobileAssurance.class
] 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
2 changes: 0 additions & 2 deletions apps/AEPSampleApp/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ target 'AEPSampleApp' do
:app_path => "#{Pod::Config.instance.installation_root}/.."
)

pod "AEPMessaging", :git => "https://github.com/adobe/aepsdk-messaging-ios.git", :branch => "staging"

target 'AEPSampleAppTests' do
inherit! :complete
# Pods for testing
Expand Down
Loading