Skip to content

Commit

Permalink
feat(docs): Remove accordions iOS deep linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff committed Oct 26, 2023
1 parent 887993f commit c62c8d9
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ You need to retrieve the following data points before you can set up deep links

Follow these instructions to retrieve your data points.

<Accordion>

### App ID Prefix and Release Bundle ID

Your App ID is found on the Apple Developer portal. It contains two parts:
Expand All @@ -37,10 +35,6 @@ To find your App ID Prefix and Bundle ID, follow these steps:
4. Find your app and select it to open the edit page.
5. Your App ID Prefix and Bundle ID are displayed at the top of the page. Copy the relevant information and store it somewhere for later use.

</Accordion>

<Accordion>

### Debug Bundle ID

If you're using a different bundle ID for your debug build, you can find its ID in Xcode.
Expand All @@ -52,11 +46,7 @@ If you're using a different bundle ID for your debug build, you can find its ID
5. Select <GuiLabel>Debug</GuiLabel> from the sub menu that appears.
6. Your Bundle ID is shown. Copy this information and store it somewhere for later use.

</Accordion>

<Accordion>

### Release Custom URL Scheme and Debug Custom URL Scheme
### Custom URL schemes

<Callout type="tip">

Expand All @@ -81,18 +71,14 @@ If your iOS app doesn't have a custom URL scheme yet, follow these steps to set
3. Select your app under <GuiLabel>Targets</GuiLabel>.
4. Select <GuiLabel>Info</GuiLabel> from the top menu.
5. Expand the <GuiLabel>URL Types</GuiLabel> section.
6. Select the Add option (<GuiLabel>+</GuiLabel>) to add a new URL type.
6. Select the Add option (<Icon name="Plus" />) to add a new URL type.
7. Fill in the following information to create a URL scheme:
* <GuiLabel>Identifier</GuiLabel>: `$(PRODUCT_BUNDLE_IDENTIFIER)`
* <GuiLabel>URL Schemes</GuiLabel>: your custom URL scheme. This must be unique. Don't use protected schemes such as `http`, `https`, or `mailto`
* <GuiLabel>Role</GuiLabel>: Editor

This scheme will work for your production **and** debug builds.

</Accordion>

<Accordion>

### Link Resolution domains

<Callout type="tip">
Expand All @@ -102,5 +88,3 @@ A link resolution domain is required for deep linking via email, SMS, QR codes,
</Callout>

Your marketing team may already be using a link resolution domain for their email marketing platform. Get this domain from them and store it somewhere for later use.

</Accordion>
139 changes: 70 additions & 69 deletions src/content/docs/en/sdk/ios/configuration/deep-links/deferred.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sidebar-position: 4
---

import SetLinkMeEnabled from "@ios-examples/ADJConfig/setLinkMeEnabled.mdx"
import SetLinkMeEnabledSig from "@ios-signatures/ADJConfig/setLinkMeEnabled.mdx"

A deferred deep link sends a user to a place in your app after routing them via the App Store to install the app first.

Expand Down Expand Up @@ -43,102 +44,102 @@ There are 2 approaches to set up deferred deep linking in your app:

1. Set up a delegate callback for deferred deep linking. If you have already configured attribution callbacks, you can skip this step.

<Tabs>
<Tab sync="swift">

### Swift
<Tabs>
<Tab sync="swift">

```swift title="AppDelegate.swift"
class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate {
}
```
### Swift

</Tab>
<Tab sync="objc">
```swift title="AppDelegate.swift"
class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate {
}
```

### Objective-C
</Tab>
<Tab sync="objc">

```objective-c title="AppDelegate.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, AdjustDelegate>
```
### Objective-C

</Tab>
</Tabs>
```objective-c title="AppDelegate.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, AdjustDelegate>
```
</Tab>
</Tabs>
2. If you haven’t already done so, create an instance of the `ADJConfig` class and set a delegate on the `ADJConfig` object in your app delegate. You need to set the delegate in `ADJConfig` before initializing the SDK.
<Tabs>
<Tab sync="swift">
### Swift
<Tabs>
<Tab sync="swift">
### Swift
```swift
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
adjustConfig?.delegate = self
```swift
let yourAppToken = "{YourAppToken}"
let environment = ADJEnvironmentSandbox as? String
let adjustConfig = ADJConfig(
appToken: yourAppToken,
environment: environment)
adjustConfig?.delegate = self
// ...
// ...
Adjust.appDidLaunch(adjustConfig)
```
Adjust.appDidLaunch(adjustConfig)
```

</Tab>
<Tab sync="objc">
</Tab>
<Tab sync="objc">

### Objective-C
### Objective-C

```objective-c
*adjustConfig = [ADJConfig configWithAppToken:@"{YourAppToken}"
environment:ADJEnvironmentSandbox];
[adjustConfig setDelegate:self];
```objective-c
*adjustConfig = [ADJConfig configWithAppToken:@"{YourAppToken}"
environment:ADJEnvironmentSandbox];
[adjustConfig setDelegate:self];

// ...
// ...

[Adjust appDidLaunch:adjustConfig];
```
[Adjust appDidLaunch:adjustConfig];
```
</Tab>
</Tabs>
</Tab>
</Tabs>
3. Add the `adjustDeeplinkResponse` deferred deep link callback method to the delegate. The Adjust SDK calls this method after receiving a deferred deep link.
1. Set your deep link handling code.
2. Set the return value of the `adjustDeeplinkResponse` method to true or false. This indicates whether you want the Adjust SDK to call the `open(_:options:completionHandler:)` method to open the deep link after your deep link handling code runs.
<Tabs>
<Tab sync="swift">
### Swift
<Tabs>
<Tab sync="swift">
```swift
func adjustDeeplinkResponse(_ deeplink: URL?) -> Bool {
// add your code below to handle deep link
// (for example, show onboarding screens, then open deep link content)
// deeplink object contains the deep link
### Swift
return false
}
```
```swift
func adjustDeeplinkResponse(_ deeplink: URL?) -> Bool {
// add your code below to handle deep link
// (for example, show onboarding screens, then open deep link content)
// deeplink object contains the deep link
</Tab>
<Tab sync="objc">
return false
}
```

### Objective-C
</Tab>
<Tab sync="objc">

```objective-c
- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink {
// add your code below to handle deep link
// (for example, show onboarding screens, then open deep link content)
// deeplink object contains the deep link

return NO;
}
```
### Objective-C

```objective-c
- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink {
// add your code below to handle deep link
// (for example, show onboarding screens, then open deep link content)
// deeplink object contains the deep link

return NO;
}
```

</Tab>
</Tabs>
</Tab>
</Tabs>

## Set up Adjust LinkMe

Expand All @@ -158,6 +159,6 @@ The Adjust SDK checks the pasteboard when a user opens the app for the first tim

When a user clicks on a LinkMe URL they have the option to copy the link information to their system pasteboard. You can use the Adjust SDK to read the system pasteboard for deep link information. If deep link information is present, the Adjust SDK forwards the user to the correct page in your app.

To enable pasteboard checking in your app, pass a **true** value to the `setLinkMeEnabled` method on your `ADJConfig` object:
To enable pasteboard checking in your app, pass a **true** value to the <Tooltip>`setLinkMeEnabled` method || <SetLinkMeEnabledSig /></Tooltip> on your `ADJConfig` object:

<SetLinkMeEnabled />
16 changes: 0 additions & 16 deletions src/content/docs/en/sdk/ios/configuration/deep-links/direct.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ To get started, you need to enable Associated Domains in your Apple Developer ac

Follow these steps to add your deep link configuration to your Xcode project.

<Accordion>

### Adjust universal links domain

1. Open your app project in Xcode.
Expand All @@ -41,10 +39,6 @@ Follow these steps to add your deep link configuration to your Xcode project.
8. Enter the Adjust Universal Link domain with the prefix `applinks:`
- Here is an example using the `example.adj.st` domain: `applinks:example.adj.st`.

</Accordion>

<Accordion>

### Custom URL scheme

<Callout type="tip">
Expand All @@ -67,14 +61,10 @@ Check with your marketing team to see if a custom URL scheme is needed for the a

This scheme will work for your production **and** debug builds.

</Accordion>

## Modify your iOS app

You need to update your iOS app to set up different deep linking scenarios. How you update your app depends on whether your app uses [scenes](https://developer.apple.com/documentation/uikit/app_and_environment/scenes).

<Accordion>

### App doesn't use scenes

If your app doesn't uses scenes, you need to update methods in your app delegate.
Expand Down Expand Up @@ -220,10 +210,6 @@ func application(
</Tab>
</Tabs>

</Accordion>

<Accordion>

### App uses scenes

If your app uses scenes, you need to update methods in your scene delegate.
Expand Down Expand Up @@ -412,5 +398,3 @@ func scene(
</Tab>
</Tabs>
</Accordion>
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ To use link resolution, your email partner needs to let you to set up the redire
- Iterable: Iterable provides the URL redirection service that supports custom domains.
- Mailchimp: Link resolution isn't available because Mailchimp doesn't allow you to configure their redirect domain as a universal link.

<Accordion>

### Example
#### Example

1. The email marketer builds their email using a template. This template contains a link or an image with a universal link.

Expand All @@ -130,8 +128,6 @@ To use link resolution, your email partner needs to let you to set up the redire
8. Your app handles the returned URL. In this case, your app would display the `summer-clothes` page in your app with a `beach promo` modal to the user.
9. Your app calls the <Tooltip>`appWillOpenUrl` method || <AppWillOpenUrl /></Tooltip> in the Adjust SDK with the returned URL.

</Accordion>

### URL shorteners

When marketers run certain types of campaigns, sometimes a short URL is required. For example, SMS has a 160 character limit. Sometimes, customers want to shorten a link and share it on team communication platforms, such as Slack. However, if the short URL redirects to a universal link, iOS doesn't resolve the universal link.
Expand All @@ -154,9 +150,7 @@ When marketers run certain types of campaigns, sometimes a short URL is required
6. Configure your URL shortener domain as a custom domain on the URL shortener service. You need to configure the DNS for your URL shortener domain to point to the URL shortener service’s servers. ([Reference documentation to add a custom domain in short.io](https://help.short.io/en/articles/4065811-how-can-i-add-a-domain)).
7. Configure universal links on the URL shortener service. ([Reference documentation to configure universal links in short.io](https://help.short.io/en/articles/4065870-how-to-set-up-deep-links-for-ios)).

<Accordion>

### Example
#### Example

1. The marketer creates a universal link.

Expand All @@ -177,5 +171,3 @@ When marketers run certain types of campaigns, sometimes a short URL is required
8. The link resolution method returns the resolved URL.
9. Your app handles the returned URL. In this case, your app would display the `summer-clothes` page in your app with a `beach promo` modal to the user.
10. Your app calls the <Tooltip>`appWillOpenUrl` method || <AppWillOpenUrl /></Tooltip> in the Adjust SDK with the returned URL.

</Accordion>
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ To check your universal link domain configuration, follow these steps.

If this option doesn't appear, check the following issues.

<Accordion>

### Adjust universal links

* Check your marketing team has enabled Adjust universal links in the Adjust dashboard.
Expand All @@ -79,10 +77,6 @@ If this option doesn't appear, check the following issues.
* <GuiLabel>Bundle ID</GuiLabel>: Verify whether you are using the bundle ID of the debug build or release build.
* <GuiLabel>Universal link domain</GuiLabel>: Verify whether you are using the universal link domain of the debug build or release build. The universal link domain in the app needs to match with the branded link in the Adjust dashboard.

</Accordion>

<Accordion>

### Email redirect and URL shortener universal links

* Check the Associated Domains configuration in Xcode.
Expand All @@ -93,8 +87,6 @@ If this option doesn't appear, check the following issues.
* <GuiLabel>Bundle ID</GuiLabel>: Verify whether you are using the bundle ID of the debug build or release build.
* Email redirect domain / URL shortener domain - Verify whether you have configured the domain as a custom domain in the email partner's system.

</Accordion>

### Test direct deep linking in the app

You should test direct deep linking both when your app is closed and again when its running in the background on the test device.
Expand Down

0 comments on commit c62c8d9

Please sign in to comment.