diff --git a/pushengage-flutter-sdk/.gitignore b/pushengage-flutter-sdk/.gitignore
new file mode 100644
index 0000000..10cd633
--- /dev/null
+++ b/pushengage-flutter-sdk/.gitignore
@@ -0,0 +1,27 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# VS Code
+.vscode/
+
+# Flutter/Dart/Pub related
+# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
+/pubspec.lock
+**/doc/api/
+.dart_tool/
+build/
diff --git a/pushengage-flutter-sdk/.metadata b/pushengage-flutter-sdk/.metadata
new file mode 100644
index 0000000..458e07f
--- /dev/null
+++ b/pushengage-flutter-sdk/.metadata
@@ -0,0 +1,33 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
+ channel: "stable"
+
+project_type: plugin
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ - platform: android
+ create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ - platform: ios
+ create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+ base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/pushengage-flutter-sdk/CHANGELOG.md b/pushengage-flutter-sdk/CHANGELOG.md
new file mode 100644
index 0000000..26ca5d1
--- /dev/null
+++ b/pushengage-flutter-sdk/CHANGELOG.md
@@ -0,0 +1,2 @@
+For detailed version history and comprehensive release notes, visit our GitHub releases page: https://github.com/awesomemotive/pushengage-flutter-sdk/releases
+
diff --git a/pushengage-flutter-sdk/CONTRIBUTING.md b/pushengage-flutter-sdk/CONTRIBUTING.md
new file mode 100644
index 0000000..c3794c9
--- /dev/null
+++ b/pushengage-flutter-sdk/CONTRIBUTING.md
@@ -0,0 +1,28 @@
+
+# Contributing to PushEngage Flutter SDK
+
+We appreciate contributions from the community to improve and maintain the SDK. Please review the following guidelines before submitting issues or pull requests.
+
+## How to Contribute
+
+### Reporting Issues
+If you encounter any issues or bugs:
+1. Search for existing issues to avoid duplicates.
+2. If a similar issue is not found, create a new issue with a detailed description.
+
+### Pull Requests
+1. **Fork the Repository**: Create a fork of the repository on GitHub.
+2. **Create a Branch**: Branch off from `main` for your contribution (e.g., `feature/add-deep-link-support`).
+3. **Commit Changes**: Follow clear, concise commit messages.
+4. **Create a Pull Request**: Open a pull request from your forked branch to the `main` branch of this repository.
+
+### Code Style
+Please ensure your code adheres to Flutter’s style guidelines. This includes:
+- Proper indentation and naming conventions.
+- Comprehensive comments for complex logic.
+
+### Reviewing and Merging
+Pull requests will be reviewed by our maintainers. If revisions are needed, the maintainer will communicate these in the PR comments.
+
+## Thank You!
+We appreciate your effort to improve our SDK!
diff --git a/pushengage-flutter-sdk/LICENSE b/pushengage-flutter-sdk/LICENSE
new file mode 100644
index 0000000..36457bb
--- /dev/null
+++ b/pushengage-flutter-sdk/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 PushEngage
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/pushengage-flutter-sdk/README.md b/pushengage-flutter-sdk/README.md
new file mode 100644
index 0000000..3ad42a1
--- /dev/null
+++ b/pushengage-flutter-sdk/README.md
@@ -0,0 +1,24 @@
+
+
+
+
+# PushEngage Flutter SDK
+
+The PushEngage Flutter SDK simplifies the integration of push notifications into your Flutter apps, supporting both Android and iOS platforms.
+
+## Introduction
+PushEngage SDK enables seamless push notifications for your Flutter applications, enhancing user engagement on Android and iOS.
+
+## Prerequisites
+Before setup, ensure you have:
+- A Flutter project.
+- [PushEngage account](https://www.pushengage.com)
+- Firebase project for Android.
+- Apple Developer account for APN services.
+
+## Getting started guide
+Please follow the instructions as mentioned in the [Getting Started Guide](https://www.pushengage.com/documentation/setting-up-app-push-notification-in-flutter-using-pushengage/)
+
+## Flutter Plugin Public APIs
+Please follow the instructions as mentioned in the [PushEngage Flutter Public APIs](https://pushengage.com/api/mobile-sdk/flutter-sdk)
+
diff --git a/pushengage-flutter-sdk/analysis_options.yaml b/pushengage-flutter-sdk/analysis_options.yaml
new file mode 100644
index 0000000..a5744c1
--- /dev/null
+++ b/pushengage-flutter-sdk/analysis_options.yaml
@@ -0,0 +1,4 @@
+include: package:flutter_lints/flutter.yaml
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/pushengage-flutter-sdk/android/.gitignore b/pushengage-flutter-sdk/android/.gitignore
new file mode 100644
index 0000000..161bdcd
--- /dev/null
+++ b/pushengage-flutter-sdk/android/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.cxx
diff --git a/pushengage-flutter-sdk/android/build.gradle b/pushengage-flutter-sdk/android/build.gradle
new file mode 100644
index 0000000..b3fc9a6
--- /dev/null
+++ b/pushengage-flutter-sdk/android/build.gradle
@@ -0,0 +1,68 @@
+group = "com.pushengage.pushengage_flutter_sdk"
+version = "1.0-SNAPSHOT"
+
+buildscript {
+ ext.kotlin_version = "1.7.10"
+ repositories {
+ google()
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath("com.android.tools.build:gradle:7.3.0")
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+apply plugin: "com.android.library"
+apply plugin: "kotlin-android"
+
+android {
+ if (project.android.hasProperty("namespace")) {
+ namespace = "com.pushengage.pushengage_flutter_sdk"
+ }
+
+ compileSdk = 34
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+
+ sourceSets {
+ main.java.srcDirs += "src/main/kotlin"
+ test.java.srcDirs += "src/test/kotlin"
+ }
+
+ defaultConfig {
+ minSdk = 21
+ }
+
+ dependencies {
+ implementation 'com.github.awesomemotive:pushengage-android-sdk:0.0.5'
+ testImplementation("org.jetbrains.kotlin:kotlin-test")
+ }
+
+ testOptions {
+ unitTests.all {
+ useJUnitPlatform()
+
+ testLogging {
+ events "passed", "skipped", "failed", "standardOut", "standardError"
+ outputs.upToDateWhen {false}
+ showStandardStreams = true
+ }
+ }
+ }
+}
diff --git a/pushengage-flutter-sdk/android/settings.gradle b/pushengage-flutter-sdk/android/settings.gradle
new file mode 100644
index 0000000..df5ffce
--- /dev/null
+++ b/pushengage-flutter-sdk/android/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'pushengage_flutter_sdk'
diff --git a/pushengage-flutter-sdk/android/src/main/AndroidManifest.xml b/pushengage-flutter-sdk/android/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..216f9a5
--- /dev/null
+++ b/pushengage-flutter-sdk/android/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
diff --git a/pushengage-flutter-sdk/android/src/main/kotlin/com/pushengage/pushengage_flutter_sdk/PushengageFlutterSdkPlugin.kt b/pushengage-flutter-sdk/android/src/main/kotlin/com/pushengage/pushengage_flutter_sdk/PushengageFlutterSdkPlugin.kt
new file mode 100644
index 0000000..262c0b6
--- /dev/null
+++ b/pushengage-flutter-sdk/android/src/main/kotlin/com/pushengage/pushengage_flutter_sdk/PushengageFlutterSdkPlugin.kt
@@ -0,0 +1,445 @@
+package com.pushengage.pushengage_flutter_sdk
+
+import android.Manifest
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageManager
+import android.os.Build
+import androidx.core.app.ActivityCompat
+import androidx.core.content.ContextCompat
+import com.pushengage.pushengage.Callbacks.PushEngageResponseCallback
+import com.pushengage.pushengage.PushEngage
+import com.pushengage.pushengage.model.request.AddDynamicSegmentRequest
+import com.pushengage.pushengage.model.request.Goal
+import com.pushengage.pushengage.model.request.TriggerAlert
+import com.pushengage.pushengage.model.request.TriggerCampaign
+import io.flutter.embedding.engine.plugins.FlutterPlugin
+import io.flutter.embedding.engine.plugins.activity.ActivityAware
+import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
+import io.flutter.plugin.common.MethodCall
+import io.flutter.plugin.common.MethodChannel
+import io.flutter.plugin.common.MethodChannel.MethodCallHandler
+import io.flutter.plugin.common.MethodChannel.Result
+import io.flutter.plugin.common.PluginRegistry
+import java.text.SimpleDateFormat
+import java.util.Locale
+import org.json.JSONObject
+
+/** PushEngageFlutterSdkPlugin */
+class PushEngageFlutterSdkPlugin :
+ FlutterPlugin,
+ MethodCallHandler,
+ ActivityAware,
+ PluginRegistry.RequestPermissionsResultListener,
+ PluginRegistry.NewIntentListener {
+
+ private lateinit var channel: MethodChannel
+ private lateinit var context: Context
+ private lateinit var activity: Activity
+ private var permissionResult: Result? = null
+
+ override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
+ channel = MethodChannel(flutterPluginBinding.binaryMessenger, "PushEngage")
+ channel.setMethodCallHandler(this)
+ context = flutterPluginBinding.applicationContext
+ }
+
+ private fun handleIntent(intent: Intent) {
+ val action = intent.action
+ val data = intent.data
+ if (Intent.ACTION_VIEW == action && data != null) {
+ val deepLink = data.toString()
+ val additionalData = intent.extras?.get("data")
+ channel.invokeMethod(
+ "onDeepLink",
+ mapOf("deepLink" to deepLink, "data" to additionalData)
+ )
+ }
+ }
+
+ override fun onMethodCall(call: MethodCall, result: Result) {
+ when (call.method) {
+ "PushEngage#setAppId" -> {
+ PushEngage.Builder()
+ .addContext(context)
+ .setAppId(call.argument("appId").toString())
+ .build()
+
+ result.success(null)
+ }
+ "PushEngage#getSdkVersion" -> {
+ result.success(PushEngage.getSdkVersion())
+ }
+ "PushEngage#getDeviceTokenHash" -> {
+ result.success(PushEngage.getDeviceTokenHash())
+ }
+ "PushEngage#enableLogging" -> {
+ val status = call.argument("status") ?: false
+ PushEngage.enableLogging(status)
+ result.success(null)
+ }
+ "PushEngage#automatedNotification" -> {
+ val status = call.argument("status") ?: true
+ PushEngage.automatedNotification(
+ if (status) PushEngage.TriggerStatusType.enabled
+ else PushEngage.TriggerStatusType.disabled,
+ object : PushEngageResponseCallback {
+ override fun onSuccess(responseObject: Any) {
+ result.success(
+ "Automated notification " +
+ (if (status) "enabled" else "disabled") +
+ " successfully"
+ )
+ }
+
+ override fun onFailure(errorCode: Int, errorMessage: String) {
+ result.error(errorCode.toString(), errorMessage, null)
+ }
+ }
+ )
+ }
+ "PushEngage#sendTriggerEvent" -> {
+ val triggerMap = call.arguments