Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mob 7622 embeddedview #684

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'br.com.concretesolutions:kappuccino:1.2.1'

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.squareup.okhttp3:mockwebserver:4.2.2'
implementation "com.github.bumptech.glide:glide:4.8.0"
implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
}

tasks.withType(Test) {
Expand Down
23 changes: 18 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,34 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.iterable.iterableapi.testapp">
<uses-sdk tools:overrideLibrary="androidx.security"/>

<uses-sdk tools:overrideLibrary="androidx.security" />
<application
android:name="com.iterable.androidsdk.inboxCustomization.SampleApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity
android:name="com.iterable.androidsdk.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
android:name="com.iterable.androidsdk.inboxCustomization.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.iterable.androidsdk.embeddedMessaging.EmbeddedActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="com.iterable.androidsdk.inboxCustomization.util.SingleFragmentActivity" />
</application>

</manifest>
266 changes: 266 additions & 0 deletions app/src/main/assets/simple-embedded-messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
{
"placements": [
{
"placementId": 0,
"embeddedMessages": [
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI5MzAvMTA4NDUxNzAvdHJ1ZQ==",
"placementId": 0,
"campaignId": 8162930,
"isProof": true
},
"elements": {
"title": "Join our partner gyms at 40% off",
"body": "Choose from one of our partners and subscribe for 1 year at 40% off",
"mediaUrl": "https://images.pexels.com/photos/1954524/pexels-photo-1954524.jpeg?auto=compress&cs=tinysrgb&w=800",
"buttons": [
{
"id": "gym1",
"title": "Gold's Gym",
"action": {
"type": "openUrl",
"data": "https://goldsgym.in/"
}
},
{
"id": "gym2",
"title": "23 Fitness",
"action": {
"type": "openUrl",
"data": "https://www.23fitnessguam.com/"
}
}
]
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI4NDMvMTA4NDUwNjAvdHJ1ZQ==",
"placementId": 0,
"campaignId": 8162843,
"isProof": true
},
"elements": {
"title": "Last chance to grab the deal",
"body": "Visit out website to get the festive deals",
"mediaUrl": "https://athflex.com/cdn/shop/files/pc-banner-for-bag-4_1_1905x.jpg?v=1698474351",
"defaultAction": {
"type": "openUrl",
"data": "https://athflex.com/"
}
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI4NjMvMTA4NDUwOTMvdHJ1ZQ==",
"placementId": 0,
"campaignId": 8162863,
"isProof": true
},
"elements": {
"title": "Buy fitness products at huge discounts",
"body": "Visit our website to buy the products",
"mediaUrl": "https://m.media-amazon.com/images/I/71AyxR0yeeL.jpg",
"buttons": [
{
"id": "",
"title": "70% off",
"action": {
"type": "openUrl",
"data": "https://www.vivafitness.net/product_category/commercial-equipment/water-rowers/"
}
}
],
"defaultAction": {
"type": "openUrl",
"data": "https://www.vivafitness.net/product_category/commercial-equipment/commercial-treadmills/"
}
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI3NzEvMTA4NDQ5NjIvdHJ1ZQ==",
"placementId": 0,
"campaignId": 8162771,
"isProof": true
},
"elements": {
"title": "Spring Collection",
"body": "Check out our new athleisure collection at 30% off this month!",
"mediaUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSHVMF2KkRm5eWS6LhjQGvxe4KFqzkRbUdAEsAEKvBSy_uU23tRxXH0Ws6HuBjfzf_EsSU&usqp=CAU",
"buttons": [
{
"id": "button1",
"title": "Clearance Sale",
"action": {
"type": "openUrl",
"data": "https://athflex.com/collections/last-chance"
}
}
],
"defaultAction": {
"type": "openUrl",
"data": "https://athflex.com/"
}
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjc4OTAvMTA4NTEyMzEvdHJ1ZQ==",
"placementId": 0,
"campaignId": 8167890,
"isProof": true
},
"elements": {
"title": "Let's hit the target by running 10kms",
"mediaUrl": "https://media.istockphoto.com/id/1125038961/photo/young-man-running-outdoors-in-morning.jpg?s=612x612&w=0&k=20&c=LVAlQIforg7ZRAF-bOvdvoD_k3ejEeimrWbGq2IA5ak="
}
}
]
},
{
"placementId": 1,
"embeddedMessages": [
{
"metadata": {
"messageId": "ZGEzNmMyZTQtN1234560YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI5MzAvMTA4NDUxNzAvdHJ1ZQ==",
"placementId": 1,
"campaignId": 8162930,
"isProof": true
},
"elements": {
"title": "Join our partner gyms at 40% off",
"body": "Choose from one of our partners and subscribe for 1 year at 40% off",
"mediaUrl": "https://images.pexels.com/photos/1954524/pexels-photo-1954524.jpeg?auto=compress&cs=tinysrgb&w=800",
"buttons": [
{
"id": "gym1",
"title": "Gold's Gym",
"action": {
"type": "openUrl",
"data": "https://goldsgym.in/"
}
},
{
"id": "gym2",
"title": "23 Fitness",
"action": {
"type": "openUrl",
"data": "https://www.23fitnessguam.com/"
}
}
]
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzI43TY3LzgxNjI4NDMvMTA4NDUwNjAvdHJ1ZQ==",
"placementId": 1,
"campaignId": 8162843,
"isProof": true
},
"elements": {
"title": "Last chance to grab the deal",
"body": "Visit out website to get the festive deals",
"mediaUrl": "https://athflex.com/cdn/shop/files/pc-banner-for-bag-4_1_1905x.jpg?v=1698474351",
"defaultAction": {
"type": "openUrl",
"data": "https://athflex.com/"
}
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy11YzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI4NjMvMTA4NDUwOTMvdHJ1ZQ==",
"placementId": 1,
"campaignId": 8162863,
"isProof": true
},
"elements": {
"title": "Buy fitness products at huge discounts",
"body": "Visit our website to buy the products",
"mediaUrl": "https://m.media-amazon.com/images/I/71AyxR0yeeL.jpg",
"buttons": [
{
"id": "",
"title": "70% off",
"action": {
"type": "openUrl",
"data": "https://www.vivafitness.net/product_category/commercial-equipment/water-rowers/"
}
}
],
"defaultAction": {
"type": "openUrl",
"data": "https://www.vivafitness.net/product_category/commercial-equipment/commercial-treadmills/"
}
}
},
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMy00YzUyLWFmZjktZDhhhDZlYjg3ZjA4LzIwNTY3LzgxNjI3NzEvMHA4NDQ5NjIvdHJ1ZQ==",
"placementId": 1,
"campaignId": 8162771,
"isProof": true
},
"elements": {
"title": "Spring Collection",
"body": "Check out our new athleisure collection at 30% off this month!",
"mediaUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSHVMF2KkRm5eWS6LhjQGvxe4KFqzkRbUdAEsAEKvBSy_uU23tRxXH0Ws6HuBjfzf_EsSU&usqp=CAU",
"buttons": [
{
"id": "button1",
"title": "Clearance Sale",
"action": {
"type": "openUrl",
"data": "https://athflex.com/collections/last-chance"
}
}
],
"defaultAction": {
"type": "openUrl",
"data": "https://athflex.com/"
}
}
}
]
},
{
"placementId": 2,
"embeddedMessages": [
{
"metadata": {
"messageId": "ZGEzNmMyZTQtNWFiMynkyzUyLWFmZjktZDhhMDZlYjg3ZjA4LzIwNTY3LzgxNjI5MzAvMTA4NDUxNzAvdHJ1ZQ==",
"placementId": 2,
"campaignId": 8162930,
"isProof": true
},
"elements": {
"title": "Join our partner gyms at 40% off",
"body": "Choose from one of our partners and subscribe for 1 year at 40% off",
"mediaUrl": "https://images.pexels.com/photos/1954524/pexels-photo-1954524.jpeg?auto=compress&cs=tinysrgb&w=800",
"buttons": [
{
"id": "gym1",
"title": "Gold's Gym",
"action": {
"type": "openUrl",
"data": "https://goldsgym.in/"
}
},
{
"id": "gym2",
"title": "23 Fitness",
"action": {
"type": "openUrl",
"data": "https://www.23fitnessguam.com/"
}
}
]
}
}
]
}
]
}
54 changes: 0 additions & 54 deletions app/src/main/java/com/iterable/androidsdk/MainActivity.java

This file was deleted.