Skip to content

Commit 8083b58

Browse files
authored
Adding plist property 'FirebaseDeepLinkPasteboardRetrievalEnabled' (#5946)
Adding plist property "FirebaseDeepLinkPasteboardRetrievalEnabled" to enable/disable fetching dynamic links from Pasteboard.
1 parent ec62921 commit 8083b58

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

FirebaseDynamicLinks/CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# Unversioned
1+
# v4.2.0
2+
- [Added] Plist property `FirebaseDeepLinkPasteboardRetrievalEnabled` to enable/disable fetching dynamic links from Pasteboard.
23
- [fixed] Reduce frequency of iOS14 pasteboard notifications by only reading from it when it contains URL(s). (#5905)
3-
4-
# v4.3.0
54
- [changed] Functionally neutral updated import references for dependencies. (#5824)
65

76
# v4.1.0

FirebaseDynamicLinks/Sources/FIRDLDefaultRetrievalProcessV2.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ - (nullable NSURL *)uniqueMatchLinkToCheck {
297297
}
298298

299299
- (NSString *)retrievePasteboardContents {
300+
if (![self isPasteboardRetrievalEnabled]) {
301+
// Pasteboard check for dynamic link is disabled by user.
302+
return @"";
303+
}
304+
300305
NSString *pasteboardContents = @"";
301306
if (@available(iOS 10.0, *)) {
302307
if ([[UIPasteboard generalPasteboard] hasURLs]) {
@@ -308,6 +313,21 @@ - (NSString *)retrievePasteboardContents {
308313
return pasteboardContents;
309314
}
310315

316+
/**
317+
Property to enable or disable dynamic link retrieval from Pasteboard.
318+
This property is added because of iOS 14 feature where pop up is displayed while accessing
319+
Pasteboard. So if developers don't want their users to see the Pasteboard popup, they can set
320+
"FirebaseDeepLinkPasteboardRetrievalEnabled" to false in their plist.
321+
*/
322+
- (BOOL)isPasteboardRetrievalEnabled {
323+
id retrievalEnabledValue =
324+
[[NSBundle mainBundle] infoDictionary][@"FirebaseDeepLinkPasteboardRetrievalEnabled"];
325+
if ([retrievalEnabledValue respondsToSelector:@selector(boolValue)]) {
326+
return [retrievalEnabledValue boolValue];
327+
}
328+
return YES;
329+
}
330+
311331
- (void)clearUsedUniqueMatchLinkToCheckFromClipboard {
312332
// See discussion in b/65304652
313333
// We will clear clipboard after we used the unique match link from the clipboard

0 commit comments

Comments
 (0)