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
731 stars 228 forks source link

Branch SDK asks for paste permission everytime the app is opened. #1412

Open korzonkiee opened 1 month ago

korzonkiee commented 1 month ago

Describe the bug

Branch SDK asks for paste permission everytime the app is opened.

Steps to reproduce

  1. Integrate Branch SDK into the app with NativeLink™ Deferred Deep Linking.
  2. Copy link.
  3. Open the app, see that it requests paste permission popup.
  4. Kill the app.
  5. Copy link.
  6. Open the app, see that it requests paste permission popup again.

Expected behavior

Branch SDK should only ask for paste permission after app was installed.

SDK Version

3.4.3

XCode Version

15.0.1

Device

iPhone 15 Pro

OS

17.0

Additional Information/Context

See this issue in Branch Flutter SDK for more context.

Screenshots

Step 1: Copy link Step 2: Open app (permission request) Step 3: Kill app Step 4: Copy link Step 5: Open app (permission request)
CleanShot 2024-07-01 at 16 14 22@2x CleanShot 2024-07-01 at 16 14 22@2x CleanShot 2024-07-01 at 16 14 41@2x CleanShot 2024-07-01 at 16 13 57@2x CleanShot 2024-07-01 at 16 14 22@2x
korzonkiee commented 1 month ago

According to the documentation, the checkPasteboardOnInstall method must be called in the application(_:didFinishLaunchingWithOptions:) callback. However, this callback is fired every time the app is opened, and from what I understand, the checkPasteboardOnInstall always sets the checkOnInstall to true, without checking if the app was opened for the first time (after installation). As a result, the paste permission popup appears every time the user opens the app while having a link copied in the clipboard. See video below.