1

My app is built on ionic 1 and I have followed this guide to get things working. https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking When you click on the branch url, the app opens up fine.

Now I want to setup android app links. When I receive an email with my web app url, eg: https://app.example.com, this should open up the app if mobile app is installed. If not user should be taken to play store/App store.

Also if the link has query params (the query params will be dynamic), this should be passed to the mobile app. eg: https://app.example.com/mypath?query_params=1234567890

Based on the path in the url, the user will be redirected to the respective page on the ionic app.

I have setup the branch sdk bower install branch-sdk. When I click on the url (https://app.example.com) this still opens up on browser. This is how my index.html in ionic app looks like.

<script src="lib/branch-sdk/dist/build.min.js"></script>

<script type="text/javascript">
  console.log("Branch SDK Loading");

  branch.init('key_test_ikEKvQjiZRwV1LXZ2hUlamfewwhVQ5rw', function(err, data) {
    console.log("Branch SDK Loaded");
    console.log("Branch SDK Err and Data ", err, data);
  });
</script>

Any idea how to set these things up?

SpiritOfDragon
  • 1,404
  • 2
  • 15
  • 27
  • use firebase dynamiclink or may be this plugin helps u https://github.com/nordnet/cordova-universal-links-plugin – Kishan Oza Nov 17 '17 at 11:51

1 Answers1

0

Alex from Branch.io here:

Everything you've described should generally be working once you've done the initial integration process. If you haven't already, I'd suggest reviewing our main integration guide to make sure all the steps were completed.

If you're still having difficulty, get in touch with our Integrations team. They're fantastic!

EDIT: this is due to using Postmark for email sending. To understand why this is a problem, take a read through this blog post. It's primarily about iOS Universal Links, but App Links work almost exactly the same way.

To get this working, you'll need to turn off link tracking on Postmark.

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • Thanks for getting back. I have followed the integration guide as is. When you click on links that are generated from branch (`myapp.test-app.link`) will open the mobile app. But the weblinks that are in email aren't opening the app. As I said, I have installed the `branch-sdk` as well. Right now I have turned on the `test` mode. – SpiritOfDragon Nov 18 '17 at 17:28
  • How are you sending the email links? Is it via Mailchimp, etc? And which email app are you using when you click it? – Alex Bauer Nov 18 '17 at 17:47
  • I'm using postmark service. I'm on Android and using the default email client. – SpiritOfDragon Nov 19 '17 at 09:27
  • Ahhhh, this makes sense now. See my answer edit for the reason and workaround! – Alex Bauer Nov 19 '17 at 18:19
  • Thanks for the link. WIll go through the post. But for testing purpose, if I have a link like `https://app.example.com` on `slack` or `notes`, clicking on this link should open app right? which is not happening. – SpiritOfDragon Nov 20 '17 at 10:18
  • Hmm yes it should. I misunderstood — thought that WAS working. I’d suggest putting in a ticket with our integrations team, because this sounds more complicated than I thought. – Alex Bauer Nov 20 '17 at 10:22
  • Sure. I have raised a ticket on Saturday and I am waiting for the response. Will update answer once I figure out the problem. So, when I said it works, that means, the link that branch has generated (something like `myapp.test-app.link`) opens up the app, but not the web app url (something like `https://app.example.com`) – SpiritOfDragon Nov 20 '17 at 11:21
  • That would be expected — Branch doesn’t control your main domain, so if you want App Link behavior there, you’d need to build it yourself. The idea with Branch is to creat links you can use anywhere INSTEAD of needing to worry about enabling all these things on your primary domain. – Alex Bauer Nov 20 '17 at 16:08
  • Alex - Can you please answer this? I am blocked on this. Would be helpful if you can help me out here. I have not received answer from support team yet from many days. https://stackoverflow.com/questions/49484904/branch-initsession-not-returning-data-in-ionic-v1-on-ios – SpiritOfDragon Mar 28 '18 at 07:18