-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
api: inappmessagingFirebase In App MessagingFirebase In App Messaging
Description
[REQUIRED] Step 1: Describe your environment
- Xcode version: 13.2.1
- Firebase SDK version: 8.4.0
- Installation method:
Swift Package Manager - Firebase Component: In-App Messaging
- Target platform(s):
iOS
[REQUIRED] Step 2: Describe the problem
In-App Messaging' message has appData property. But it looks always nil for test message.
Steps to reproduce:
- Make an App to receive In-App Messaging
- Create and send Test message from Firebase Console
- Set a break point at
displayMessage(:displayDelegate:)in1.'s App and run the App in Debug mode - See
messageForDisplay.appDatain debug console. It showsnil.
Relevant Code:
There are two causes of this problem.
1. FIRIAMFetchResponseParser always ignores appData for test message
firebase-ios-sdk/FirebaseInAppMessaging/Sources/Data/FIRIAMFetchResponseParser.m
Lines 357 to 367 in d28849c
| if (isTestMessage) { | |
| return [[FIRIAMMessageDefinition alloc] initTestMessageWithRenderData:renderData | |
| experimentPayload:experimentPayload]; | |
| } else { | |
| return [[FIRIAMMessageDefinition alloc] initWithRenderData:renderData | |
| startTime:startTimeInSeconds | |
| endTime:endTimeInSeconds | |
| triggerDefinition:triggersDefinition | |
| appData:dataBundle | |
| experimentPayload:experimentPayload | |
| isTestMessage:NO]; |
In this code, FIRIAMFetchResponseParser looks ignore appData for test message.
2. In-App Messaging's response does not contain appData property for test message.
firebase-ios-sdk/FirebaseInAppMessaging/Sources/Flows/FIRIAMMsgFetcherUsingRestful.m
Lines 171 to 173 in 480178b
| NSDictionary *responseDict = [NSJSONSerialization JSONObjectWithData:data | |
| options:kNilOptions | |
| error:&errorJson]; |
I found that appData also does not be included in responseDict for test message. It looks happened every time for test message.
Metadata
Metadata
Assignees
Labels
api: inappmessagingFirebase In App MessagingFirebase In App Messaging