You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With iOS 9, Apple has added the ability to allow http links to directly open your app, rather than using the URI Schemes. This can be a pain to set up, as it involves a complicated process on your server. The good news is that Branch does this work for you with just two steps!
179
179
@@ -193,11 +193,19 @@ With iOS 9, Apple has added the ability to allow http links to directly open you
#### Custom Domain Name Configuration (Required if you don't use the Branch provided xxxx.app.link domain)
197
+
198
+
Branch provides a xxxx.app.link domain for your app, but you can use your own custom domain for app links instead. If you _do_ use your own custom domain for your universal app links, you need to add it to your Info.plist.
199
+
200
+
Add the `branch_universal_link_domains` key with your custom domain as a string value:
The Branch SDK will pull the first URI Scheme from your list that is not one of `fb`, `db`, or `pin`. This value will be used one time to set the iOS URI Scheme under your Link Settings in the Branch Dashboard.
199
207
200
-
For additional help configuring the SDK, including step-by-step instructions, please see the [iOS Quickstart Guide](https://github.com/BranchMetrics/Branch-Integration-Guides/blob/master/ios-quickstart.md).
208
+
For additional help configuring the SDK, including step-by-step instructions, please see the [iOS Quickstart Guide](https://docs.branch.io/pages/apps/ios/).
201
209
202
210
### Get a Singleton Branch Instance
203
211
@@ -405,6 +413,8 @@ Nothing
405
413
406
414
**BOOL** continueUserActivity will return a boolean indicating whether Branch has handled the Universal Link. If Universal Link is powered by Branch, then continueUserActivity will return YES because the Branch click object is present.
407
415
416
+
If you use your own custom universal link domain, make sure you add it your Info.plist under the `branch_universal_link_domains` key as described [here](#custom-domain-name-configuration) or this method may erroneously return `NO` when in fact the universal link will be opened.
417
+
408
418
### Register a Deep Link Controller
409
419
410
420
Register a controller for Branch to show when specific keys are present in the Branch open / install dictionary. This is the mechanism to handle auto deep linking and should be called before `initSession`.
@@ -760,14 +770,14 @@ Here are a set of best practices to ensure that your analytics are correct, and
760
770
Note: Content indexed using `CSSearchableItem` could be removed from Spotlight but cannot be removed if indexed using `NSUserActivity`.
761
771
762
772
Practices to _avoid_:
763
-
1. Don't set the same `title`, `contentDescription` and `imageUrl` across all objects
764
-
2. Don't wait to initialize the object and register views until the user goes to share
765
-
3. Don't wait to initialize the object until you conveniently need a link
773
+
1. Don't set the same `title`, `contentDescription` and `imageUrl` across all objects.
774
+
2. Don't wait to initialize the object and register views until the user goes to share.
775
+
3. Don't wait to initialize the object until you conveniently need a link.
766
776
4. Don't create many objects at once and register views in a `for` loop.
767
777
768
778
### Branch Universal Object
769
779
770
-
#### Methods
780
+
#### Methods and Properties
771
781
772
782
###### Objective-C
773
783
@@ -780,8 +790,9 @@ BranchUniversalObject *branchUniversalObject = [[BranchUniversalObject alloc] in
**canonicalIdentifier**: This is the unique identifier for content that will help Branch de-dupe across many instances of the same thing. If you have a website with pathing, feel free to use that. Or if you have database identifiers for entities, use those.
801
813
802
-
**title**: This is the name for the content and will automatically be used for the OG tags. It will insert $og_title into the data dictionary of any link created.
814
+
**title**: This is the name for the content and will automatically be used for the OG tags. It will insert `$og_title` into the data dictionary of any link created.
803
815
804
-
**contentDescription**: This is the description for the content and will automatically be used for the OG tags. It will insert $og_description into the data dictionary of any link created.
816
+
**contentDescription**: This is the description for the content and will automatically be used for the OG tags. It will insert `$og_description` into the data dictionary of any link created.
805
817
806
-
**imageUrl**: This is the image URL for the content and will automatically be used for the OG tags. It will insert $og_image_url into the data dictionary of any link created.
818
+
**imageUrl**: This is the image URL for the content and will automatically be used for the OG tags. It will insert `$og_image_url` into the data dictionary of any link created.
807
819
808
-
**metadata**: These are any extra parameters you'd like to associate with the Branch Universal Object. These will be made available to you after the user clicks the link and opens up the app. To add more keys/values, just use the method `addMetadataKey`.
820
+
**keywords**: Key words that describe the object. These are used for Spotlight search and web scraping so that users can find your content.
809
821
810
-
**price**: The price of the item to be used in conjunction with the commerce related events below.
822
+
**locallyIndex**: If set to true, Branch will index this content on Spotlight on the user's phone.
811
823
812
-
**currency**: The currency representing the price in [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217). Default is USD.
813
-
814
-
**contentIndexMode**: Can be set to the ENUM of either `ContentIndexModePublic` or `ContentIndexModePrivate`. Public indicates that you'd like this content to be discovered by other apps. Content would be indexed using `NSUserActivity` if set to pulic, else would be indexed using `CSSearchableIndex`. Currently, this is only used for Spotlight indexing but will be used by Branch in the future.
824
+
**publiclyIndex**: If set to true, Branch will index this content on Google, Branch, etc.
815
825
816
826
**expirationDate**: The date when the content will not longer be available or valid. Currently, this is only used for Spotlight indexing but will be used by Branch in the future.
817
827
818
-
#### Returns
828
+
**contentMetadata**: Details that further describe your content. Set the properties of this sub-object depending on the type of content that is relevant to your content:
819
829
820
-
None
830
+
#### BranchUniversalObject.contentMetadata
831
+
832
+
The `BranchUniversalObject.contentMetadata` properties further describe your content. These properties are trackable in the Branch dashboard and will be automatically exported to your connected third-party app intelligence partners like Adjust or Mixpanel.
833
+
834
+
Set the properties of this sub-object depending on the type of content that is relevant to your content. The `BranchUniversalObject.contentMetadata.contentSchema` property describes the type of object content. Set other properties as is relevant to the type.
835
+
836
+
**contentMetadata.contentSchema**: Set this property to a `BranchContentSchema` enum that best describes the content type. It accepts values like `BranchContentSchemaCommerceProduct` and `BranchContentSchemaMediaImage`.
837
+
838
+
**contentMetadata.customMetadata**: This dictionary contains any extra parameters you'd like to associate with the Branch Universal Object. These will be made available to you after the user clicks the link and opens up the app.
839
+
840
+
**contentMetadata.price**: The price of the item to be used in conjunction with the commerce related events below.
841
+
842
+
**contentMetadata.currency**: The currency representing the price in [ISO 4217 currency code](http://en.wikipedia.org/wiki/ISO_4217). The default is USD.
843
+
844
+
**contentMetadata.quantity**: The quantity.
845
+
846
+
**contentMetadata.sku**: The vendor SKU.
847
+
848
+
**contentMetadata.productName**: Product name.
849
+
850
+
**contentMetadata.productBrand**: Product brand.
851
+
852
+
**contentMetadata.productCategory**: The `BNCProductCategory` value, such as `BNCProductCategoryAnimalSupplies` or `BNCProductCategoryFurniture`.
853
+
854
+
**contentMetadata.productVariant**: The product variant.
855
+
856
+
**contentMetadata.condition**: The `BranchCondition` value, such as `BranchConditionNew` or `BranchConditionRefurbished`.
857
+
858
+
**ratingAverage, ratingCount, ratingMax**: The rating for your content.
859
+
860
+
**addressStreet, addressCity, addressRegion, addressCountry, addressPostalCode**: The address of your content.
861
+
862
+
**latitude, longitude**: The longitude and latitude of your content.
863
+
864
+
**imageCaptions**: Image captions for the content's images.
821
865
822
866
### Tracking User Interactions With An Object
823
867
@@ -1129,7 +1173,7 @@ If you'd like to list your Branch Universal Object with link properties in Spotl
1129
1173
```swift
1130
1174
universalObject.listOnSpotlight(with: linkProperty) { (url, error) in
1131
1175
if (error == nil) {
1132
-
print("Successfully indexed on spotlight")
1176
+
print("Successfully indexed on spotlight")
1133
1177
}
1134
1178
}
1135
1179
```
@@ -1144,7 +1188,7 @@ None
1144
1188
1145
1189
### List Multiple Branch Universal Objects On Spotlight using CSSearchableIndex
1146
1190
1147
-
If you'd like to list multiple Branch Universal Object in Spotlight local index, this is the method you'll call in Branch.h.
1191
+
Call this method on the Branch shared instance to list multiple Branch Universal Objects in Spotlight:
1148
1192
1149
1193
#### Methods
1150
1194
@@ -1163,7 +1207,7 @@ If you'd like to list multiple Branch Universal Object in Spotlight local index,
// Successfully able to index all the BUO on spotloght
@@ -1278,7 +1322,7 @@ Branch.getInstance().removeAllPrivateContentFromSpotLight { (error) in
1278
1322
1279
1323
#### Parameters
1280
1324
1281
-
**Callback**: Will return once all Branch Universal Object is removed from spotlight.
1325
+
**Callback**: Will return once all Branch Universal Object is removed from spotlight.
1282
1326
Note: SpotlightIdentifer would not be nil of all the Branch Universal Object been removed from spotlight as Branch SDK doesn't cache the Branch Universal Objects.
0 commit comments