mobfox / MobFox-iOS-SDK

Apache License 2.0
15 stars 12 forks source link

App Crashes in [MobFoxAd loadAd] on users 32Bit Devices in iOS 9 and iOS 10 #75

Closed riisemichi closed 5 years ago

riisemichi commented 5 years ago

The SDK (3.5.4) causes my App to crash on 32Bit Devices. I was able to reproduce it on an iPad 3 with iOS 9.3.5

Call Stack: image

Log Output:

2018-11-03 12:50:49.117 NiceClockFB[589:18767] Setup MobFox Ad 2018-11-03 12:50:49.327 NiceClockFB[589:18767] -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL 2018-11-03 12:50:51.560 NiceClockFB[589:18767] -[__NSArrayI stringByAddingPercentEncodingWithAllowedCharacters:]: unrecognized selector sent to instance 0x155d4260 2018-11-03 12:50:51.561 NiceClockFB[589:18767] crash logger disabled 2018-11-03 12:50:51.562 NiceClockFB[589:18767] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI stringByAddingPercentEncodingWithAllowedCharacters:]: unrecognized selector sent to instance 0x155d4260' *** First throw call stack: (0x21aff91b 0x2129ae17 0x21b052b5 0x21b02ee1 0x21a2e238 0x223414ff 0xfdd03 0xd162f 0xaba51 0xf18b7f 0xf228d5 0xf18b6b 0xf2c557 0xf1ab0d 0xf1d157 0x21ac1b6d 0x21ac0067 0x21a0f229 0x21a0f015 0x22fffac9 0x260e3189 0xcfeb5 0x216b7873) libc++abi.dylib: terminating with uncaught exception of type NSException

This is a crash report of a user:

2018-11-0216-13-07.1991+0100-e65ae9c94196cf91d777489ab70d5f6b6e1a0102.crash.txt

nabriski commented 5 years ago

Hi, Thanks, we'll go over this tomorrow and update.

nabriski commented 5 years ago

Hi, Sorry for not responding, our iOS dev was not able to get to this yet. I hope we can return with meaningful feedback tomorrow.

MosheNe commented 5 years ago

Hi, We could not simulate your reported issue using our demo app on the iOS device you described. We also explored your log file and we have few questions: 1 which MobFox framework version you are using?

  1. can you use our demo app on the same device which you simulated the crash? Thanks for your feedback
riisemichi commented 5 years ago

The error happens when a GDPR Consent is present.

You can reproduce it in your DemoAppSwift by adding the following two lines in MainViewController.swift after line 67: mobfoxAd.gdpr = true mobfoxAd.gdpr_consent = "BOW36lnOW36lnAhADBENB1-AAAAid7_9__9uz_Gv_v_f33e89v_l7-_u_-33d4-_1vf99yfm1-7ftr3tp_86ues2_Xur_959__3z27EA"

I think the error happens in your consent string parsing. My CMP had the same issues on 32Bit devices. There is some hex string parsing happening which results in a int number that would take more than 32 bits.

MosheNe commented 5 years ago

Thank you for your feedback. Seems we found and solved the problem. We want to verify the fix with you if possible. Can you please write which version you are using so we can do this fix on that version and send you to download link ?

riisemichi commented 5 years ago

Wonderful, thank you! Sorry, forgot to mention that. I'm using the latest version (3.5.4) via CocoaPods.

MosheNe commented 5 years ago

Hi,

The framework (version 3.5.4S2) with the fix can be downloaded from here http://static.starbolt.io/MobFox-iOS-SDK-3.5.4S2-binaries.zip

Following manual installation instructions (integrating framework 3.5.4S2 to project):

  1. For integrating static lib: Drag MobFoxSDKCore.embeddedframework from the Finder into your project.
  2. For dynamic lib: Drag MobFoxSDKCoreDynamic.embeddedframework from the Finder into your project. (MobFoxSDKCoreDynamic.framework must be under 'Embedded Binaries' and 'Linked Frameworks and Libraries')

The framework API information is here https://github.com/mobfox/MobFox-iOS-SDK

If you have any more questions please let me know.

riisemichi commented 5 years ago

Thanks, I integrated it and tested it. The App does not crash anymore, but it also does not show a test advertisement. When I start it on a newer device it shows a test banner ad, not on the old device under iOS 9.

MosheNe commented 5 years ago

Thank you the feedback, I'm happy to know that it's not crash anymore. referring for the test Ad which is not showing, we found that Apple's JSCORE running old iOS 9, not working with js "let" command. We need to replace it with "var" command. We will do it remotely on our server, once done we will let you know so you can test and verify that Ad works.

nabriski commented 5 years ago

We'll update the server today and update this space.

MosheNe commented 5 years ago

you should see Ad now, can you verify this, Thanks!

riisemichi commented 5 years ago

I can see ads now, thank you very much!