BranchMetrics / ios-branch-deep-linking-attribution

The Branch iOS SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://help.branch.io/developers-hub/docs/ios-sdk-overview
MIT License
728 stars 229 forks source link

SDK 2051 remove api variations that confuse swift #1317

Closed echo-branch closed 11 months ago

echo-branch commented 1 year ago

Reference

SDK-2051 remove Objective-C APIs that confuse Xcode's Swift compatibility

Summary

NSError's within callback blocks are converted to exceptions in Swift. This causes unusual behavior when two methods differ only by a NSError in the callback.

Removed problem public APIs, also added an NSError to one version that did not have one. This is a public API change.

Motivation

Improve usability for Swift developers.

Type Of Change

Testing Instructions

Attempt to use these APIs in a Swift app, the NSErrors should be converted to exceptions correctly.

cc @BranchMetrics/saas-sdk-devs for visibility.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1317 (b7ab30a) into master (97ca6bb) will increase coverage by 3.19%. Report is 57 commits behind head on master. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1317      +/-   ##
==========================================
+ Coverage   50.57%   53.77%   +3.19%     
==========================================
  Files          68       68              
  Lines       10109    10086      -23     
  Branches     3889     3886       -3     
==========================================
+ Hits         5113     5424     +311     
+ Misses       4748     4409     -339     
- Partials      248      253       +5     
Files Coverage Δ
BranchSDK/BranchActivityItemProvider.m 0.00% <ø> (ø)
BranchSDK/Branch.m 41.96% <0.00%> (+8.86%) :arrow_up:
BranchSDK/BranchShareLink.m 6.81% <0.00%> (+0.18%) :arrow_up:
BranchSDK/BranchUniversalObject.m 59.76% <0.00%> (+3.88%) :arrow_up:

... and 11 files with indirect coverage changes

NidhiDixit09 commented 12 months ago

@echo How can we make showsharesheet API to throw an error ?

echo-branch commented 12 months ago

@echo How can we make showsharesheet API to throw an error ?

I'm not entirely sure. It's a direct passthrough of this error from Apple's API. https://developer.apple.com/documentation/uikit/uiactivityviewcontroller/completionwithitemshandler

The expected error scenarios don't use that field.