-
This package gives' wrapper methods for deepwall sdks. iOS - Android
-
Before implementing this package, you need to have api_key and list of actions.
-
You can get api_key and actions from DeepWall Dashboard
Version | Status |
---|---|
1.x | Non null safety |
2.x | Null safety |
Add below code into your pubspec.yaml
file under dependencies
section.
deepwall_flutter_plugin:
git:
url: https://github.com/Teknasyon-Teknoloji/deepwall-flutter-sdk.git
ref: 3.0.1
And run $ flutter pub get
-
IOS
- Set minimum ios version 10.0 or higher in
ios/Podfile
like:platform :ios, '10.0'
- Add
use_frameworks!
intoios/Podfile
if not exists. - Run
$ cd ios && pod install
- Set minimum ios version 10.0 or higher in
-
ANDROID
- Set kotlin_version "1.4.32" or higher in
android/build.gradle
- Set
minSdkVersion
to 21 or higher inandroid/app/build.gradle
- Add code below into
android/build.gradle
(Add into repositories under allprojects)
- Set kotlin_version "1.4.32" or higher in
maven { url 'https://raw.githubusercontent.com/Teknasyon-Teknoloji/deepwall-android-sdk/master/' }
maven { url 'https://developer.huawei.com/repo/' }
- On application start you need to initialize sdk with api key and environment.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
import 'package:deepwall_flutter_plugin/enums/environments.dart';
DeepwallFlutterPlugin.initialize('{API_KEY}', Environment.PRODUCTION.value);
- Before requesting any paywall you need to set UserProperties (device uuid, country, language). See all parameters
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.setUserProperties('UNIQUE_DEVICE_ID_HERE (UUID)', 'en-us', 'us');
- After setting userProperties, you are ready for requesting paywall with an action key. You can find action key in DeepWall dashboard.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.requestPaywall('{ACTION_KEY}', null);
// You can send extra parameter if needed as below
Map<String, Object> extraData = new HashMap();
extraData['sliderIndex'] = 2;
extraData['title'] = 'Deepwall';
DeepwallFlutterPlugin.requestPaywall('{ACTION_KEY}', extraData);
- You can also close paywall.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.closePaywall();
- When any of userProperties is changed, you need to call updateUserProperties method. (For example if user changed application language)
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.updateUserProperties('fr-fr','fr');
- You can validate receipts like below.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
import 'package:deepwall_flutter_plugin/enums/validate_receipt_types.dart';
DeepwallFlutterPlugin.validateReceipt(ReceiptValidationType.RESTORE.value);
- There is also bunch of events triggering before and after DeepWall Actions. You may listen any event like below.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
StreamSubscription subscribeToStream =
DeepwallFlutterPlugin.eventBus.on<DeepwallFlutterEvent>().listen((event) {
// // access event.data
});
- Adding and removing event listener example
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
StreamSubscription subscribeToStream =
DeepwallFlutterPlugin.eventBus.on<DeepwallFlutterEvent>().listen((event) {
// // access event.data
});
subscribeToStream.cancel();
- Requesting ATT Prompts
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.requestAppTracking('{ACTION_KEY}', null);
// You can send extra parameter if needed as below
Map<String, Object> extraData = new HashMap();
extraData['appName'] = 'My awesome app';
DeepwallFlutterPlugin.requestAppTracking('{ACTION_KEY}', extraData);
- Sending extra data to paywall while it's open.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
Map<String, Object> extraData = new HashMap();
extraData['appName'] = 'My awesome app';
DeepwallFlutterPlugin.sendExtraDataToPaywall('{ACTION_KEY}', extraData);
- You can set orientation when calling requestPaywall method.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
import 'package:deepwall_flutter_plugin/enums/device_orientations.dart';
DeepwallFlutterPlugin.requestPaywall('{ACTION_KEY}', null, orientation: DeviceOrientations.PORTRAIT.value);
- For consumable products, you need to mark the purchase as consumed for consumable product to be purchased again.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.consumeProduct('consumable_product_id');
- Use
setProductUpgradePolicy
method to set the product upgrade policy for Google Play apps.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.setProductUpgradePolicy(
ProrationMode.IMMEDIATE_WITHOUT_PRORATION.value,
Policy.ENABLE_ALL_POLICIES.value
);
- Use
updateProductUpgradePolicy
method to update the product upgrade policy within the app workflow before requesting paywalls.
import 'package:deepwall_flutter_plugin/deepwall_flutter_plugin.dart';
DeepwallFlutterPlugin.updateProductUpgradePolicy(
ProrationMode.IMMEDIATE_WITHOUT_PRORATION.value,
Policy.ENABLE_ALL_POLICIES.value
);
- You may found complete list of events in lib/enums/events.dart or Native Sdk Page
- UserProperties are:
- uuid
- country
- language
- environmentStyle
- debugAdvertiseAttributions
- phoneNumber
- emailAddress
- firstName
- lastName