capacitor-community / facebook-login

Facebook Login support
MIT License
103 stars 54 forks source link

Plugin crashes on iOS 11.0.* and 11.1.* #14

Closed joepb closed 3 years ago

joepb commented 3 years ago

Describe the bug Launching an app with this plugin crashes during startup if ran on iOS 11.0 or 11.1 devices.

To Reproduce Steps to reproduce the behavior:

  1. Implement the facebook-login pod
  2. Run on a device with iOS 11.0 or 11.1
  3. Application crashes in splash-screen with
    Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
    reason: 'Invalid parameter not satisfying: formatOptions == 0 
    || !(formatOptions & ~(NSISO8601DateFormatWithYear 
    | NSISO8601DateFormatWithMonth 
    | NSISO8601DateFormatWithWeekOfYear 
    | NSISO8601DateFormatWithDay 
    | NSISO8601DateFormatWithTime 
    | NSISO8601DateFormatWithTimeZone 
    | NSISO8601DateFormatWithSpaceBetweenDateAndTime 
    | NSISO8601DateFormatWithDashSeparatorInDate 
    | NSISO8601DateFormatWithColonSeparatorInTime 
    | NSISO8601DateFormatWithColonSeparatorInTimeZone 
    | NSISO8601DateFormatWithFullDate 
    | NSISO8601DateFormatWithFullTime 
    | NSISO8601DateFormatWithInternetDateTime)
    )'

Expected behavior Not crashing and continuing the application.

Screenshots N/A

Smartphone

Additional context Issue originates here: https://github.com/capacitor-community/facebook-login/blob/d25d4f9f20aeb8e8bff66b4dc422ebc3e436db1a/ios/Plugin/Plugin.swift#L16

Super simple solution is explained here https://stackoverflow.com/a/59892014/1531122 Editing the the line to read #available(iOS 11.2, *) indeed fixes the issue for me.

(my experience with Swift is shorter than me typing this bug-report, so I don't feel comfortable yet to make this a PR)

rdlabo commented 3 years ago

Thanks for good advice! I fixed this issue!