Skip to content

Commit c3587b2

Browse files
committed
feat: ✨ adds support for campaign classic
1 parent daa1896 commit c3587b2

File tree

27 files changed

+1397
-15
lines changed

27 files changed

+1397
-15
lines changed

apps/AEPSampleApp/App.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import EdgeIdentityView from './extensions/EdgeIdentityView';
1414
import TargetView from './extensions/TargetView';
1515
import PlacesView from './extensions/PlacesView';
1616
import {NavigationProps} from './types/props';
17+
import CampaignClassicView from './extensions/CampaignClassicView';
1718

1819
function HomeScreen({navigation}: NavigationProps) {
1920
return (
@@ -62,6 +63,10 @@ function HomeScreen({navigation}: NavigationProps) {
6263
onPress={() => navigation.navigate('PlacesView')}
6364
title="Places"
6465
/>
66+
<Button
67+
onPress={() => navigation.navigate('CampaignClassicView')}
68+
title="Campaign Classic"
69+
/>
6570
</View>
6671
);
6772
}
@@ -74,15 +79,16 @@ export default function App() {
7479
<Drawer.Navigator initialRouteName="Home">
7580
<Drawer.Screen name="Home" component={HomeScreen} />
7681
<Drawer.Screen name="CoreView" component={CoreView} />
77-
<Drawer.Screen name="ProfileView" component={ProfileView} />
78-
<Drawer.Screen name="IdentityView" component={IdentityView} />
79-
<Drawer.Screen name="MessagingView" component={MessagingView} />
82+
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
83+
<Drawer.Screen name="CampaignClassicView" component={CampaignClassicView} />
84+
<Drawer.Screen name="ConsentView" component={ConsentView} />
8085
<Drawer.Screen name="EdgeView" component={EdgeView} />
8186
<Drawer.Screen name="EdgeIdentityView" component={EdgeIdentityView} />
82-
<Drawer.Screen name="ConsentView" component={ConsentView} />
83-
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
84-
<Drawer.Screen name="PlacesView" component={PlacesView} />
87+
<Drawer.Screen name="IdentityView" component={IdentityView} />
88+
<Drawer.Screen name="MessagingView" component={MessagingView} />
8589
<Drawer.Screen name="OptimizeView" component={OptimizeView} />
90+
<Drawer.Screen name="PlacesView" component={PlacesView} />
91+
<Drawer.Screen name="ProfileView" component={ProfileView} />
8692
<Drawer.Screen name="TargetView" component={TargetView} />
8793
</Drawer.Navigator>
8894
</NavigationContainer>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import {CampaignClassic} from '@adobe/react-native-aepcampaignclassic';
2+
import React from 'react';
3+
import {Button, ScrollView, Text, View} from 'react-native';
4+
import styles from '../styles/styles';
5+
import {NavigationProps} from '../types/props';
6+
7+
function CampaignClassicView({navigation}: NavigationProps) {
8+
const extensionVersion = async () => {
9+
const version = await CampaignClassic.extensionVersion();
10+
console.log(`AdobeExperienceSDK: Campaign Classic version: ${version}`);
11+
};
12+
13+
const registerDeviceWithToken = () =>
14+
CampaignClassic.registerDeviceWithToken('myToken', 'myUserKey');
15+
const trackNotificationClickWithUserInfo = () =>
16+
CampaignClassic.trackNotificationClickWithUserInfo({userId: '1'});
17+
const trackNotificationReceiveWithUserInfo = () =>
18+
CampaignClassic.trackNotificationReceiveWithUserInfo({userId: '1'});
19+
20+
return (
21+
<View style={{...styles.container, marginTop: 30}}>
22+
<ScrollView contentContainerStyle={{marginTop: 75}}>
23+
<Button onPress={() => navigation.goBack()} title="Go to main page" />
24+
<Text style={styles.welcome}>Campaign Classic</Text>
25+
<View style={{margin: 5}}>
26+
<Button title="Extension Version" onPress={extensionVersion} />
27+
<Button title="Register Device" onPress={registerDeviceWithToken} />
28+
<Button
29+
title="Track User Click"
30+
onPress={trackNotificationClickWithUserInfo}
31+
/>
32+
<Button
33+
title="Track User Receive"
34+
onPress={trackNotificationReceiveWithUserInfo}
35+
/>
36+
</View>
37+
</ScrollView>
38+
</View>
39+
);
40+
}
41+
42+
export default CampaignClassicView;

apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ governing permissions and limitations under the License.
2727
@import AEPOptimize;
2828
@import AEPPlaces;
2929
@import AEPTarget;
30+
@import AEPCampaignClassic;
3031
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
3132
@property (nonatomic, strong) UIWindow *window;
3233

apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.mm

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,17 @@ - (BOOL)application:(UIApplication *)application
7373
self.window.rootViewController = rootViewController;
7474
[self.window makeKeyAndVisible];
7575
[AEPMobileCore setLogLevel:AEPLogLevelTrace];
76-
[AEPMobileCore registerExtensions:@[
77-
AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
78-
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
79-
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class
80-
]
81-
completion:^{
82-
[AEPMobileCore configureWithAppId:@"YOUR-APP-ID"];
83-
}];
76+
[AEPMobileCore
77+
registerExtensions:@[
78+
AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
79+
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
80+
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class,
81+
AEPMobileCampaignClassic.class
82+
]
83+
completion:^{
84+
[AEPMobileCore
85+
configureWithAppId:@"YOUR-APP-ID"];
86+
}];
8487
return YES;
8588
}
8689

apps/AEPSampleApp/ios/Podfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PODS:
22
- AEPAssurance (3.0.1):
33
- AEPCore (>= 3.1.0)
44
- AEPServices (>= 3.1.0)
5+
- AEPCampaignClassic (3.0.0):
6+
- AEPCore (>= 3.7.0)
7+
- AEPServices (>= 3.7.0)
58
- AEPCore (3.7.1):
69
- AEPRulesEngine (>= 1.1.0)
710
- AEPServices (>= 3.7.1)
@@ -127,6 +130,9 @@ PODS:
127130
- RCTAEPAssurance (3.0.0):
128131
- AEPAssurance (~> 3.0)
129132
- React
133+
- RCTAEPCampaignClassic (1.0.0-beta.1):
134+
- AEPCampaignClassic (~> 3.0)
135+
- React
130136
- RCTAEPCore (1.0.1):
131137
- AEPCore (~> 3.0)
132138
- AEPIdentity (~> 3.0)
@@ -494,6 +500,7 @@ DEPENDENCIES:
494500
- OpenSSL-Universal (= 1.1.1100)
495501
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
496502
- RCTAEPAssurance (from `../../../packages/assurance`)
503+
- RCTAEPCampaignClassic (from `../../../packages/campaignclassic`)
497504
- RCTAEPCore (from `../../../packages/core`)
498505
- RCTAEPEdge (from `../../../packages/edge`)
499506
- RCTAEPEdgeConsent (from `../../../packages/edgeconsent`)
@@ -540,6 +547,7 @@ DEPENDENCIES:
540547
SPEC REPOS:
541548
trunk:
542549
- AEPAssurance
550+
- AEPCampaignClassic
543551
- AEPCore
544552
- AEPEdge
545553
- AEPEdgeConsent
@@ -587,6 +595,8 @@ EXTERNAL SOURCES:
587595
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
588596
RCTAEPAssurance:
589597
:path: "../../../packages/assurance"
598+
RCTAEPCampaignClassic:
599+
:path: "../../../packages/campaignclassic"
590600
RCTAEPCore:
591601
:path: "../../../packages/core"
592602
RCTAEPEdge:
@@ -675,6 +685,7 @@ CHECKOUT OPTIONS:
675685

676686
SPEC CHECKSUMS:
677687
AEPAssurance: b25880cd4b14f22c61a1dce19807bd0ca0fe9b17
688+
AEPCampaignClassic: cd20252606d9e12d5ee2c410df260762faa49d2c
678689
AEPCore: 412fe933382892ab6c6af958d2f69ebcbca11216
679690
AEPEdge: 6faf60328f9e5ae7a107fd61f9a968f46ebf2928
680691
AEPEdgeConsent: a23b35ab331d2aa2013fcef49c9d6b80085d5597
@@ -709,6 +720,7 @@ SPEC CHECKSUMS:
709720
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
710721
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
711722
RCTAEPAssurance: 9f51b9b5da17f9b98a41ce29e4f3e3b67ea36c17
723+
RCTAEPCampaignClassic: eab902c60651cca7030756d1df9e4048e681f626
712724
RCTAEPCore: 513c7e995cafcaf536653f0dfaaba2b92862b93a
713725
RCTAEPEdge: 9938932e89a90adf5cd30250b46cc67fbe35dd06
714726
RCTAEPEdgeConsent: b998b2d08f254635ef01263fea186d7262f2d242

apps/AEPSampleApp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@adobe/react-native-aepassurance": "^3.0.0",
18+
"@adobe/react-native-aepcampaignclassic": "1.0.0-beta.1",
1819
"@adobe/react-native-aepcore": "^1.0.0",
1920
"@adobe/react-native-aepedge": "^1.0.0",
2021
"@adobe/react-native-aepedgeconsent": "^1.0.0",
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
sample/
2+
.github/
3+
.git/
4+
5+
# Built application files
6+
android/*/build/
7+
8+
# Crashlytics configuations
9+
android/com_crashlytics_export_strings.xml
10+
11+
# Local configuration file (sdk path, etc)
12+
android/local.properties
13+
14+
# Gradle generated files
15+
android/.gradle/
16+
17+
# Signing files
18+
android/.signing/
19+
20+
# User-specific configurations
21+
android/.idea/gradle.xml
22+
android/.idea/libraries/
23+
android/.idea/workspace.xml
24+
android/.idea/tasks.xml
25+
android/.idea/.name
26+
android/.idea/compiler.xml
27+
android/.idea/copyright/profiles_settings.xml
28+
android/.idea/encodings.xml
29+
android/.idea/misc.xml
30+
android/.idea/modules.xml
31+
android/.idea/scopes/scope_settings.xml
32+
android/.idea/vcs.xml
33+
android/*.iml
34+
35+
# Xcode
36+
*.pbxuser
37+
*.mode1v3
38+
*.mode2v3
39+
*.perspectivev3
40+
*.xcuserstate
41+
ios/Pods
42+
ios/build
43+
*project.xcworkspace*
44+
*xcuserdata*
45+
ios/*.xcworkspace
46+
ios/*.podspec
47+
48+
# OS-specific files
49+
.DS_Store
50+
.DS_Store?
51+
._*
52+
.Spotlight-V100
53+
.Trashes
54+
ehthumbs.db
55+
Thumbs.dbandroid/gradle
56+
android/gradlew
57+
android/build
58+
android/gradlew.bat
59+
android/gradle/
60+
__tests__
61+
.circleci/
62+
.opensource/
63+
jest/
64+
acp-sdks/
65+
update-android-sdk.sh
66+
CONTRIBUTING.md
67+
CODE_OF_CONDUCT.md
68+
Makefile
69+
*.tgz
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require "json"
2+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
3+
4+
Pod::Spec.new do |s|
5+
s.name = "RCTAEPCampaignClassic"
6+
s.version = package["version"]
7+
s.summary = "Experience Platform Campaign Classic extension for Adobe Experience Platform Mobile SDK. Written and Supported by Adobe."
8+
s.author = "Adobe Experience Platform SDK Team"
9+
10+
s.homepage = "https://github.com/adobe/aepsdk-react-native"
11+
12+
s.license = "Apache 2.0 License"
13+
s.platform = :ios, '10.0'
14+
15+
s.source = { :git => "https://github.com/adobe/aepsdk-react-native.git", :tag => "#{s.version}" }
16+
17+
s.source_files = 'ios/**/*.{h,m}'
18+
s.requires_arc = true
19+
20+
s.dependency "React"
21+
s.dependency "AEPCampaignClassic", "~>3.0"
22+
end

0 commit comments

Comments
 (0)