Skip to content

Instantly share code, notes, and snippets.

@witt3rd
Last active July 17, 2024 00:38
Show Gist options
  • Save witt3rd/39c99b8514d99478b864114c8b2fc874 to your computer and use it in GitHub Desktop.
Save witt3rd/39c99b8514d99478b864114c8b2fc874 to your computer and use it in GitHub Desktop.
VOY-4321: Root Cause Analysis Report

VOY-4321: Root Cause Analysis Report

Filed by LI-RCA

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:
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeLinkedIn]) {
    SLComposeViewController *shareBoxComposer = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeLinkedIn];
    // ...
}
  1. Apple deprecated and removed support for LinkedIn sharing via the Social framework in iOS 11.

  2. As a result, [SLComposeViewController isAvailableForServiceType:SLServiceTypeLinkedIn] will always return NO on iOS 11 and later, preventing the LinkedIn sharing functionality from working.

  3. The fallback code assumes that LinkedIn is not configured on the device, which is incorrect:

} 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment