Skip to content

Commit 5e787f2

Browse files
authored
Fix lack of parse for fiam modal action button (#8140)
* fix lack of parse for modal action button * add test for modal button text color
1 parent 49e37df commit 5e787f2

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

FirebaseInAppMessaging/Sources/Data/FIRIAMFetchResponseParser.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ - (FIRIAMMessageDefinition *)convertToMessageDefinitionWithMessageDict:(NSDictio
230230

231231
imageURLStr = modalNode[@"imageUrl"];
232232
actionButtonText = modalNode[@"actionButton"][@"text"][@"text"];
233+
btnTxtColor =
234+
[UIColor firiam_colorWithHexString:modalNode[@"actionButton"][@"text"][@"hexColor"]];
233235
btnBgColor =
234236
[UIColor firiam_colorWithHexString:modalNode[@"actionButton"][@"buttonHexColor"]];
235237

FirebaseInAppMessaging/Tests/Unit/FIRIAMFetchResponseParserTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ - (void)testRegularConversion {
140140
XCTAssertEqualObjects(@"687787988989", sixth.renderData.messageID);
141141
XCTAssertEqualObjects(@"Super Bowl LV", sixth.renderData.name);
142142
XCTAssertEqualObjects(@"Eagles are going to win", sixth.renderData.contentData.titleText);
143+
XCTAssertEqualObjects(sixth.renderData.renderingEffectSettings.btnTextColor,
144+
[UIColor firiam_colorWithHexString:@"#1a0dab"]);
143145
XCTAssertNil(sixth.renderData.contentData.bodyText);
144146
XCTAssertNil(sixth.appData);
145147
XCTAssertNotNil(sixth.experimentPayload);

FirebaseInAppMessaging/Tests/Unit/TestJsonDataFromFetch.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@
240240
"text": "Eagles are going to win",
241241
"hexColor": "#004953"
242242
},
243+
"actionButton": {
244+
"text": {
245+
"text": "Open",
246+
"hexColor": "#1a0dab"
247+
},
248+
"buttonHexColor": "#000000"
249+
},
250+
"action": {
251+
"actionUrl": "https://www.google.com"
252+
},
243253
"backgroundHexColor": "#ffffff"
244254
}
245255
},

0 commit comments

Comments
 (0)