Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 12 additions & 6 deletions apps/AEPSampleApp/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import EdgeIdentityView from './extensions/EdgeIdentityView';
import TargetView from './extensions/TargetView';
import PlacesView from './extensions/PlacesView';
import {NavigationProps} from './types/props';
import CampaignClassicView from './extensions/CampaignClassicView';

function HomeScreen({navigation}: NavigationProps) {
return (
Expand Down Expand Up @@ -62,6 +63,10 @@ function HomeScreen({navigation}: NavigationProps) {
onPress={() => navigation.navigate('PlacesView')}
title="Places"
/>
<Button
onPress={() => navigation.navigate('CampaignClassicView')}
title="Campaign Classic"
/>
</View>
);
}
Expand All @@ -74,15 +79,16 @@ export default function App() {
<Drawer.Navigator initialRouteName="Home">
<Drawer.Screen name="Home" component={HomeScreen} />
<Drawer.Screen name="CoreView" component={CoreView} />
<Drawer.Screen name="ProfileView" component={ProfileView} />
<Drawer.Screen name="IdentityView" component={IdentityView} />
<Drawer.Screen name="MessagingView" component={MessagingView} />
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
<Drawer.Screen name="CampaignClassicView" component={CampaignClassicView} />
<Drawer.Screen name="ConsentView" component={ConsentView} />
<Drawer.Screen name="EdgeView" component={EdgeView} />
<Drawer.Screen name="EdgeIdentityView" component={EdgeIdentityView} />
<Drawer.Screen name="ConsentView" component={ConsentView} />
<Drawer.Screen name="AssuranceView" component={AssuranceView} />
<Drawer.Screen name="PlacesView" component={PlacesView} />
<Drawer.Screen name="IdentityView" component={IdentityView} />
<Drawer.Screen name="MessagingView" component={MessagingView} />
<Drawer.Screen name="OptimizeView" component={OptimizeView} />
<Drawer.Screen name="PlacesView" component={PlacesView} />
<Drawer.Screen name="ProfileView" component={ProfileView} />
<Drawer.Screen name="TargetView" component={TargetView} />
</Drawer.Navigator>
</NavigationContainer>
Expand Down
51 changes: 51 additions & 0 deletions apps/AEPSampleApp/extensions/CampaignClassicView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {CampaignClassic} from '@adobe/react-native-aepcampaignclassic';
import React from 'react';
import {Button, ScrollView, Text, View} from 'react-native';
import styles from '../styles/styles';
import {NavigationProps} from '../types/props';

function CampaignClassicView({navigation}: NavigationProps) {
const extensionVersion = async () => {
const version = await CampaignClassic.extensionVersion();
console.log(`AdobeExperienceSDK: Campaign Classic version: ${version}`);
};

const registerDeviceWithToken = () => {
CampaignClassic.registerDeviceWithToken('myToken', 'myUserKey');
console.log('Device registered!')
}

const trackNotificationClickWithUserInfo = () => {
CampaignClassic.trackNotificationClickWithUserInfo({'_mId': '12345', '_dId': 'testDId'});
console.log('Notification clicked!')
}

const trackNotificationReceiveWithUserInfo = () => {
CampaignClassic.trackNotificationReceiveWithUserInfo({'_mId': '12345', '_dId': 'testDId'});
console.log('Notification received!')
}


return (
<View style={{...styles.container, marginTop: 30}}>
<ScrollView contentContainerStyle={{marginTop: 75}}>
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>Campaign Classic</Text>
<View style={{margin: 5}}>
<Button title="Extension Version" onPress={extensionVersion} />
<Button title="Register Device" onPress={registerDeviceWithToken} />
<Button
title="Track User Click"
onPress={trackNotificationClickWithUserInfo}
/>
<Button
title="Track User Receive"
onPress={trackNotificationReceiveWithUserInfo}
/>
</View>
</ScrollView>
</View>
);
}

export default CampaignClassicView;
34 changes: 29 additions & 5 deletions apps/AEPSampleApp/extensions/MessagingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,45 @@ governing permissions and limitations under the License.

import React from 'react';
import {Button, Text, View, ScrollView} from 'react-native';
import {Messaging} from '@adobe/react-native-aepmessaging';
import {Message, Messaging} from '@adobe/react-native-aepmessaging';
import styles from '../styles/styles';
import {NavigationProps} from '../types/props';

const messagingExtensionVersion = () =>
Messaging.extensionVersion().then(version =>
console.log('AdobeExperienceSDK: Messaging version: ' + version),
);
const messagingExtensionVersion = async () => {
const version = await Messaging.extensionVersion();
console.log(`AdobeExperienceSDK: Messaging version: ${version}`);
};

const refreshInAppMessages = () => {
Messaging.refreshInAppMessages();
console.log('messages refreshed');
};

const setMessagingDelegate = () => {
Messaging.setMessagingDelegate({
onDismiss: () => console.log('dismissed!'),
onShow: () => console.log('show'),
shouldShowMessage: () => true,
urlLoaded: () => true,
});
console.log('messaging delegate set');
};

const saveMessage = () => {
const message = new Message('1', true);
Messaging.saveMessage(message);
console.log('message saved');
};

const MessagingView = ({navigation}: NavigationProps) => (
<View style={styles.container}>
<ScrollView contentContainerStyle={{marginTop: 75}}>
<Button onPress={() => navigation.goBack()} title="Go to main page" />
<Text style={styles.welcome}>Messaging</Text>
<Button title="extensionVersion()" onPress={messagingExtensionVersion} />
<Button title="refreshInAppMessages()" onPress={refreshInAppMessages} />
<Button title="setMessagingDelegate()" onPress={setMessagingDelegate} />
<Button title="saveMessage()" onPress={saveMessage} />
</ScrollView>
</View>
);
Expand Down
1 change: 1 addition & 0 deletions apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ governing permissions and limitations under the License.
@import AEPOptimize;
@import AEPPlaces;
@import AEPTarget;
@import AEPCampaignClassic;
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;

Expand Down
19 changes: 11 additions & 8 deletions apps/AEPSampleApp/ios/AEPSampleApp/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ - (BOOL)application:(UIApplication *)application
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[AEPMobileCore setLogLevel:AEPLogLevelTrace];
[AEPMobileCore registerExtensions:@[
AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class
]
completion:^{
[AEPMobileCore configureWithAppId:@"YOUR-APP-ID"];
}];
[AEPMobileCore
registerExtensions:@[
AEPMobileEdgeIdentity.class, AEPMobileEdge.class,
AEPMobileEdgeConsent.class, AEPMobileMessaging.class,
AEPMobileOptimize.class, AEPMobilePlaces.class, AEPMobileTarget.class,
AEPMobileCampaignClassic.class
]
completion:^{
[AEPMobileCore
configureWithAppId:@"YOUR-APP-ID"];
}];
return YES;
}

Expand Down
25 changes: 18 additions & 7 deletions apps/AEPSampleApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ PODS:
- AEPAssurance (3.0.1):
- AEPCore (>= 3.1.0)
- AEPServices (>= 3.1.0)
- AEPCampaignClassic (3.0.0):
- AEPCore (>= 3.7.0)
- AEPServices (>= 3.7.0)
- AEPCore (3.7.1):
- AEPRulesEngine (>= 1.1.0)
- AEPServices (>= 3.7.1)
Expand All @@ -17,11 +20,10 @@ PODS:
- AEPCore (>= 3.7.1)
- AEPLifecycle (3.7.1):
- AEPCore (>= 3.7.1)
- AEPMessaging (1.1.0-beta):
- AEPMessaging (1.1.0-beta2):
- AEPCore (>= 3.4.2)
- AEPEdge (>= 1.1.0)
- AEPEdgeIdentity (>= 1.0.0)
- AEPOptimize (>= 1.0.0)
- AEPServices (>= 3.4.2)
- AEPOptimize (1.0.0):
- AEPCore (>= 3.2.0)
Expand Down Expand Up @@ -127,6 +129,9 @@ PODS:
- RCTAEPAssurance (3.0.0):
- AEPAssurance (~> 3.0)
- React
- RCTAEPCampaignClassic (1.0.0-beta.1):
- AEPCampaignClassic (~> 3.0)
- React
- RCTAEPCore (1.0.1):
- AEPCore (~> 3.0)
- AEPIdentity (~> 3.0)
Expand All @@ -142,8 +147,8 @@ PODS:
- RCTAEPEdgeIdentity (1.1.0):
- AEPEdgeIdentity (~> 1.0)
- React
- RCTAEPMessaging (1.0.0-beta.2):
- AEPMessaging (~> 1.0)
- RCTAEPMessaging (1.0.0-beta.3):
- AEPMessaging (~> 1.1.0-beta2)
- React
- RCTAEPOptimize (1.0.0-beta.2):
- AEPOptimize (~> 1.0)
Expand Down Expand Up @@ -494,6 +499,7 @@ DEPENDENCIES:
- OpenSSL-Universal (= 1.1.1100)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTAEPAssurance (from `../../../packages/assurance`)
- RCTAEPCampaignClassic (from `../../../packages/campaignclassic`)
- RCTAEPCore (from `../../../packages/core`)
- RCTAEPEdge (from `../../../packages/edge`)
- RCTAEPEdgeConsent (from `../../../packages/edgeconsent`)
Expand Down Expand Up @@ -540,6 +546,7 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- AEPAssurance
- AEPCampaignClassic
- AEPCore
- AEPEdge
- AEPEdgeConsent
Expand Down Expand Up @@ -587,6 +594,8 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTAEPAssurance:
:path: "../../../packages/assurance"
RCTAEPCampaignClassic:
:path: "../../../packages/campaignclassic"
RCTAEPCore:
:path: "../../../packages/core"
RCTAEPEdge:
Expand Down Expand Up @@ -670,18 +679,19 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
AEPMessaging:
:commit: 713867e60fa16c2e350c01e1ca799bf46c7ac7c3
:commit: 4cee3af0f2ad5edc955e13c20fa025935584ee49
:git: https://github.com/adobe/aepsdk-messaging-ios.git

SPEC CHECKSUMS:
AEPAssurance: b25880cd4b14f22c61a1dce19807bd0ca0fe9b17
AEPCampaignClassic: cd20252606d9e12d5ee2c410df260762faa49d2c
AEPCore: 412fe933382892ab6c6af958d2f69ebcbca11216
AEPEdge: 6faf60328f9e5ae7a107fd61f9a968f46ebf2928
AEPEdgeConsent: a23b35ab331d2aa2013fcef49c9d6b80085d5597
AEPEdgeIdentity: 47f0c6ecbec5857b2a8cb9b7bf717c2424c6bae0
AEPIdentity: 7cd5a51d8012aeaeee769e99597db016ad68b0d1
AEPLifecycle: 94c36a54f7e5466c5274bc822c53eaa410b74888
AEPMessaging: 72ebb84ce97be336660a4bbe7eed46f47965ba5c
AEPMessaging: 31635f7570be215f1bd2781f0e67a7a3a49952aa
AEPOptimize: 413690f88cb8ae574153a94081331788ca740a91
AEPPlaces: 04294020832c78249732c80aec86928114698cbf
AEPRulesEngine: 71228dfdac24c9ded09be13e3257a7eb22468ccc
Expand Down Expand Up @@ -709,11 +719,12 @@ SPEC CHECKSUMS:
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
RCTAEPAssurance: 9f51b9b5da17f9b98a41ce29e4f3e3b67ea36c17
RCTAEPCampaignClassic: eab902c60651cca7030756d1df9e4048e681f626
RCTAEPCore: 513c7e995cafcaf536653f0dfaaba2b92862b93a
RCTAEPEdge: 9938932e89a90adf5cd30250b46cc67fbe35dd06
RCTAEPEdgeConsent: b998b2d08f254635ef01263fea186d7262f2d242
RCTAEPEdgeIdentity: 1b18a3ff1947f8f4896d5f40083d31a6971e4bbc
RCTAEPMessaging: 5ff246c624ceb253f93dbb1ae96af4ec898c91af
RCTAEPMessaging: db5eac36357eef99c482687f76ebe4ad4c491879
RCTAEPOptimize: f4852f029423e0e1c62a012a9af8377c9b28ca54
RCTAEPPlaces: ed94d03350cf3e945a606d673e1c42d91ee97f3d
RCTAEPTarget: b0dbedb171d8aaf2faa6ac17e96dc3038a2031a4
Expand Down
3 changes: 2 additions & 1 deletion apps/AEPSampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
},
"dependencies": {
"@adobe/react-native-aepassurance": "^3.0.0",
"@adobe/react-native-aepcampaignclassic": "1.0.0-beta.1",
"@adobe/react-native-aepcore": "^1.0.0",
"@adobe/react-native-aepedge": "^1.0.0",
"@adobe/react-native-aepedgeconsent": "^1.0.0",
"@adobe/react-native-aepedgeidentity": "^1.1.0",
"@adobe/react-native-aepmessaging": "^1.0.0-beta.2",
"@adobe/react-native-aepmessaging": "^1.0.0-beta.3",
"@adobe/react-native-aepoptimize": "^1.0.0-beta.2",
"@adobe/react-native-aepplaces": "^1.0.0-beta.1",
"@adobe/react-native-aeptarget": "^1.0.0-beta.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"bootstrap": "npx lerna bootstrap",
"prebuild": "npx lerna exec --ignore aepsampleapp -- rm -rf js",
"build": "npx lerna exec --ignore aepsampleapp -- tsc",
"tests:jest": "npx jest",
"tests:jest": "jest",
"sampleapp:ios:pod:update": "cd apps/AEPSampleApp/ios && pod update",
"sampleapp:ios:pod:install": "cd apps/AEPSampleApp/ios && pod install",
"sampleapp:ios:build": "cd apps/AEPSampleApp && npx react-native run-ios",
Expand Down
69 changes: 69 additions & 0 deletions packages/campaignclassic/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
sample/
.github/
.git/

# Built application files
android/*/build/

# Crashlytics configuations
android/com_crashlytics_export_strings.xml

# Local configuration file (sdk path, etc)
android/local.properties

# Gradle generated files
android/.gradle/

# Signing files
android/.signing/

# User-specific configurations
android/.idea/gradle.xml
android/.idea/libraries/
android/.idea/workspace.xml
android/.idea/tasks.xml
android/.idea/.name
android/.idea/compiler.xml
android/.idea/copyright/profiles_settings.xml
android/.idea/encodings.xml
android/.idea/misc.xml
android/.idea/modules.xml
android/.idea/scopes/scope_settings.xml
android/.idea/vcs.xml
android/*.iml

# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
ios/Pods
ios/build
*project.xcworkspace*
*xcuserdata*
ios/*.xcworkspace
ios/*.podspec

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.dbandroid/gradle
android/gradlew
android/build
android/gradlew.bat
android/gradle/
__tests__
.circleci/
.opensource/
jest/
acp-sdks/
update-android-sdk.sh
CONTRIBUTING.md
CODE_OF_CONDUCT.md
Makefile
*.tgz
22 changes: 22 additions & 0 deletions packages/campaignclassic/RCTAEPCampaignClassic.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = "RCTAEPCampaignClassic"
s.version = package["version"]
s.summary = "Experience Platform Campaign Classic extension for Adobe Experience Platform Mobile SDK. Written and Supported by Adobe."
s.author = "Adobe Experience Platform SDK Team"

s.homepage = "https://github.com/adobe/aepsdk-react-native"

s.license = "Apache 2.0 License"
s.platform = :ios, '10.0'

s.source = { :git => "https://github.com/adobe/aepsdk-react-native.git", :tag => "#{s.version}" }

s.source_files = 'ios/**/*.{h,m}'
s.requires_arc = true

s.dependency "React"
s.dependency "AEPCampaignClassic", "~>3.0"
end
Loading