MAX - iOS

Based on the MAX demo project: https://github.com/AppLovin/AppLovin-MAX-SDK-iOS you can check the Nefta custom adapter integration example here: https://github.com/Nefta-io/NeftaMAXAdapter.

Include the SDK

CocoaPods

To integrate Nefta SDK for MAX Mediation add the following to your Podfile:

  pod 'NeftaMAXAdapter'

Run the following command:

pod install --repo-update

Manually

Or you can integrate it manually: https://docs.nefta.io/update/docs/manual-integration#/


Code integration

The plugin has to be manually initialized, preferably as soon as possible to have good game events:

import NeftaSDK

let plugin = NeftaPlugin.Init(appId: "5661184053215232")
#import "NeftaAdapter.h"

NeftaPlugin *plugin = [NeftaPlugin InitWithAppId: @"5661184053215232"];

In the dashboard you can access the AppId which you need to enter in the code above.

Additional parameters

For additional configuration, for example for configuring external test group, use:

NeftaPlugin.SetExtraParameter(key: NeftaPlugin.ExtParam_TestGroup, value: "split-direct")
[NeftaPlugin SetExtraParameterWithKey: NeftaPlugin.ExtParam_TestGroup value: @"split-direct"];

Events

Game events can be then recorded as follows:

plugin.Events.AddSpendEvent(category: NeftaEvents.ResourceCategory.PremiumCurrency,
                           method: NeftaEvents.SpendMethod.Upgrade)

plugin.Events.AddProgressionEvent(status: NeftaEvents.ProgressionStatus.Start,
                                         type: NeftaEvents.ProgressionType.GameplayUnit,
                                         source: NeftaEvents.ProgressionSource.CoreContent,
                                         name: "area-4",
                                         value: 21)
[plugin.Events AddSpendEventWithCategory: ResourceCategoryPremiumCurrency
                                       method: SpendMethodUpgrade];

[plugin.Events AddProgressionEventWithStatus: ProgressionStatusStart
                                             type: ProgressionTypeGameplayUnit
                                           source: ProgressionSourceCoreContent
                                             name: "area-4"
                                            value: 21];

Mediation Event collection

To maximize earning through Nefta you can opt in for sending additional mediation events like this:

// Make sure to include bridging header file, so that ObjectiveC functions are exposed in swift

// For Banners in your didPayRevenue override of MAAdRevenueDelegate for (Banner) MAAd:
func didPayRevenue(for ad: MAAd) {
    ALNeftaMediationAdapter.onExternalMediationImpression(ad)
        
    SetInfo("didPayRevenue \(ad.adUnitIdentifier) revenue: \(ad.revenue) network: \(ad.networkName)")
}

// For Interstitials in your didDisplay override of MAAdRevenueDelegate for (Interstitial) MAAd:
func didPayRevenue(for ad: MAAd) {
    ALNeftaMediationAdapter.onExternalMediationImpression(ad)
        
    SetInfo("didPayRevenueForAd \(ad.adUnitIdentifier) revenue: \(ad.revenue) network: \(ad.networkName)")
}

// For Rewarded in your didDisplay override of MAAdRevenueDelegate for (Rewarded) MAAd:
func didPayRevenue(for ad: MAAd) {
    ALNeftaMediationAdapter.onExternalMediationImpression(ad)
        
    SetInfo("didPayRevenue \(ad.adUnitIdentifier) revenue: \(ad.revenue) network: \(ad.networkName)")
}
// For Banners in your MAAdRevenueDelegate listener for Banner:
- (void)didPayRevenueForAd:(MAAd *)ad;
  [ALNeftaMediationAdapter OnExternalMediationImpression: ad];
  NSLog("didPayRevenue %@", ad)
}

// For Interstitials in your MAAdRevenueDelegate listener for Interstitial:
- (void)didPayRevenueForAd:(MAAd *)ad {
  [ALNeftaMediationAdapter OnExternalMediationImpression: ad];
  NSLog(@"didPayRevenue %@", ad)
}

// For Rewarded in your MAAdRevenueDelegate listener for Rewarded:
- (void)didPayRevenueForAd:(MAAd *)ad {
  [ALNeftaMediationAdapter OnExternalMediationImpression: ad];
  NSLog(@"didPayRevenue %@", ad)
}

This way we server more suitable inventory for your supply.


Additional features

List of additional features: https://docs.nefta.io/update/docs/advanced-features#/