Files
firebase-ios-sdk/FirebaseInAppMessaging/Tests/Unit/TestJsonDataFromFetch.txt
T
christibbs 4c776d1f74 Support AB testing of Firebase In-App Messages (#5005)
* Parse out experiment payload for experimental FIAMs and store it on FIRIAMMessageDefinition

* Fix bugs in parsing experimental payload

* Add nullable experiment payload to FIAM message definition. Add method in FIRExperimenmtController to validate running experiments and call this when new messages are fetched from FIAM backend

* Add and document new ABT methods, update FirebaseInAppMessaging.podspec to depend on ABT

* Clean up deprecated public message initializers, add experiment payload to private initializers

* Activate experiment for experimental messages upon impression

* Clean up activateExperiment API

* Add experimental payload to all message definition initializers

* Add unit test coverage for new ABT methods

* Add test coverage for parsing experimental messages

* Verify experiment payload gets passed to message superclass

* Scripts/style.sh

* Update Podfile for UI test app to include AB Testing SDK

* Add back deprecated initializers for now, these are needed for the test app

* Test for non-nil experiment payload

* Use mutable array directly, better memory usage

* Bump ABTesting podspec version, depend on new ABT in FIAM

* Remove mentions of FIREventOrigins.h

* Remove experiment payload from public API, hide it in private

* Scripts/style.sh

* Fix comment indentation, allow for FIAM to depend on minor version updates of ABTesting

* Move ABTExperimentPayload import to private header
2020-03-03 19:46:37 -05:00

255 lines
6.5 KiB
Plaintext

{
"messages": [
{
"vanillaPayload": {
"campaignId": "13313766398414028800",
"campaignStartTimeMillis": "1523986039000",
"campaignEndTimeMillis": "1526986039000",
"campaignName": "first campaign"
},
"content": {
"modal": {
"title": {
"text": "I heard you like In-App Messages",
"hexColor": "#000000"
},
"body": {
"text": "This is message body",
"hexColor": "#000000"
},
"imageUrl": "https://image.com/5GCaq8sWMgk",
"actionButton": {
"text": {
"text": "Learn More",
"hexColor": "#ffffff"
},
"buttonHexColor": "#000000"
},
"action": {
"actionUrl": "https://www.google.com"
},
"backgroundHexColor": "#fffff8"
}
},
"priority": {
"value": 1
},
"triggeringConditions": [
{
"fiamTrigger": "ON_FOREGROUND"
},
{
"event": {
"name": "jackpot"
}
}
],
"dataBundle": {
"a":"b",
"c":"d"
}
},
{
"vanillaPayload": {
"campaignId": "9350598726327992320",
"campaignStartTimeMillis": "1523985333000",
"campaignEndTimeMillis": "9223372036854775807",
"campaignName": "Inception1"
},
"content": {
"modal": {
"title": {
"text": "Test 2",
"hexColor": "#000000"
},
"body": {
"hexColor": "#000000"
},
"imageUrl": "https://image.com/5GCaq8sWMgk.jpg",
"actionButton": {
"text": {
"text": "Learn More",
"hexColor": "#ffffff"
},
"buttonHexColor": "#000000"
},
"action": {
"actionUrl": "https://www.google.com"
},
"backgroundHexColor": "#ffffff"
}
},
"priority": {
"value": 1
},
"triggeringConditions": [
{
"fiamTrigger": "ON_FOREGROUND"
},
{
"event": {
"name": "jackpot"
}
}
]
},
{
"vanillaPayload": {
"campaignId": "14819094573862617088",
"campaignStartTimeMillis": "1519934825000",
"campaignEndTimeMillis": "9223372036854775807",
"campaignName": "Top banner"
},
"content": {
"banner": {
"title": {
"text": "Hey everybody!",
"hexColor": "#000000"
},
"body": {
"text": "This is an in-app message! Now go to Screen 2!",
"hexColor": "#000000"
},
"imageUrl": "https://image.com/5YYCaq8sWMgk.png",
"action": {
"actionUrl": "https://test-app.firebaseapp.com/Calculator/screen2"
},
"backgroundHexColor": "#ffffff"
}
},
"priority": {
"value": 1
},
"triggeringConditions": [
{
"event": {
"name": "jackpot"
}
}
]
},
{
"vanillaPayload": {
"campaignId": "5595722537007841280",
"campaignStartTimeMillis": "1519934650000",
"campaignEndTimeMillis": "9223372036854775807",
"campaignName": "Ducks on foreground"
},
"content": {
"modal": {
"title": {
"text": "Look, it's a duck!",
"hexColor": "#000000"
},
"body": {
"text": "It's a very nice duck.",
"hexColor": "#000000"
},
"imageUrl": "https://image.com/5YYCaq8sWMgkff.png",
"actionButton": {
"text": {
"text": "Go to Google.com",
"hexColor": "#ffffff"
},
"buttonHexColor": "#000000"
},
"action": {
"actionUrl": "https://www.google.com"
},
"backgroundHexColor": "#ffffff"
}
},
"priority": {
"value": 1
},
"triggeringConditions": [
{
"fiamTrigger": "ON_FOREGROUND"
}
]
},
{
"vanillaPayload": {
"campaignId": "5432869654332221",
"campaignStartTimeMillis": "1519934650000",
"campaignEndTimeMillis": "9223372036854775807",
"campaignName": "Super Bowl LIV"
},
"content": {
"card": {
"title": {
"text": "Eagles are going to win",
"hexColor": "#004953"
},
"body": {
"text": "Start of a dynasty.",
"hexColor": "#004953"
},
"portraitImageUrl": "https://image.com/birds.png",
"landscapeImageUrl": "https://image.com/ls_birds.png",
"primaryActionButton": {
"text": {
"text": "Win Super Bowl LIV",
"hexColor": "#000000"
},
"buttonHexColor": "#ffffff"
},
"secondaryActionButton": {
"text": {
"text": "Win Super Bowl LV",
"hexColor": "#000000"
},
"buttonHexColor": "#ffffff"
},
"primaryAction": {
"actionUrl": "https://www.google.com"
},
"secondaryAction": {
"actionUrl": "https://www.google.com"
},
"backgroundHexColor": "#ffffff"
}
},
"priority": {
"value": 1
},
"triggeringConditions": [
{
"fiamTrigger": "ON_FOREGROUND"
}
]
},
{
"experimentalPayload": {
"campaignId": "687787988989",
"campaignStartTimeMillis": "1519934650000",
"campaignEndTimeMillis": "9223372036854775807",
"campaignName": "Super Bowl LV",
"experimentPayload" : {
"experimentId": "_exp_1",
"experimentStartTimeMillis": "1582143484729",
"overflowPolicy": "DISCARD_OLDEST",
"timeToLiveMillis": "15552000000",
"triggerTimeoutMillis": "15552000000",
"variantId": "1"
}
},
"content": {
"modal": {
"title": {
"text": "Eagles are going to win",
"hexColor": "#004953"
},
"backgroundHexColor": "#ffffff"
}
},
"triggeringConditions": [
{
"fiamTrigger": "ON_FOREGROUND"
}
]
}
],
"expirationEpochTimestampMillis": "1537896430193"
}