deepLink
Open a deep link URL in the mobile app based on the url and the app's package name (Android) or bundle ID (iOS).
Usage
browser.deepLink(link, appIdentifier)
Parameters
Name | Type | Details |
---|---|---|
link | string | The deep link URL that should be opened in the mobile app. It should be a valid deep link URL (e.g. myapp://path ). If it's a universal deep link, which can be used for iOS, use the browser.url("your-url") -method. |
appIdentifier | string | The value of the packageName (Android) or bundleId (iOS) of the app that the deep link should open. |
Example
deeplink.js
it('should open a deep link for the WDIO native demo app', async () => {
// open the Drag tab with a deep link (this the bundleId for the iOS Demo App)
await browser.deepLink('wdio://drag', 'org.reactjs.native.example.wdiodemoapp');
// Or open the Drag tab with a deep link (this the packageName for the Android Demo App)
await browser.deepLink('wdio://drag', 'com.wdiodemoapp');
// Or if you want to have it "cross-platform" you can use it like this
await browser.deepLink('wdio://drag', browser.isIOS ? 'org.reactjs.native.example.wdiodemoapp' : 'com.wdiodemoapp');
})