{"action":"created","issue":{"url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/issues/366","repository_url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking","labels_url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/issues/366/comments","events_url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/issues/366/events","html_url":"https://github.com/BranchMetrics/ios-branch-deep-linking/issues/366","id":158942214,"number":366,"title":"Incorrect universal link handling after killing the app","user":{"login":"elikohen","id":2521185,"avatar_url":"https://avatars.githubusercontent.com/u/2521185?v=3","gravatar_id":"","url":"https://api.github.com/users/elikohen","html_url":"https://github.com/elikohen","followers_url":"https://api.github.com/users/elikohen/followers","following_url":"https://api.github.com/users/elikohen/following{/other_user}","gists_url":"https://api.github.com/users/elikohen/gists{/gist_id}","starred_url":"https://api.github.com/users/elikohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elikohen/subscriptions","organizations_url":"https://api.github.com/users/elikohen/orgs","repos_url":"https://api.github.com/users/elikohen/repos","events_url":"https://api.github.com/users/elikohen/events{/privacy}","received_events_url":"https://api.github.com/users/elikohen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-07T14:47:17Z","updated_at":"2016-07-29T16:51:55Z","closed_at":"2016-07-29T16:51:55Z","body":"Hello branch team, i'm an iOS developer at Letgo, we've found a bug that causes some universal links to be ignored when clicked and launched again next time the user opens the app:\r\n\r\nProcess to reproduce the bug:\r\n\r\n1. Init the app:\r\n\t- With a http proxy we see branch sdk calls `open` in branch api\r\n\t- We call `branch.initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandlerUsingBranchUniversalObject` inside `func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool`\r\n\r\n2. double click home button on device and 'kill' the app (swiping it) + go to dashboard  (this step cause a bug on ios that calls `willEnterForeground` and then `didBecomeActive` but the app never actually became active so it won't call `willEnterForeground` again)\r\n\t- we see the `close` api call in branch api \r\n\t- we also see a new `open` api call (this one breaks everything)\r\n\r\n3. click a universal link\r\n\t- App launches (we call the init session again)\r\n\t- App receives `func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void) -> Bool` and we pass it to branch\r\n\t- There's NO `open` call\r\n\t- We receive the BranchUniversalObject callback with `nil` -> Problem\r\n\r\n4. We go to background (or click power button)\r\n\t- App calls `close` branch api\r\n\r\n5. We open again the app (or unlock the screen)\r\n\t- App calls `open` with the deeplink from step 3 (this one is a bit wtf for us)\r\n\t- We receive the Branch universal object callback and execute the action -> Problem because this time the user didn't click anything and we're redirecting him to a new screen.\r\n\r\n\r\nI hope this helps you to find the error.  Thanks"},"comment":{"url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/issues/comments/236233205","html_url":"https://github.com/BranchMetrics/ios-branch-deep-linking/issues/366#issuecomment-236233205","issue_url":"https://api.github.com/repos/BranchMetrics/ios-branch-deep-linking/issues/366","id":236233205,"user":{"login":"ahmednawar","id":16910208,"avatar_url":"https://avatars.githubusercontent.com/u/16910208?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmednawar","html_url":"https://github.com/ahmednawar","followers_url":"https://api.github.com/users/ahmednawar/followers","following_url":"https://api.github.com/users/ahmednawar/following{/other_user}","gists_url":"https://api.github.com/users/ahmednawar/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmednawar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmednawar/subscriptions","organizations_url":"https://api.github.com/users/ahmednawar/orgs","repos_url":"https://api.github.com/users/ahmednawar/repos","events_url":"https://api.github.com/users/ahmednawar/events{/privacy}","received_events_url":"https://api.github.com/users/ahmednawar/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T16:51:54Z","updated_at":"2016-07-29T16:51:54Z","body":"Closing here, feel free to re-open if you have any updates."}}
{"actor":{"display_login":"ahmednawar"}}