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-1997] Update share sheet to use short links with tracking is disabled #1268

Closed nsingh-branch closed 1 year ago

nsingh-branch commented 1 year ago

Reference

SDK-1997 -- Update share sheet methods to still create a short link when tracking is disabled

Summary

Update the share sheet methods to still generate short links when tracking is disabled instead of long links. By removing the initialization status check, the SDK will make a v1/url call instead of constructing a long link.

Motivation

Currently, getShortUrl() already can be used to create a short link when tracking is disabled, but the share sheet methods would still create a long link. This brings parity between the two and overall improves the share sheet behavior.

Type Of Change

Testing Instructions

Trying to share a link via the share sheet and using BranchShareLink while tracking is disabled and enabled.

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

codecov[bot] commented 1 year ago

Codecov Report

Merging #1268 (54a06fd) into master (e760484) will increase coverage by 0.21%. The diff coverage is 97.87%.

@@            Coverage Diff             @@
##           master    #1268      +/-   ##
==========================================
+ Coverage   51.26%   51.47%   +0.21%     
==========================================
  Files          78       78              
  Lines       11156    11166      +10     
  Branches     4316     4318       +2     
==========================================
+ Hits         5719     5748      +29     
+ Misses       5174     5155      -19     
  Partials      263      263              
Impacted Files Coverage Δ
BranchSDK/BranchInstallRequest.m 67.18% <ø> (ø)
BranchSDK/BranchOpenRequest.m 63.13% <ø> (ø)
BranchSDK/Branch.m 39.39% <95.74%> (+1.30%) :arrow_up:
Branch-TestBed/Branch-TestBed/AppDelegate.m 42.66% <100.00%> (ø)
BranchSDK/BNCPreferenceHelper.m 79.78% <100.00%> (ø)
BranchSDK/BNCServerInterface.m 66.66% <100.00%> (+0.23%) :arrow_up:
BranchSDK/BranchPluginSupport.m 83.33% <100.00%> (ø)

... and 2 files with indirect coverage changes

nsingh-branch commented 1 year ago

I'd like to sync on offline behavior of this change. Ideally, we'd be able to keep the callee informed about what's going on, but the design is rather fire and forget which makes it awkward.

@echo-branch When offline, the SDK will make a long link and still return it in the completion handler.

echo-branch commented 1 year ago

Ok that sounds good! Let's go ahead and merge this as well.