Before going forward with the implementation, you should create a web placement and a web offerwall adslot in your publisher account at ayetstudios.com.
Notice in order to integrate ayeT-Studios offerwall into your app you dont need this package you could use webView directly, or any other aproach, package is just there to make it easier for you.
For now you would need to download package into your project and use local dependency
dependencies:
flutter:
sdk: flutter
ayetstudios_flutter_sdk:
path: ./ayetstudios_flutter_sdkNote: The ./ayetstudios_flutter_sdk above means that the ayetstudios_flutter_sdk directory containing the pubspec.yaml for the package is a sub-directory of the app.
If you place the package as a directory at the same level as the app, in other words one level higher up in the directory tree, you can use ../ayetstudios_flutter_sdk (note the double dot) or a full path to the package directory.
import 'package:ayetstudios_flutter_sdk/ayetstudios_flutter_sdk.dart';When calling the AyetOfferwall class, a externalIdentifier and an adslotId has to be passed.
The externalIdentifier should be a unique, persistent identifier (alphanumeric) for the user. An example might be a unique user id or the hashed email address of the user.
adslotId is the id of the web_offerwall adslot created in your publisher dashboard at ayetstudios.com.
AyetOfferwall(
adslotId: 458,
externalIdentifier: 'your-user-id-123',
onClose:(){
//The `onClose` callback function should be implemented according to your requirements.
//A common practice is to navigate back to screen from which offerwall was called when `onClose` callback is triggered.
}
)If you target Android, add the following snippet to your AndroidManifest.xml.
<uses-permission android:name="android.permission.INTERNET"/>
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"/>
</intent>
</queries>
