iOS

Integrate Branch

  • Configure Branch

  • Configure bundle identifier

  • Configure associated domains

    • Add your link domains from your Branch Dashboard
    • -alternate is needed for Universal Linking with the Web SDK inside your Website
    • test- is needed if you need use a test key
    • If you use a custom link domain, you will need to include your old link domain, your -alternate link domain, and your new link domain

      image

  • Configure entitlements

    • Confirm entitlements are within target

      image

  • Configure info.pList

    • Add Branch Dashboard values

      • Add branch_app_domain with your live key domain
      • Add branch_key with your current Branch key
      • Add your URI scheme as URL Types -> Item 0 -> URL Schemes

      image

  • Confirm app prefix

  • Install Branch

    • Option 1: CocoaPods

      platform :ios, '8.0'
      
      target 'APP_NAME' do
        # if swift
        use_frameworks!
      
        pod 'Branch'
      end
      
      pod install && pod update
      
    • Option 2: Carthage

      github "BranchMetrics/ios-branch-deep-linking"
      
    • Option 3: Manually install the source code with dependencies

      • Drag and drop Branch.framework into Embedded Binaries (select Copy items if needed)
      • Import AdSupport, SafariServices, MobileCoreServices, CoreSpotlight, and iAd into Linked Frameworks

      image

  • Initialize Branch

    • Swift 3

      import UIKit
      import Branch
      
      @UIApplicationMain
      class AppDelegate: UIResponder, UIApplicationDelegate {
      
      var window: UIWindow?
      
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // for debug and development only
        Branch.getInstance().setDebug()
        // listener for Branch Deep Link data
        Branch.getInstance().initSession(launchOptions: launchOptions) { (params, error) in
          // do stuff with deep link data (nav to page, display content, etc)
          print(params as? [String: AnyObject] ?? {})
        }
        return true
      }
      
      func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        // handler for URI Schemes (depreciated in iOS 9.2+, but still used by some apps)
        Branch.getInstance().application(app, open: url, options: options)
        return true
      }
      
      func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
        // handler for Universal Links
        Branch.getInstance().continue(userActivity)
        return true
      }
      
      func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
        // handler for Push Notifications
        Branch.getInstance().handlePushNotification(userInfo)
      }
      
    • Objective-C

      #import "AppDelegate.h"
      #import "Branch/Branch.h"
      
      @interface AppDelegate ()
      
      @end
      
      @implementation AppDelegate
      
      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // for debug and development only
        [[Branch getInstance] setDebug];
        // listener for Branch Deep Link data
        [[Branch getInstance] initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary * _Nonnull params, NSError * _Nullable error) {
          // do stuff with deep link data (nav to page, display content, etc)
          NSLog(@"%@", params);
        }];
        return YES;
      }
      
      - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
        // handler for URI Schemes (depreciated in iOS 9.2+, but still used by some apps)
        [[Branch getInstance] application:app openURL:url options:options];
        return YES;
      }
      
      - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
        // handler for Universal Links
        [[Branch getInstance] continueContentUserActivity:userActivity];
        return YES;
      }
      
      - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
        // handler for Push Notifications
        [[Branch getInstance] handlePushNotification:userInfo];
      }
      
      @end
      
    • Create a deep link from the Branch Dashboard
    • Delete your app from the device
    • Compile and test on a device
    • Paste deep link in Apple Notes
    • Long press on the deep link (not 3D Touch)
    • Click Open in "APP_NAME" to open your app (example)

Implement features

  • Create content reference

    • The Branch Universal Object encapsulates the thing you want to share

    • Uses Universal Object properties

    • Swift 3

      // only canonicalIdentifier is required
      let buo = BranchUniversalObject(canonicalIdentifier: "content/123")
      buo.canonicalUrl = "https://example.com/content/123"
      buo.title = "Content 123 Title"
      buo.contentDescription = "Content 123 Description \(Date())"
      buo.imageUrl = "http://lorempixel.com/400/400/"
      buo.price = 12.12
      buo.currency = "USD"
      buo.contentIndexMode = .public
      buo.automaticallyListOnSpotlight = true
      buo.addMetadataKey("custom", value: "123")
      buo.addMetadataKey("anything", value: "everything")
      
    • Objective-C

      // only canonical identifier is required
      BranchUniversalObject *buo = [[BranchUniversalObject alloc] initWithCanonicalIdentifier:@"content/123"];
      buo.title = @"Content 123 Title";
      buo.contentDescription = @"Content 123 Description";
      buo.imageUrl = @"https://lorempixel.com/400/400";
      buo.price = 12.12;
      buo.currency = @"USD";
      buo.contentIndexMode = ContentIndexModePublic;
      buo.automaticallyListOnSpotlight = YES;
      [buo addMetadataKey:@"custom" value:[[NSUUID UUID] UUIDString]];
      [buo addMetadataKey:@"anything" value:@"everything"];
      
    • Generates the analytical properties for the deep link

    • Used for Create deep link and Share deep link

    • Uses Configure link data and custom data

    • Swift 3

      let lp: BranchLinkProperties = BranchLinkProperties()
      lp.channel = "facebook"
      lp.feature = "sharing"
      lp.campaign = "content 123 launch"
      lp.stage = "new user"
      lp.tags = ["one", "two", "three"]
      
      lp.addControlParam("$desktop_url", withValue: "http://example.com/desktop")
      lp.addControlParam("$ios_url", withValue: "http://example.com/ios")
      lp.addControlParam("$ipad_url", withValue: "http://example.com/ios")
      lp.addControlParam("$android_url", withValue: "http://example.com/android")
      lp.addControlParam("$match_duration", withValue: "2000")
      
      lp.addControlParam("custom_data", withValue: "yes")
      lp.addControlParam("look_at", withValue: "this")
      lp.addControlParam("nav_to", withValue: "over here")
      lp.addControlParam("random", withValue: UUID.init().uuidString)
      
    • Objective-C

      BranchLinkProperties *lp = [[BranchLinkProperties alloc] init];
      lp.feature = @"facebook";
      lp.channel = @"sharing";
      lp.campaign = @"content 123 launch";
      lp.stage = @"new user";
      lp.tags = @[@"one", @"two", @"three"];
      
      [lp addControlParam:@"$desktop_url" withValue: @"http://example.com/desktop"];
      [lp addControlParam:@"$ios_url" withValue: @"http://example.com/ios"];
      [lp addControlParam:@"$ipad_url" withValue: @"http://example.com/ios"];
      [lp addControlParam:@"$android_url" withValue: @"http://example.com/android"];
      [lp addControlParam:@"$match_duration" withValue: @"2000"];
      
      [lp addControlParam:@"custom_data" withValue: @"yes"];
      [lp addControlParam:@"look_at" withValue: @"this"];
      [lp addControlParam:@"nav_to" withValue: @"over here"];
      [lp addControlParam:@"random" withValue: [[NSUUID UUID] UUIDString]];
      
    • Generates a deep link within your app

    • Needs a Create content reference

    • Needs a Create link reference

    • Validate with the Branch Dashboard

    • Swift 3

      buo.getShortUrl(with: lp) { (url, error) in
        print(url ?? "")
      }
      
    • Objective-C

      [buo getShortUrlWithLinkProperties:lp andCallback:^(NSString* url, NSError* error) {
          if (!error) {
              NSLog(@"@", url);
          }
      }];
      
    • Will generate a Branch deep link and tag it with the channel the user selects

    • Needs a Create content reference

    • Needs a Create link reference

    • Uses Deep Link Properties

    • Swift 3

      let message = "Check out this link"
      buo.showShareSheet(with: lp, andShareText: message, from: self) { (activityType, completed) in
        print(activityType ?? "")
      }
      
    • Objective C

      [buo showShareSheetWithLinkProperties:lp andShareText:@"Super amazing thing I want to share!" fromViewController:self completion:^(NSString* activityType, BOOL completed) {
          NSLog(@"finished presenting");
      }];
      
    • Retrieve Branch data from a deep link

    • Best practice to receive data from the listener (to prevent a race condition)

    • Returns deep link properties

    • Swift 3

      // listener (within AppDelegate didFinishLaunchingWithOptions)
      Branch.getInstance().initSession(launchOptions: launchOptions) { params, error in
        print(params as? [String: AnyObject] ?? {})
      }
      
      // latest
      let sessionParams = Branch.getInstance().getLatestReferringParams()
      
      // first
      let installParams = Branch.getInstance().getFirstReferringParams()
      
    • Objective C

      [[Branch getInstance] initSessionWithLaunchOptions:launchOptions
                              andRegisterDeepLinkHandler:^(NSDictionary * _Nullable params,
                                                           NSError * _Nullable error) {
          if (!error) {
              //Referring params
              NSLog(@"Referring link params %@",params);
          }
      }];
      
      // latest
      NSDictionary *sessionParams = [[Branch getInstance] getLatestReferringParams];
      
      // first
      NSDictionary *installParams =  [[Branch getInstance] getFirstReferringParams];
      
    • Handled within Branch.initSession()

    • Swift 3

      // within AppDelegate application.didFinishLaunchingWithOptions
      Branch.getInstance().initSession(launchOptions: launchOptions) { params , error in
        // Option 1: read deep link data
        guard let data = params as? [String: AnyObject] else { return }
      
        // Option 2: save deep link data to global model
        SomeCustomClass.sharedInstance.branchData = data
      
        // Option 3: display data
        let alert = UIAlertController(title: "Deep link data", message: "\(data)", preferredStyle: .alert)
        alert.addAction(UIAlertAction(title: "Okay", style: .default, handler: nil))
        self.window?.rootViewController?.present(alert, animated: true, completion: nil)
      
        // Option 4: navigate to view controller
        guard let options = data["nav_to"] as? String else { return }
        switch options {
            case "landing_page": self.window?.rootViewController?.present( SecondViewController(), animated: true, completion: nil)
            case "tutorial": self.window?.rootViewController?.present( SecondViewController(), animated: true, completion: nil)
            case "content": self.window?.rootViewController?.present( SecondViewController(), animated: true, completion: nil)
            default: break
        }
      }
      
    • Objective C

      // within AppDelegate application.didFinishLaunchingWithOptions
      [[Branch getInstance] initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary * _Nonnull params, NSError * _Nullable error) {
        // Option 1: read deep link data
        NSLog(@"%@", params);
      
        // Option 2: save deep link data to global model
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject:params.description forKey:@"BranchData"];
        [defaults synchronize];
      
        // Option 3: display data
        UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"Title" message:params.description preferredStyle:UIAlertControllerStyleAlert];
        UIAlertAction *button = [UIAlertAction actionWithTitle:@"Deep Link Data" style:UIAlertActionStyleDefault handler:nil];
        [alert addAction:button];
        [self.window.rootViewController presentViewController:alert animated:YES completion:nil];
      
        // Option 4: navigate to view controller
        if ([params objectForKey:@"navHere"]) {
          ViewController *anotherViewController = [[ViewController alloc] initWithNibName:@"anotherViewController" bundle:nil];
          [self.window.rootViewController presentViewController:anotherViewController animated:YES completion:nil];
        }
      }];
      
  • Display content

    • List content on iOS Spotlight

    • Needs a Create content reference

    • Swift 3

      buo.automaticallyListOnSpotlight = true
      
    • Objective-C

      buo.automaticallyListOnSpotlight = YES;
      
  • Track content

    • Track how many times a piece of content is viewed

    • Needs a Create content reference

    • Validate with the Branch Dashboard

    • Swift 3

      buo.userCompletedAction(BNCRegisterViewEvent)
      
    • Objective-C

      [buo userCompletedAction:BNCRegisterViewEvent];
      
  • Track users

    • Sets the identity of a user (email, ID, UUID, etc) for events, deep links, and referrals

    • Validate with the Branch Dashboard

    • Swift 3

      // login
      Branch.getInstance().setIdentity("your_user_id")
      
      // logout
      Branch.getInstance().logout()
      
    • Objective-C

      // login
      [[Branch getInstance] setIdentity:@"your_user_id"];
      
      // logout
      [[Branch getInstance] logout];
      
  • Track events

    • Registers a custom event

    • Events named open, close, install, and referred session are Branch restricted

    • Best to Track users before Track events to associate a custom event to a user

    • Validate with the Branch Dashboard

    • Swift 3

      // option 1
      let action = "signup"
      Branch.getInstance().userCompletedAction(action)
      
      // option 2
      let metadata: [String: Any] = [
        "custom_dictionary": 123,
        "anything": "everything"
      ]
      Branch.getInstance().userCompletedAction(action, withState: metadata)
      
    • Objective-C

      // option 1
      NSString *action = @"signup";
      [[Branch getInstance] userCompletedAction:action];
      
      // option 2
      NSDictionary *metadata = @{@"custom_dictionary":@123, @"anything": @"everything"};
      [[Branch getInstance] userCompletedAction:action withState:metadata];
      
  • Track commerce

    • Registers a custom commerce event

    • Uses Track commerce properties for Currency and Category

    • Validate with the Branch Dashboard

    • Swift 3

      // only revenue is required
      let commerceEvent = BNCCommerceEvent.init()
      commerceEvent.affiliation = "affiliation"
      commerceEvent.coupon = "coupon"
      commerceEvent.currency = "USD"
      commerceEvent.transactionID = "transactionID"
      commerceEvent.shipping = 11.22
      commerceEvent.revenue = 99.99
      commerceEvent.tax = 4.42
      
      // optional
      let product1 = BNCProduct.init()
      product1.sku = "sku1"
      product1.name = "name1"
      product1.price = 11.11
      product1.quantity = 1
      product1.brand = "brand1"
      product1.category = "category1"
      product1.variant = "variant1"
      
      // optional
      let product2 = BNCProduct.init()
      product2.sku = "sku2"
      product2.name = "name2"
      product2.price = 22.22
      product2.quantity = 2
      product2.brand = "brand2"
      product2.category = "category2"
      product2.variant = "variant2"
      
      commerceEvent.products = [product1, product2]
      
      // optional
      let metadata: [String: Any] = [
        "custom_dictionary": 123,
        "anything": "everything"
      ]
      
      Branch.getInstance().send(commerceEvent, metadata: metadata, withCompletion: { (response, error) in
        print(response ?? {})
      })
      
    • Objective C

       // only revenue is required
      BNCCommerceEvent *commerceEvent = [BNCCommerceEvent new];
      commerceEvent.affiliation = @"affiliation";
      commerceEvent.coupon = @"coupon";
      commerceEvent.currency = @"USD";
      commerceEvent.transactionID = @"transactionID";
      commerceEvent.shipping = [[NSDecimalNumber alloc] initWithFloat:11.22];
      commerceEvent.revenue = [[NSDecimalNumber alloc] initWithFloat:99.99];
      commerceEvent.tax = [[NSDecimalNumber alloc] initWithFloat:4.2];;
      
      // optional
      BNCProduct *product1 = [BNCProduct new];
      product1.sku = @"sku1";
      product1.name = @"name1";
      product1.price = [[NSDecimalNumber alloc] initWithFloat:11.11];
      product1.quantity = [[NSDecimalNumber alloc] initWithFloat:1.0];
      product1.brand = @"brand1";
      product1.category = @"category1";
      product1.variant = @"variant1";
      
      // optional
      BNCProduct *product2 = [BNCProduct new];
      product2.sku = @"sku2";
      product2.name = @"name2";
      product2.price = [[NSDecimalNumber alloc] initWithFloat:22.22];
      product2.quantity = [[NSDecimalNumber alloc] initWithFloat:2.0];
      product2.brand = @"brand2";
      product2.category = @"category2";
      product2.variant = @"variant2";
      
      commerceEvent.products = @[product1, product2];
      
      // optional
      NSDictionary *metadata = @{@"custom_dictionary":@123,
                             @"anything": @"everything"};
      
      [[Branch getInstance] sendCommerceEvent:commerceEvent metadata:metadata
                           withCompletion:^(NSDictionary *response, NSError *error) {
          NSLog(@"%@",response);
      }];
      
  • Handle referrals

    • Referral points are obtained from referral rules on the Branch Dashboard

    • Validate on the Branch Dashboard

    • Reward credits

    • Redeem credits

      • Swift 3

        // option 1 (default bucket)
        let amount = 5
        Branch.getInstance().redeemRewards(amount)
        
        // option 2
        let bucket = "signup"
        Branch.getInstance().redeemRewards(amount, forBucket: bucket)
        
      • Objective C

        // option 1 (default bucket)
        NSInteger amount = 5;
        [[Branch getInstance] redeemRewards:amount];
        
        // option 2
        NSString *bucket = @"signup";
        [[Branch getInstance] redeemRewards:amount forBucket:bucket];
        
    • Load credits

      • Swift 3

        Branch.getInstance().loadRewards { (changed, error) in
          // option 1 (defualt bucket)
          let credits = Branch.getInstance().getCredits()
        
          // option 2
          let bucket = "signup"
          let credits = Branch.getInstance().getCreditsForBucket(bucket)
        }
        
      • Objective C

        [[Branch getInstance] loadRewardsWithCallback:^(BOOL changed, NSError * _Nullable error) {
            if (changed) {
            // option 1 (defualt bucket)
            NSInteger credits = [[Branch getInstance] getCredits];
        
            // option 2
            NSString *bucket = @"signup";
            NSInteger credit = [[Branch getInstance] getCreditsForBucket:bucket];
            }
        }];
        
    • Load history

      • Swift 3

        Branch.getInstance().getCreditHistory { (creditHistory, error) in
           print(creditHistory ?? {})
         }
        
      • Objective C

        [[Branch getInstance] getCreditHistoryWithCallback:^(NSArray * _Nullable creditHistory, NSError * _Nullable error) {
            NSLog(@"%@",creditHistory);
        }];
        
  • Handle push notifications

    • Allows you to track Branch deep links in your push notifications

    • Include the Branch push notification handler in Initialize Branch

    • Add a Branch deep link in your push notification payload

      {
        "aps": {
          "alert": "Push notification with a Branch deep link",
          "badge": "1"
        },
        "branch": "https://example.app.link/u3fzDwyyjF"
      }
      
      • Replace https://example.app.link/u3fzDwyyjF with your deep link
    • Read deep link data from initSession Initialize Branch (example)

  • Track Apple Search Ads

    • Allows Branch to track Apple Search Ads deep linking analytics

    • Analytics from Apple's API have been slow which will make our analytics lower. Additionally, Apple's API does not send us all the data of an ad every time which will make ads tracked by us to show a generic campaign sometimes.

    • Add before initSession Initialize Branch

      • Swift 3

        Branch.getInstance().delayInitToCheckForSearchAds()
        
      • Objective C

        [[Branch getInstance] delayInitToCheckForSearchAds];
        
    • Test with fake campaign params (do not test in production)

      • Swift 3

        Branch.getInstance().setAppleSearchAdsDebugMode()
        
      • Objective C

        [[Branch getInstance] setAppleSearchAdsDebugMode];
        
  • Enable 100% matching

    • Use the SFSafariViewController to increase the attribution matching success

    • The 100% match is a bit of a misnomer, as it is only 100% match from when a user clicks from the Safari browser. According to our analysis, clicking through Safari happens about 50-75% of the time depending on the use case. For example, clicking from Facebook, Gmail or Chrome won’t trigger a 100% match here. However, it’s still beneficial to the matching accuracy, so we recommend employing it.

    • When using a custom domain, add a branch_app_domain string key in your Info.plist with your custom domain to enable 100% matching.

    • By default, cookie-based matching is enabled on iOS 9 and 10 if the SafariServices.framework is included in an app's dependencies, and the app uses an app.link subdomain or sets the branch_app_domain in the Info.plist. It can be disabled with a call to the SDK.

    • Add before initSession Initialize Branch

    • Swift 3

      Branch.getInstance().disableCookieBasedMatching()
      
    • Objective C

      [[Branch getInstance] disableCookieBasedMatching];
      

Troubleshoot issues

  • Submitting to the App Store

    • Need to select app uses IDFA or GAID when publishing your app (for better deep link matching)
  • App not opening

  • App not passing data

  • Simulate an install

    • Delete your app

    • iPhone Device -> Settings -> Privacy -> Advertising -> Reset Advertising Identifier -> Reset Identifier

    • Add Branch.setDebug(true) before initSession (Initialize Branch Features)

    • Click on a deep link to navigate to your $fallback_url because your app is not installed

    • Install your app

    • Open your app

    • Read from params within initSession for +is_first_session = true

    • Happens whenever the app cannot make a connection to the Branch servers

    • The long deep links will still open the app and pass data

  • Sample apps

  • Track content properties

    • Used for Track content

      Key Value
      BNCRegisterViewEvent User viewed the object
      BNCAddToWishlistEvent User added the object to their wishlist
      BNCAddToCartEvent User added object to cart
      BNCPurchaseInitiatedEvent User started to check out
      BNCPurchasedEvent User purchased the item
      BNCShareInitiatedEvent User started to share the object
      BNCShareCompletedEvent User completed a share
  • Enable logging

    • Use the Branch test key instead of the live key

    • Add before initSession Initialize Branch

    • Remove before releasing to production

    • Swift 3

      Branch.getInstance().setDebug()
      
    • Objective C

      [[Branch getInstance] setDebug];
      
    • Make sure OS_ACTIVITY_MODE is not disabled (link)

  • Use test key

    • Use the Branch test key instead of the live key

    • Add before initSession Initialize Branch

    • Update branch_key in your Info.plist to a dictionary (example)

    • The test key of your app must match the test key of your deep link

    • Remove before releasing to production

    • Swift 3

      Branch.setUseTestBranchKey(true)
      
    • Objective C

      [Branch setUseTestBranchKey:YES];
      
  • Re-enable universal linking

    • Apple allows users to disable universal linking on a per app per device level on iOS 9 and iOS 10 (fixed in iOS 11)

    • Use Test deep link to re-enable universal linking on the device

    • Add before initSession Initialize Branch

    • Recommend to Navigate to content instead

    • Swift 3

      Branch.getInstance().registerDeepLinkController(ViewController(), forKey: "my-key", withPresentation: .optionShow)
      
    • Objective C

      [[Branch getInstance] registerDeepLinkController:customViewController forKey:@"my-key"withPresentation:BNCViewControllerOptionShow];
      
    • Use for Universal Linking if you want to get the true/false response from Branch.getInstance().continue(userActivity) within continueUserActivity without a Branch network call
    • Use only if you have a custom link domain
    • Add branch_universal_link_domains to your info.plist with an array of your link domain from your Branch Dashboard

      image

  • Share to email options

    • Change the way your deep links behave when shared to email

    • Needs a Share deep link

    • Swift 3

      lp.addControlParam("$email_subject", withValue: "Therapists hate him.")
      lp.addControlParam("$email_html_header", withValue: "<style>your awesome CSS</style>\nOr Dear Friend,")
      lp.addControlParam("$email_html_footer", withValue: "Thanks!")
      lp.addControlParam("$email_html_link_text", withValue: "Tap here")
      
    • Objective C

      [lp addControlParam:@"$email_subject" withValue:@"This one weird trick."];
      [lp addControlParam:@"$email_html_header" withValue:@"<style>your awesome CSS</style>\nOr Dear Friend,"];
      [lp addControlParam:@"$email_html_footer" withValue:@"Thanks!"];
      [lp addControlParam:@"$email_html_link_text" withValue:@"Tap here"];
      
  • Share message dynamically

    • Change the message you share based on the source the users chooses

    • Needs a Share deep link

    • Swift 3

      // import delegate
      class ViewController: UITableViewController, BranchShareLinkDelegate
      
      func branchShareLinkWillShare(_ shareLink: BranchShareLink) {
        // choose shareSheet.activityType
        shareLink.shareText = "\(shareLink.linkProperties.channel)"
      }
      
    • Objective C

      // import delegate
      @interface ViewController () <BranchShareLinkDelegate>
      
      - (void) branchShareLinkWillShare:(BranchShareLink*)shareLink {
        // choose shareSheet.activityType
        shareLink.shareText = [NSString stringWithFormat:@"@%", shareLink.linkProperties.channel];
      }
      

Comments