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
You can download the latest Nefta adapter from https://github.com/Nefta-io/NeftaMAXAdapter/releases.
Extract the content of the zip file to your project.
Given that your project name is AppLovin MAX Demo App - Swift it could look like this:
In your project settings add NeftaSDK.xcframework to Frameworks, Libraries, and Embedded Content for the project target:
In the opened popup click on Add Other... and select NeftaSDK.xcframework in the extracted location from the previous step. After this, the NeftaSDK should be included like this:
The last step is to include the adapter source code. We can do this by right-clicking on the project and selecting Add Files to "YourProject"...:
Select NeftaAMAdapter from the extracted folder and make sure to add this folder with Create groups and not Create folder references and that the files will be added as targets to your project:
Make sure to check the requires full screen permission for best experience (during orientation switches on iPads and such):
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.
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];
Testing
To put the adapter in test mode and enable logs:
NeftaPlugin.EnableLogging(enable: true)
[NeftaPlugin EnableLogging: true];
With this, you will see the following lines in the debug console:
2024-04-04 07:12:53.317 1 [NeftaPlugin] Core initialized 9ea84634-02b6-40ba-92d1-4498997bab66 n:20 s:6
2024-04-04 07:12:53.402 1 [NeftaPlugin] OnResume 1711444731265 1712207573402 762842137
With this, we know that the SDK is integrated correctly.
To receive test ads you have to add your user to Test users on our platform:
You get the NUID in Core initialized debug output from before, or with the following code:
let nuid = plugin.ShowNuid()
NSString *nuid = [plugin ShowNuid];
With this, you will start receiving Nefta ads.
All done
With this technical part, make sure you have Nefta mediation enabled in your AdMob configuration.
Checking version
To check the Nefta custom adapter version in the project you can check the included ALNeftaMediationAdapter.m file:
To check the Nefta SDK version you can check the version in the included xcframework (this is the version that is displayed in the logs):
Updated 10 days ago