mixpanel / mixpanel-iphone

Official iOS (Objective-C) Tracking Library for Mixpanel Analytics
http://mixpanel.com
Apache License 2.0
1.05k stars 564 forks source link

MPNotificationServiceExtension crash when mp_media_url is empty string #901

Closed jmartini closed 3 years ago

jmartini commented 4 years ago

Integration Method: CocoaPods Xcode Version: 11.4.1 Library Version: 3.6.1 Platform: App Extension Language: Objective-C Description: The MPNotificationServiceExtention will cause an uncaught exception if the payload contains an empty string for payload field "mp_media_url": *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]' *** First throw call stack:

To create an empty "mp_media_url" payload:

  1. In the Mixpanel message creator, enter any text into "Image url" field.
  2. Save the message.
  3. Remove text from "Image url" field. Note that the UI now shows the default, example url in this field now.

This message will now send the empty "mp_media_url".

Expected Behavior: No crash if "mp_media_url" is an empty string.

zihejia commented 3 years ago

Mixpanel is deprecating Messaging and Mobile A/B testing features(more details), please contact our support if you need to continue the conversation for any critical issues. Sorry for the inconvenience.