Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20283] Facebook iOS Module 5.0.0 crashes on resume on iOS 8.4

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-01-31T05:33:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.2.0
ComponentsiOS
Labelsqe-5.2.0, regression
ReporterGanna Kozynenko
AssigneeHans Knöchel
Created2016-01-26T14:37:09.000+0000
Updated2016-02-02T22:20:30.000+0000

Description

The new version of FB module 5.0.0 crashes on iOS 8.4 When the module is connected as described (app id and everything), and there is only a require and no other fb-related javascript code, the app crashes on resume on iOS 8.4. On iOS 9, it does not happen. From what I have figured out, the crash source is in this line:
NSString* annotation = [launchOptions objectForKey:UIApplicationOpenURLOptionsAnnotationKey];
Update: as it has been proven yesterday, mysterious crashes on startup on the device of my coworker were also due to this bug. After I wrapped it into "version more than 9.0" statement, the crashes were fixed

Comments

  1. Adipa Wijayathilaka 2016-01-28

    Hello, I have this issue ongoing as well (duplicate ticket - now closed). Crashes with Seg Fault 11 when this occurs (log is from iOS system level):
       Jan 27 15:15:35 computer com.apple.CoreSimulator.SimDevice.39126AA9-9E22-4A0E-ADCC-3F148A3F0994.launchd_sim[6823] (UIKitApplication:ca.XXXXX.m[0xd21][7153]): Service exited due to signal: Segmentation fault: 11
       
  2. Chee Kiat Ng 2016-01-28

    May I know which Ti SDK Version is being used?
  3. Adipa Wijayathilaka 2016-01-28

    I've made a pull request regarding this here: https://github.com/appcelerator-modules/ti.facebook/pull/41 It fixed it at least in my specific use case (using the module for login + share on iOS 8, 9). The webpage to sign the Appcelerator CLA doesn't work for me somehow. EDIT: Ti SDK 5.1.2
  4. Ganna Kozynenko 2016-01-28

    Yes, I used the latest SDK, 5.1.2 ------ My quick fix is dumb, this is why I did not make any pull request. I am not 100% sure what information comes in the "annotation" string, so I just skipped that statement for IOS less than 9.0, and it just works (so that my app does not crash right now in this release) We only use statistics from FB, and it does send install statistics even without annotation.
       #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:(v) options:NSNumericSearch] != NSOrderedAscending)
       
       NSString *annotation;
           if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
               annotation = [launchOptions objectForKey:UIApplicationOpenURLOptionsAnnotationKey];
               NSLog(@"[DEBUG] annotation is not nil");
           }
       
  5. Ganna Kozynenko 2016-01-28

    The CLA works in the incognito window, there is some bug with browser cache
  6. Chee Kiat Ng 2016-01-28

    Sorry about the CLA issue. We are looking into that. And thanks for the PR! will take a look!
  7. Ganna Kozynenko 2016-01-28

    About pull request. I am not Appc employee, but I kinda object to replacing a constant with a string of the same name. It was not crashing on 9.x, and unless the constant is equal to a string on 9.x (which I don't know, I did not find any such information in the docs), it is going to lose the information from annotation variable on 9.x Wrap it into statement that it's only for the systems lesser than 9.x please
  8. Adipa Wijayathilaka 2016-01-28

    That sounds like a good idea, I'll do that now.
  9. Hans Knöchel 2016-01-30

    Hey there! I cherry-picked the community PR of [~adipa] because of continuing problems with the CLA server. PR (appcelerator_modules/ti.facebook): https://github.com/appcelerator-modules/ti.facebook/pull/42 PR (titlanium_mobile/master): https://github.com/appcelerator/titanium_mobile/pull/7650 PR (titlanium_mobile/5_2_X): https://github.com/appcelerator/titanium_mobile/pull/7651
  10. Chee Kiat Ng 2016-01-30

    [~hansknoechel] cool. go ahead to merge and resolve.
  11. Adipa Wijayathilaka 2016-01-30

    Thanks for the taking the time out of your weekends to look into this. Appreciate it very much.
  12. Harry Bryant 2016-02-01

    Verified as fixed, Facebook Module 5.0.1 with the latest SDK 5.2.0.v20160131224748 no longer crashes on iOS 8.4 Devices. iPhone 6s Plus Device (9.2) & iPhone 6 Plus Device (8.4) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.2.0.v20160131224748 Appc Studio: 4.5.0.201601262138 Appc NPM: 4.2.3-1 App CLI: 5.2.0-238 Xcode 7.2 Node v4.2.3 *Closing Ticket.*

JSON Source