fix(iOS): update deprecated URL opening method for Telegram share #1616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is aiming to change deprecated version of openURL method to new usage:
openURL:shareURL options:@{} completionHandler:^(BOOL success) {}
Test Plan
versions:
"react-native": "0.75.4", "react-native-share": "^12.0.3",
ios:
Xcode: 12.0, Device IOS Version: 18.1.1
this is my implementation:
const shareOptions = { social: Share.Social.TELEGRAM, message: 'message', title: 'Share' };
await Share.shareSingle(shareOptions);
without any change, the singleShare is giving this log result for telegram options in Xcode but nothing happens in the ui:
telegram
TRY OPEN telegram BUG IN CLIENT OF UIKIT: The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Force returning false (NO).
after the deprecated URL change, this is the response i got:
telegram TRY OPEN telegram
And telegram app shows up with share screen after this logs.