Skip to content

Commit 9411fff

Browse files
committed
add canonical url and ID to spotlight indexing
1 parent 2a6f36e commit 9411fff

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Branch-SDK/Branch-SDK/BranchUniversalObject.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,14 @@ - (void)listOnSpotlightWithCallback:(callbackWithUrl)callback {
197197
publiclyIndexable = YES;
198198
}
199199

200+
NSMutableDictionary *metadataAndProperties = [self.metadata mutableCopy];
201+
metadataAndProperties[BRANCH_LINK_DATA_KEY_CANONICAL_IDENTIFIER] = self.canonicalIdentifier;
202+
metadataAndProperties[BRANCH_LINK_DATA_KEY_CANONICAL_URL] = self.canonicalUrl;
203+
200204
[[Branch getInstance] createDiscoverableContentWithTitle:self.title
201205
description:self.contentDescription
202206
thumbnailUrl:[NSURL URLWithString:self.imageUrl]
203-
linkParams:self.metadata.copy
207+
linkParams:metadataAndProperties.copy
204208
type:self.type
205209
publiclyIndexable:publiclyIndexable
206210
keywords:[NSSet setWithArray:self.keywords]
@@ -218,11 +222,14 @@ - (void)listOnSpotlightWithIdentifierCallback:(callbackWithUrlAndSpotlightIdenti
218222
else {
219223
publiclyIndexable = YES;
220224
}
225+
NSMutableDictionary *metadataAndProperties = [self.metadata mutableCopy];
226+
metadataAndProperties[BRANCH_LINK_DATA_KEY_CANONICAL_IDENTIFIER] = self.canonicalIdentifier;
227+
metadataAndProperties[BRANCH_LINK_DATA_KEY_CANONICAL_URL] = self.canonicalUrl;
221228

222229
[[Branch getInstance] createDiscoverableContentWithTitle:self.title
223230
description:self.contentDescription
224231
thumbnailUrl:[NSURL URLWithString:self.imageUrl]
225-
linkParams:self.metadata.copy
232+
linkParams:metadataAndProperties.copy
226233
type:self.type
227234
publiclyIndexable:publiclyIndexable
228235
keywords:[NSSet setWithArray:self.keywords]

0 commit comments

Comments
 (0)