a) Edit your project's pubspec.yaml file to include the dengage_flutter SDK:
b) Run flutter pub get to install the SDK.
Following extra steps after the installation of the dengage_flutter SDK are required for it to work properly.
#### Requirements
For initial setup, if you have given URL addresses by D·engage Support team, you need to setup url address by using Info.plist file. Otherwise you don’t need to add anything to Info.plist file. Following screenshot for the keys in Info.plist file.

Note: Please see API Endpoints by Datacenter documentation in this section for end points. here is link
In Xcode, select the root project and main app target. In Signing & Capabilities, select All and + Capability. Add "Push Notifications" and Background Modes. Kindly make sure to tick Remote Notifications in Background Modes.


The DengageNotificationServiceExtension allows your application to receive rich notifications with images and/or buttons, and to report analytics about which notifications users receive.
3.1 In Xcode Select File > New > Target
3.2 Select Notification Service Extension then press Next

3.3 Enter the product name as DengageNotificationServiceExtension and press Finish.
Do NOT press "Activate" on the dialog shown after this.

3.4 Press Cancel on the Activate scheme prompt.

By canceling, you are keeping Xcode debugging your app, instead of just the extension. If you activate by accident, you can always switch back to debug your app within Xcode (next to the play button).
3.5 In the Project Navigator, select the top-level project directory and select the DengageNotificationServiceExtension target in the project and targets list. Ensure the Deployment Target is set to iOS 10 for maximum platform compatibility.

3.6 Finish Notification Service Extension Setup
If you did not use Cocoapods, follow these steps.
Note: non-cocoapods steps yet to be determined.
Otherwise, continue with the following setup:
Project Root > iOS > Podfile, add the notification service extension outside the main target (should be at the same level as your main target):Close Xcode. While still in the ios directory, run pod install again.
.xcworkspace file in Xcode. In the DengageNotificationServiceExtension directory > NotificationService.swift file, replace the whole file contents with the code below:Ignore any build errors at this point, we will resolve these later by importing the D·engage library.
Integration Key is genereted by CDMP Platform while defining application. It is a hash string which contains information about application.
At the beginning of your application cycle you must set Integration Key and right after initialize sdk with launch options.
Following sample shows how to do that in your AppDelegate.swift file:
Sample:
In the AppDelegate.swift
To register for remote notifications with device token, add following method and code inside your AppDelegate.swift file:
For iOS, in your Podfile, import the required modules based on your preference:
Google Firebase App Configuration
Android Studio
D·engage Android SDK provides an interface which handles push notification messages easily. Optionally, It also gives to send event functionality such as open and subscription to dEngage Platform.
Supports Android API level 4.1.x or higher.
For detailed steps for firebase SDK setup and it's integeration with D·engage, click here
Huawei Developer Account
Java JDK installation package
Android SDK package
Android Studio 3.X
HMS Core (APK) 4.X or later
Huawei Device or Huawei Cloud Debugging
Supports Android API level 4.4 or higher. (Note that Huawei AdID service requires min target SDK version 19)
D·engage Huawei SDK provides an interface which handles push notification messages that delivered by Huawei Messaging Service (HMS). It is similar to Firebase but has a bit different configuration process that contains [steps mentioned here.](https://dev.dengage.com/mobile-sdk/android/huawei)
First, you need to create DengageManager instance in your main or launcher activity.
After these steps, You will be able to send a push notification message to your app.
You can change subscription api endpoint by adding following metadata tag in YourProject/android/src/main/AndroidManifest.xml
Note: Please see API Endpoints By Datacenter to set your subscription end point.
similar to subscription endpoints, you can change event api endpoints by setting following metadata tag in YourProject/android/src/main/AndroidManifest.xml
Note: Please see API Endpoints By Datacenter to set your event end point.
similar to subscription endpoints, you can change geofence api endpoints by setting following metadata tag in YourProject/android/src/main/AndroidManifest.xml
To use geofence and Huawei version, you can configure them in the gradle.properties file by adding the following:
You can modify these values based on your preference.
D·engage Mobile SDK for Android supports version 4.4 (API Level 19) and later.
D·engage Mobile SDK for Huawei supports all new versions.
**Subscription is a process which is triggered by sending subscription event to D·engage. It contains necessary informations about application to send push notifications to clients.**
Subscriptions are self managed by D·engage SDK and subcription cycle starts with Prompting user permission. SDK will automaticlly send subscription events under following circumstances:
Note: Android doesn't require to ask for push notifications explicitly. Therefore, you can only ask for push notification's permissions on iOS.
IOS uses shared UNUserNotificationCenter by itself while asking user to send notification. D·engage SDK manager uses UNUserNotificationCenter to ask permission as well. [Apple Doc Reference](https://developer.apple.com/documentation/usernotifications/asking_permission_to_use_notifications)
If in your application, you want to get UserNotification permissions explicitly, you can do by calling one of the following methods:
OR
Contact Key represents user id in your system. There are two types of devices. Anonymous Devices and Contact Devices. Contact Devices contains Contact Key.
To track devices by their contacts you need to set contact key on SDK.
Note: It is recommended to call this method, if you have user information. You should call in every app open and on login, logout pages.
If you need to get current token or if you are managing token subscription process manually, you can use setToken and getToken functions.
If you manage your own user permission states on your application you may send user permission by using setUserPermission method.
SDK can provide logs for debuging. It displays queries and payloads which are sent to REST API’s.
To validate your inputs you can enable SDK’s log by a method.
SDK provides a listener if you want to get and parse payload manually, whenever a push notification is clicked.
SDK supports URL schema deeplink. If target url has a valid link, it will redirect to the related link.
Please see related links below about deeplinking.
Create a deep link for a destination
[Create Deep Links to App Content](https://developer.android.com/training/app-links/deep-linking)
Rich Notifications is a notification type which supports image, gif, video content. D·engage SDK supports varieties of contents and handles notification.
Rich Notifications supports following media types:
For further details about rich notification and its setup on iOS side please follow [this link](https://dev.dengage.com/mobile-sdk/ios/richnotification)
Note: on Android there is no special setup required for rich notifications.
Carousel Push is a notification type which has a different UI than Rich Notification. SDK will handle notification payload and displays UI if it’s a carousel push. Carousel Push functionality allows you to show your notification with a slideshow.
### Requirements
iOS 10 or higher
to setup Carousel Push on iOS you can follow [this link](https://dev.dengage.com/mobile-sdk/ios/carousel-push)
### Requirements
Android SDK 2.0.0+
to setup Carousel Push on android you can follow [this link](https://dev.dengage.com/mobile-sdk/android/carousel-push)
Android SDK allows you to put clickable buttons under the notification. Action buttons are supported in Android SDK 2.0.0+.
For further setup of Action Buttons, follow [this link](https://dev.dengage.com/mobile-sdk/android/action-buttons) .
You can sync adjust adid with dengage through the following method
In order to collect android mobile events and use that data to create behavioral segments in D·engage you have to determine the type of events and data that needs to collected. Once you have determined that, you will need to create a “Big Data” table in D·engage. Collected events will be stored in this table. Multiple tables can be defined depending on your specific need.
Any type of event can be collected. The content and the structure of the events are completely flexible and can be changed according to unique business requirements. You will just need to define a table for events.
Once defined, all you have to do is to send the event data to these tables. D·engage SDK has only two functions for sending events: sendDeviceEvent and sendCustomEvent. Most of the time you will just need the sendDeviceEvent function.
If the user loggs in or you have user information, this means you have contact_key for that user. You can set contact_key in order to match user with the browser. There are two functions for getting and setting contact_key.
If user logged in set user id. This is important for identifying your users. You can put this function call in every page. It will not send unnecessary events.
[code example is here](#setting-contact-key)
to get the current user information from SDK getContactKey method can be used.
If your D·engage account is an ecommerce account, you should use standard ecommerce events in the SDK. If you need some custom events or your account is not standard ecommerce account, you should use custom event functions.
There are standard ecommerce events in D·engage SDK.
[Page View Events](#page-view-events-details)
[Shopping Cart Events](#shopping-cart-events)
[Order Events](#order-events)
[Wishlist Events](#wishlist-events)
[Search Event](#search-event)
For these event there are related tables in your account. Following are the details and sample codes for each of above events.
Page View Events
Page view events will be sent to page_view_events table. If you add new columns to this table. You can send these in the event data.
These events will be stored in shopping_cart_events and shopping_cart_events_detail. There are 4 shopping cart event functions. addToCart, removeFromCart, viewCart, beginCheckout
Orders events will be sent to order_events and order_events_detail tables.
These events will be stored in wishlist_events and wishlist_events_detail.
There are 2 wishlist event functions. addToWishlist, removeFromWishlist
Search events will be stored in search_events table.
You can use sendDeviceEvent function for sending events for the device. Events are sent to a big data table defined in your D·engage account. That table must have relation to the master_device table. If you set contact_key for that device. Collected events will be associated for that user.
App Inbox is a screen within a mobile app that stores persistent messages. It’s kind of like an email inbox, but it lives inside the app itself. App Inbox differs from other mobile channels such as push notifications or in-app messages. For both push and in-app messages, they’re gone once you open them.
In other words, D·engage admin panel lets you keep selected messages on the platform and Mobile SDK may retreive and display these messages when needed.
In order to save messages into App Inbox, you need to select “Save to Inbox” option when sending messages in D·engage admin panel by assigning an expire date to it.
Inbox messages are kept in the memory storage of the phone until app is completely closed or for a while and D·engage SDK provides functions for getting and managing these messages.
There are 3 methods to manage App Inbox Messages
To get app inbox messages from the server
To delete a specific message from the inbox.
to mark a specific message as clicked.
In-app message is a type of mobile message where the notification is displayed within the app. It is not sent in a specific time but it is show to user when user are using the app. Examples include popups, yes/no prompts, banners, and more. In order to show in-app messages, there is no permission requirement.
Created messages will be stored in D·engage backend and will be served to mobile SDKs. If you integrated mobile SDK correctly for push messages, for using in-app features you just have to add setNavigtion function to every page navigation.
If you want to use screen name filter, you should send screen name to setNavigation function in every page navigation.
You can use the real time in-app functionality by using the function.