How to test Branch.io in a simulator?

I scratch my head, how should I check the integration of branch.io on the simulator.

To create links, I use the Javascript / web SDK instead of the iOS SDK. When you click the "View Content in Application" button on my landing page, it will generate a link and follow it.

All this works fine, but when I open the transition page in the simulator, it never tries to open the local application on the phone with the same package ID.

I would suggest that this could be because the current URL of the app store is empty (because it does not exist yet) ... but I'm not sure how I should check if it works if I cannot get deeplink, to call it locally.

Thanks!

+5
source share
2 answers

@Tallboy, unfortunately, the simulator is not suitable for testing deep links for two reasons:

  • there is no app store on the simulator, so you cannot see the true redirection behavior
  • simulator does not support Universal Links

You are absolutely right - you can click the link and then manually open the application. In this case, we use the “deferred deep binding” mechanisms to determine that the link was clicked earlier. This method is discussed in our documentation here .

If you have questions about this, please ask. You can also contact the branch team via support@branch.io.

+1
source

Not entirely ideal, but if you are just trying to pass static parameters to your application through the Branch link and test their application implementation in the simulator, you can simply copy them to the Branch block initSessionWithLaunchOptions:andRegisterDeepLinkHandler: This block is called every time the application becomes active again (that is, if it is set) and when the application starts, even if it is used in application:didFinishLaunchingWithOptions:

The branch handler block passes in the params dictionary, which you can either override (they will be null, or just contain several keys if the block was not called from the link), or just create your own to go to your application.

This obviously doesn’t work for testing website redirects to the desktop or downloading to the App Store (or for many other uses for Branch), but if you just want to check redirects to specific views for your application by clicking the link (or in my case, how a dynamically generated view will look like on 4S when I did not have 4S available for testing), it does its job.

+2
source

Source: https://habr.com/ru/post/1242508/


All Articles