-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
api: inappmessagingFirebase In App MessagingFirebase In App Messaging
Description
Step 1: Describe your environment
- Xcode version: 12.5.1
- Firebase SDK version: 8.4.0
- Installation method: CocoaPods
- Firebase Component: IAM
Step 2: Describe the problem
Steps to reproduce:
- Compose a new in-app message in the Firebase Console, and leave a trailing whitespace in the image URL;
- Make the message appear in the app (send a test message or publish the campaign).
Why the crash happens:
- In
FIRIAMFetchResponseParser’sconvertToMessageDefinitionWithMessageDict:,[NSURL URLWithString:imageURLStr]returnsnilbecause of the whitespace; - The
msgDataobject is created withnilinimageURL; nilURLs produce no image data;- The
imageDataparameter inFIRInAppMessagingDisplayMessageinitializer is notnullable, so the entiredisplayMessageobject becomesnil; FIRInAppMessagingDisplay’sdisplayMessage:displayDelegate:method assumesmessageForDisplayis not optional, so when anilis received in the Swift runtime, a crash occurs.
Next Steps
In addition to the check introduced in the associated pull request, a new method could be added to FIRIAMFetchResponseParser to sanitize URL strings by handling common errors, such as whitespaces.
Filed in #8485. Implemented in #8486.
Images
Stack Trace
Crashed: com.apple.main-thread
0 libswiftCore.dylib 0x1b68d45b8 swift_getObjectType + 60
1 <REDACTED> 0x10358a344 closure #1 in <REDACTED>.displayMessage(_:displayDelegate:) + 4390806340 (<compiler-generated>:4390806340)
2 <REDACTED> 0x1021a89b0 thunk for @escaping @callee_guaranteed () -> () + 4369959344 (<compiler-generated>:4369959344)
3 libdispatch.dylib 0x1a8de69a8 _dispatch_call_block_and_release + 24
4 libdispatch.dylib 0x1a8de7524 _dispatch_client_callout + 16
5 libdispatch.dylib 0x1a8d995b4 _dispatch_main_queue_callback_4CF$VARIANT$mp + 904
6 CoreFoundation 0x1a909f6bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
7 CoreFoundation 0x1a909a590 __CFRunLoopRun + 1724
8 CoreFoundation 0x1a9099ba8 CFRunLoopRunSpecific + 424
9 GraphicsServices 0x1b3209344 GSEventRunModal + 160
10 UIKitCore 0x1ad1d53e4 UIApplicationMain + 1932
11 <REDACTED> 0x10215cb2c main + 15 (<REDACTED>.swift:15)
12 libdyld.dylib 0x1a8f218f0 start + 4
Metadata
Metadata
Assignees
Labels
api: inappmessagingFirebase In App MessagingFirebase In App Messaging



