# AppNexus (Xandr)

If you would like to auto-close an AppNexus interstitial ad after a specific timeout period:

* Create an instance of [AATAdNetworksOptions](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatadnetworksoptions) including your [AATAppNexusOptions](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatappnexusoptions).
* Provide this instance to the [AATConfiguration](https://ios-sdk.aatkit.com/references/documentation/aatkit/aatconfiguration) while initialising AATKit.
* AATKit will automatically forward the specified options the AppNexus (Xandr) SDK while displaying the interstitial ad.

{% tabs %}
{% tab title="Swift" %}
```swift
let conf = AATConfiguration()
...
let appNexusOptions = AATAppNexusOptions(autoCloseTime: <AUTO_CLOSE_TIME>, supportNativeBanner: <SUPPORT_NATIVE_BANNER>)
conf.adNetworksOptions = AATAdNetworksOptions(appNexusOptions: appNexusOptions)
...
AATSDK.initAATKit(with: conf)
```
{% endtab %}

{% tab title="Objective-C" %}
```objectivec
AATConfiguration *conf = [[AATConfiguration alloc] init];
...
AATAppNexusOptions *appNexusOptions = [[AATAppNexusOptions alloc] initWithAutoCloseTime:<AUTO_CLOSE_TIME> supportNativeBanner:<SUPPORT_NATIVE_BANNER>];
conf.adNetworksOptions = [[AATAdNetworksOptions alloc] [[AATAdNetworksOptions alloc] initWithAppNexusOptions:appNexusOptions
                                                                                                feedAdOptions:nil
                                                                                                 adMobOptions:nil
                                                                                                   dfpOptions:nil
                                                                                              datonomyOptions:nil
                                                                                          superAwesomeOptions:nil
                                                                                            graviteRTBOptions:nil
                                                                                             displayIOOptions:nil
                                                                                           metaBiddingOptions:nil];
...
[AATSDK initAATKitWith:conf];
```
{% endtab %}
{% endtabs %}
