Add app version check while creating a branch.io deeplink - deep-linking

Our mobile apps are hybrid (Native + React Native). Also, we have many active app versions in the market. As per the flow, a nightly job will send WhatsApp notifications to a set of users,with deeplink (created using branch.io). On that deep link click, user should be redirected at the newly built RN screen.
How do we manage redirection in the app with versions < latest version? Ideally, we would want, the user to be redirected to Appstore/Playstore to 'update' app.
Can we set some app version check while creating branch.io deeplinks?

Since Branch links make use of App links on Android and Universal links on iOS. It is the OS that opens the App without any call to Branch servers involved. You can break the universal links by appending "/e" in your Branch links.
Note: This would break the universal links for the users having the latest version of your App as well.
An alternative is to re-direct the user to the Play Store/App store from your Application after checking the App version.

Related

Branch.io deep links on iOS - Params not shared when app opened with universal links

I'm using the branch.io API to create deeplinks send by email to our users. When creating the link I add some metadata for the iOS app like the deelinkpath and other useful data.
I'm able to see these params when I copy the branch link and open the iOS app manually. And it works also when the link opens safari first before redirecting to the app.
However if the link opens the app directly from the email (universal link), branch doesn't recognise the link and returns
["+clicked_branch_link": 0, "+is_first_session": 0]
Any idea on what I'm missing?
Thanks!
The issue was related to a wrong implementation of the Scene Delegate methods to manage the continue user activity as we support only iOS > 13.0.
This new version of the Branch iOS SDK doc explains how to fix the implementation for apps using Scenes: https://help.branch.io/developers-hub/docs/ios-basic-integration#section-apps-using-scenes

How to test the "open-in-app" feature for the branch link created using Branch.io in development build?

I have an application which is already in App Store.I have to check the branch linking feature I added using Branch.io in development build.That is, when a user shares something on social networks, clicking on the shared post should open the application installed. So how do I check this functionality in development build?
Alex from Branch.io here: Branch doesn't know (or care) how the application is installed onto your device. Installing directly from Xcode and using a beta distribution system (TestFlight, Hockey, Fabric, etc.) are treated exactly the same way as going through the App Store.
Here is a flow you can use to test this:
Install a build of your app that includes the Branch SDK
Generate a link and post it somewhere like iOS Notes
Uninstall your app
Open the link and let it redirect all the way through to the App Store page
Close the App Store
Install a build of your app locally (using either Xcode or TestFlight/Fabric/etc.)
Open your app
The link data will be returned to you, exactly the same way it would be when your app is installed from the App Store by a user.

Universal link doesn't open the app on iOS

I have an app with MagicLink authentication implemented using universal links. The app and the server are configured to handle universal links following Apple’s documentation (https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
The link successfully launches the app from Apple Mail + Safari. However when I try to open it from GoogleMail + Chrome, it redirect to the AppStore.
It is important to notice that the app isn’t on the AppStore yet and I’m trying to sort out the issue before publishing it.
I can reproduce the issue on the iPhone 6s with iOS 10
This is a known issue with a number of apps. Universal Links do not work in many situations, with the Gmail app being one of them. See a more detailed list here.
To work around this limitation, your Universal Link URL needs to lead to a page with a button/link on it the user can activate. At Branch.io, we offer a Deepviews feature for this purpose. You'll need to build something similar.

Branch.io Deeplink not working in safari in ios 9, But it works in chrome

Deeplinks working perfectly when using chrome iOS app. But in safari it stopped working and it always redirect to the appstore page even the app is installed or sometimes pop a alert saying "safari cannot open the page because the address is invalid". Everything works perfect few days back. so my guess is this happens after the ios 9.2 update. Any solution for this?
UPDATE
I have tried using a new phone(Which app not installed before) and installed the app.
Deep links works for both browsers (Safari and Chrome).
If you push the bnc.lt forward button it opens App Store for both Safari and Chrome.
Next time you open a link deep link:
Safari: It asks if you want to open the link in app store
Chrome: It asks if you want to open app and at the same time redirects to app store. If you click open in app next time you click a deep link it will open in app.
So in other words you can still open the app from Chrome after clicking the bnc.lt forward link in staus bar. This is because Chrome asks for opening the app and not app store.
For Safari i end up in an irreversible state where the deep link always open app store and not the app.
Alex from Branch here: this is the expected behavior. Unfortunately our fallback options are rather limited at the moment, due to the changes to Universal Links in iOS 9.2.
TL;DR: it's a bit of an edge case that most users wouldn't encounter, but you can easily work around it by making use of our Deepviews functionality.
Basically, here's the logic behind what you're seeing:
When you open the link on a device without the app installed, you end up on our bnc.lt server, and we redirect you to the App Store so you can get the app. This is good.
When you open the link on a device with the app installed for the first time, your device detects the Universal Link and opens the app immediately. All this happens locally on your device, and you never even get to our bnc.lt server. This is also good.
When you push the bnc.lt forward button, you're telling your device 'I don't want you to immediately open the app...show me the web content for this link instead'. In the case of a Branch link, this 'web content' is simply a redirect to the App Store. At this point, Branch has no way to know whether you the app is installed or not, so we have to assume it isn't and you get the same treatment as 1. above. This is not so good, but right now we don't have any better options due to the way Apple has designed the system.
The next time you open a link, your device remembers that you pushed the bnc.lt button in the past and just takes you straight to the web content. I'm not sure why Safari does it this way, because I can't imagine many situations where this would be desirable and it is leading to a lot of confusion for users.
The real problem here is that when you press bnc.lt to bypass the app, your device remembers this preference and executes it every time it sees a bnc.lt link in future. Chrome still 'works' because it is proactively confirming the preference each time in 4., whereas Safari just plows forward. There are a few options for what happens next:
In Apple's ideal world, you'd end up on a normal webpage where you could simply scroll up and use the Open in app button to reverse this preference. But since Branch is immediately redirecting you to the App Store, this isn't an option. You could consider using our Deepviews feature, since this does provide some real web content in place of the immediate App Store redirect you're seeing right now.
In most situations, you can still long-press on the link and select Open in app, but this doesn't help users who don't know the option is there.
In the worst-case scenario, you end up on the App Store page and just press the Open button (instead of Install). Thanks to Branch's magic, you'll still end up in the right place!
Now from iOS 9.2, Apple no longer supports URI schemes for deep
linking, developers must implement Universal Links in order to deep
link properly on iOS.
Universal links let you replace custom URL schemes with standard HTTP or HTTPS links. Universal links work for all users: If users have your app installed, the link takes them directly into your app; if they don’t have your app installed, the link opens your website in Safari.
To learn all about universal links, see
How to support Universal Links in iOS App and setup server for it?
Example
https://github.com/vineetchoudhary/iOS-Universal-Links
UPDATE [1]
How Branch links work (Branch.io)
If you take a lock at fundamentals of Branch's contextual deep links. You found Branch.io also using traditional deep-linking
1. Creating links
When you’ve integrated the Mobile SDK, you can create a Branch link every time a user clicks to share or invite another user from within your app. Your app makes a call to Branch.io, and Branch.io return a Branch link.
2. Tying data to links
3. Clicking links
4. Using data
Check the Clicking links step, Branch.io just map your website URL with your app URI scheme but URI schemeno longer supported by Safari. So, move to Universal Links is only the option in order to deep linking in iOS 9.2 or you can wait for some solution by Branch.io. Thanks.

Two iOS apps using the same Facebook app ID - is it possible?

I'm using the latest facebook iOS SDK (supporting SSO) to connect my iPhone app with facebook. So far so good..
Since my current app is free with ads, I would like to create another version without ads (which i will charge for). I prefer not to use the in-app purchase approach.
The problem i'm facing is that with the facebook SSO, I need to bind the iOS application to a URL which is based on the facebook app ID. Since I have only one facebook app to be used by both of the iphone apps, the two iOS apps are binded to the same URL and therefore when both of them are installed on a device the callback from facebook to my app does not work (or opens the other app instead).
Is there a solution for that besides creating another facebook app dedicated to the new version of the iphone app?
Thanks.
I had to use FBLoginView in my app, and none of this solutions worked. The only missing thing was that i needed to add a new entry in the plist file: FacebookUrlSchemeSuffix (documented here, in the Step 2).
Suppose that your App ID is 123456, what i had to do was:
1) In your facebook app, add a URL Scheme Suffix in the iOS section:
2) In both of your applications, go to the app's .plist, and add the following entry:
Note that the Value must be one of the URL Scheme Suffixes added.
3) Also change your URL Scheme for Facebook in the .plist file to fb. For example, fb123456client
In the latest Facebook iOS SDK on Github there's a method called authorize:delegate:localAppId: initWithAppId:urlSchemeSuffix:andDelegate:. You can use the localAppId urlSchemeSuffix parameter to distinguish multiple iOS Apps that use the same Facebook application id. The method documentation says:
urlSchemeSuffix is a string of lowercase letters that is appended to the base URL scheme used for SSO. For example, if your facebook ID is "350685531728" and you set urlSchemeSuffix to "abcd", the Facebook app will expect your application to bind to the following URL scheme: "fb350685531728abcd". This is useful if your have multiple iOS applications that share a single Facebook application id (for example, if you have a free and a paid version on the same app) and you want to use SSO with both apps. Giving both apps different urlSchemeSuffix values will allow the Facebook app to disambiguate their URL schemes and always redirect the user back to the correct app, even if both the free and the app is installed on the device.
urlSchemeSuffix is supported on version 3.4.1 and above of the Facebook app. If the user has an older version of the Facebook app installed and your app uses urlSchemeSuffix parameter, the SDK will proceed as if the Facebook app isn't installed on the device and redirect the user to Safari.

Resources