Skip to content

Instantly share code, notes, and snippets.

@witt3rd
Last active July 17, 2024 00:38
Show Gist options
  • Select an option

  • Save witt3rd/39c99b8514d99478b864114c8b2fc874 to your computer and use it in GitHub Desktop.

Select an option

Save witt3rd/39c99b8514d99478b864114c8b2fc874 to your computer and use it in GitHub Desktop.

Revisions

  1. witt3rd revised this gist Jul 17, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion root-cause-analysis.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # VOY-4321: Root Cause Analysis Report

    [Filed by LI-RCA](http://localhost:2024/yichen.html)
    [Filed by LI-RCA](http://localhost:2024/assets/yichen2.html)

    ## Issue

  2. witt3rd revised this gist Jul 17, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions root-cause-analysis.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # VOY-4321: Root Cause Analysis Report

    [Filed by LI-RCA](http://localhost:2024/yichen.html)

    ## Issue

    The LinkedIn sharing functionality in the ShareBoxController is non-functional on iOS 11 and later versions.
  3. witt3rd created this gist Jul 17, 2024.
    54 changes: 54 additions & 0 deletions root-cause-analysis.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    # VOY-4321: Root Cause Analysis Report

    ## Issue

    The LinkedIn sharing functionality in the ShareBoxController is non-functional on iOS 11 and later versions.

    ## Root Cause

    The root cause of this issue is the use of deprecated and removed APIs for LinkedIn sharing through the Social framework.

    ## Detailed Analysis

    1. The code attempts to use `SLComposeViewController` with `SLServiceTypeLinkedIn`:

    ```objc
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeLinkedIn]) {
    SLComposeViewController *shareBoxComposer = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeLinkedIn];
    // ...
    }
    ```
    2. Apple deprecated and removed support for LinkedIn sharing via the Social framework in iOS 11.
    3. As a result, `[SLComposeViewController isAvailableForServiceType:SLServiceTypeLinkedIn]` will always return `NO` on iOS 11 and later, preventing the LinkedIn sharing functionality from working.
    4. The fallback code assumes that LinkedIn is not configured on the device, which is incorrect:
    ```objc
    } else {
    // LinkedIn is not configured on the device, show an alert
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"LinkedIn Account" message:@"Please configure a LinkedIn account in your device settings to share on LinkedIn." preferredStyle:UIAlertControllerStyleAlert];
    // ...
    }
    ```

    ## Impact

    Users on iOS 11 and later versions are unable to share content to LinkedIn using this feature. They receive a misleading error message suggesting that LinkedIn is not configured on their device, even if it is.

    ## Recommendations

    1. Remove the deprecated LinkedIn sharing code using `SLComposeViewController` and `SLServiceTypeLinkedIn`.

    2. Implement an alternative sharing method:

    - Use the official LinkedIn API and SDK for iOS.
    - Implement a web-based sharing solution using a web view or by opening the LinkedIn app (if installed) with a custom URL scheme.
    - Use a more general sharing method like `UIActivityViewController`, which allows users to choose from available sharing options on their device.

    3. Update the error handling to provide more accurate information to users about the availability of LinkedIn sharing.

    4. Consider implementing a more flexible sharing architecture that can adapt to changes in social media platform APIs and policies.

    By addressing these points, the ShareBoxController can provide a more reliable and future-proof LinkedIn sharing experience for users across different iOS versions.