Reputation: 13417
I'm scratching my head how I'm supposed to test my branch.io integration on simulator.
For link generation, I'm using the Javascript/web SDK instead of the iOS SDK. When you click a button to 'view content in app' on my landing page, it will generate the link and follow it.
All this works just great, but when I open the jump page in the simulator, it never actually attempts to open the local app on the phone which has the same bundle identifier.
I would guess this might be because the current app store URL box is blank (because it doesn't exist yet)... but I am not sure how I'm supposed to test if it works if I can't get the deeplink to trigger it locally.
Thanks!
Upvotes: 7
Views: 6948
Reputation: 308
I found a work around for this problem. Just use any online note taking app from Safari. I've used googlekeep to create a new and pasted Branch url, then click/tap that link from there.
Upvotes: 0
Reputation: 849
I did this by using the Reminders app, create a new list, add that url as new item in that list, then click/tap that link in that item. It should open your app. :)
Upvotes: 0
Reputation: 875
Not exactly ideal, but if you're just trying to pass in static params to your app through a Branch link and test your app's implementation of them in the simulator, you can just hardcode them in the Branch initSessionWithLaunchOptions:andRegisterDeepLinkHandler:
block. This block is called every time the application becomes active again (i.e., if it's backgrounded) and on application start, even if it's used in application:didFinishLaunchingWithOptions:
.
The Branch handler block passes in a params
dictionary, which you can either override (they'll be nil or just contain a few keys, if the block wasn't called from a tapped link) or just create your own to pass into your app.
This obviously doesn't work for testing desktop web site redirects or App Store downloads (or for many other use cases for Branch), but if you just wanted to test redirecting into specific views for your app from a clicked link (or in my case, how a dynamically generated view would look on a 4S when I didn't have a 4S available to test on), it gets the job done.
Upvotes: 2
Reputation: 4919
@Tallboy, unfortunately a simulator is not fit for testing deep links for two reasons:
You're absolutely right -- you can click the link then manually open the app. In this case, we use our "deferred deep linking" mechanisms to determine that link was previously clicked. That method is discussed in our documentation here.
If you have questions about any of this, please ask. You can also reach the Branch team via [email protected].
Upvotes: 2