├── .editorconfig ├── .github ├── logo.png ├── pull_request_template.md ├── scripts │ ├── dry-run.sh │ ├── ktlint-verify.sh │ ├── release.main.kts │ └── verify-format.sh └── workflows │ ├── release-plugins.yml │ └── verify-pull-request.yml ├── .gitignore ├── .woodpecker.yml ├── README.md ├── RELEASING.md ├── analysis_options.yaml ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .project │ ├── app │ │ ├── .classpath │ │ ├── .project │ │ ├── .settings │ │ │ └── org.eclipse.buildship.core.prefs │ │ ├── build.gradle │ │ ├── google-services.json │ │ ├── keystore.properties │ │ ├── moengage123.jks │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── moengage │ │ │ │ │ └── sampleapp │ │ │ │ │ ├── CustomPushListener.kt │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ └── SampleApplication.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── icon.png │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ ├── appLibs.versions.toml │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── Flutter │ │ ├── .last_build_id │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── NotificationServices │ │ ├── Info.plist │ │ ├── NotificationService.swift │ │ └── NotificationServices.entitlements │ ├── Podfile │ ├── PushTemplates │ │ ├── Base.lproj │ │ │ └── MainInterface.storyboard │ │ ├── Info.plist │ │ ├── NotificationViewController.swift │ │ └── PushTemplates.entitlements │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── PushTemplates.xcscheme │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── Runner-Bridging-Header.h │ │ └── Runner.entitlements ├── lib │ ├── cards │ │ ├── card_widget.dart │ │ ├── cards_helper.dart │ │ ├── cards_home.dart │ │ ├── cards_screen.dart │ │ └── utils.dart │ ├── constants.dart │ ├── inapp.dart │ ├── main.dart │ ├── second_page.dart │ └── utils.dart ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ ├── manifest.json │ └── serviceworker.js ├── melos.yaml ├── packages ├── moengage_cards │ ├── .gitignore │ ├── moengage_cards │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── example │ │ │ └── README.md │ │ ├── lib │ │ │ ├── moengage_cards.dart │ │ │ └── src │ │ │ │ └── moengage_cards.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_cards_test.dart │ ├── moengage_cards_android │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── moengage │ │ │ │ │ └── flutter │ │ │ │ │ └── cards │ │ │ │ │ ├── Constants.kt │ │ │ │ │ ├── EventEmitterImpl.kt │ │ │ │ │ ├── MoEngageCardsPlugin.kt │ │ │ │ │ └── PlatformMethodCallHandler.kt │ │ │ └── user-agent.gradle │ │ ├── lib │ │ │ └── moengage_cards_android.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_cards_android_test.dart │ ├── moengage_cards_ios │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── ios │ │ │ ├── .gitignore │ │ │ ├── Assets │ │ │ │ └── .gitkeep │ │ │ ├── Classes │ │ │ │ ├── MoEngageCardSyncListner.swift │ │ │ │ ├── MoEngageCardsPlugin.swift │ │ │ │ ├── MoEngageCardsUtil.swift │ │ │ │ └── MoEngageFlutterCardsConstants.swift │ │ │ └── moengage_cards_ios.podspec │ │ ├── lib │ │ │ └── moengage_cards_ios.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_cards_ios_test.dart │ └── moengage_cards_platform_interface │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ ├── moengage_cards_platform_interface.dart │ │ └── src │ │ │ ├── internal │ │ │ ├── callback_cache.dart │ │ │ ├── cards_controller.dart │ │ │ ├── cards_instance_provider.dart │ │ │ ├── cards_platform.dart │ │ │ ├── constants.dart │ │ │ ├── method_channel_moengage_cards.dart │ │ │ └── payload_mapper.dart │ │ │ └── model │ │ │ ├── action │ │ │ ├── action.dart │ │ │ └── navigation_action.dart │ │ │ ├── campaign_state.dart │ │ │ ├── card.dart │ │ │ ├── cards_data.dart │ │ │ ├── cards_info.dart │ │ │ ├── container.dart │ │ │ ├── display_control.dart │ │ │ ├── enums │ │ │ ├── action_type.dart │ │ │ ├── template_type.dart │ │ │ └── widget_type.dart │ │ │ ├── meta_data.dart │ │ │ ├── model.dart │ │ │ ├── navigation_type.dart │ │ │ ├── show_time.dart │ │ │ ├── style │ │ │ ├── button_style.dart │ │ │ ├── container_style.dart │ │ │ ├── image_style.dart │ │ │ ├── text_style.dart │ │ │ └── widget_style.dart │ │ │ ├── sync_data.dart │ │ │ ├── sync_type.dart │ │ │ ├── template.dart │ │ │ └── widget.dart │ │ ├── pubspec.yaml │ │ └── test │ │ ├── cards_comparator.dart │ │ ├── cards_mock_platform.dart │ │ ├── cards_platform_interface_test.dart │ │ ├── data_provider │ │ ├── data_model_provider.dart │ │ └── data_provider.dart │ │ └── parser_test.dart ├── moengage_flutter │ ├── .gitignore │ ├── moengage_flutter │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── config.json │ │ ├── example │ │ │ └── README.md │ │ ├── lib │ │ │ ├── moengage_flutter.dart │ │ │ └── src │ │ │ │ └── moengage_flutter.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ ├── data_provider │ │ │ └── data_provider.dart │ │ │ ├── mock_platform.dart │ │ │ └── moengage_flutter_test.dart │ ├── moengage_flutter_android │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── moengage │ │ │ │ │ └── flutter │ │ │ │ │ ├── Constants.kt │ │ │ │ │ ├── EventEmitterImpl.kt │ │ │ │ │ ├── GlobalCache.kt │ │ │ │ │ ├── MoEFlutterHelper.kt │ │ │ │ │ ├── MoEInitializer.kt │ │ │ │ │ └── MoEngageFlutterPlugin.kt │ │ │ └── user-agent.gradle │ │ ├── lib │ │ │ ├── moengage_flutter_android.dart │ │ │ └── src │ │ │ │ └── internal │ │ │ │ └── utils │ │ │ │ └── payload_mapper.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ ├── comparator.dart │ │ │ ├── dataprovider │ │ │ ├── data_provider.dart │ │ │ └── json_data.dart │ │ │ └── parser_test.dart │ ├── moengage_flutter_ios │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── ios │ │ │ ├── .gitignore │ │ │ ├── Assets │ │ │ │ └── .gitkeep │ │ │ ├── Classes │ │ │ │ ├── MoEngageFlutterBridge.swift │ │ │ │ ├── MoEngageFlutterConstants.swift │ │ │ │ ├── MoEngageFlutterPlugin.h │ │ │ │ ├── MoEngageFlutterPlugin.m │ │ │ │ ├── MoEngageFlutterPluginInfo.swift │ │ │ │ ├── MoEngageFlutterUtil.swift │ │ │ │ └── MoEngageInitializer.swift │ │ │ └── moengage_flutter_ios.podspec │ │ ├── lib │ │ │ └── moengage_flutter_ios.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_flutter_ios_test.dart │ ├── moengage_flutter_platform_interface │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ │ ├── moengage_flutter_platform_interface.dart │ │ │ └── src │ │ │ │ ├── internal │ │ │ │ ├── callback │ │ │ │ │ ├── callback_cache.dart │ │ │ │ │ └── callbacks.dart │ │ │ │ ├── constants.dart │ │ │ │ ├── core_instance_provider.dart │ │ │ │ ├── logger.dart │ │ │ │ ├── method_channel_moengage_flutter.dart │ │ │ │ ├── moe_cache.dart │ │ │ │ └── moe_core_controller.dart │ │ │ │ ├── log_level.dart │ │ │ │ ├── model │ │ │ │ ├── account_meta.dart │ │ │ │ ├── analytics │ │ │ │ │ └── analytics_config.dart │ │ │ │ ├── app_status.dart │ │ │ │ ├── gender.dart │ │ │ │ ├── geo_location.dart │ │ │ │ ├── inapp │ │ │ │ │ ├── action.dart │ │ │ │ │ ├── campaign_context.dart │ │ │ │ │ ├── campaign_data.dart │ │ │ │ │ ├── click_data.dart │ │ │ │ │ ├── display_rules.dart │ │ │ │ │ ├── inapp_action_type.dart │ │ │ │ │ ├── inapp_custom_action.dart │ │ │ │ │ ├── inapp_data.dart │ │ │ │ │ ├── navigation_action.dart │ │ │ │ │ ├── navigation_type.dart │ │ │ │ │ ├── nudge_position.dart │ │ │ │ │ ├── self_handled_campaign.dart │ │ │ │ │ ├── self_handled_campaigns_data.dart │ │ │ │ │ └── self_handled_data.dart │ │ │ │ ├── moe_init_config.dart │ │ │ │ ├── permission_result.dart │ │ │ │ ├── permission_type.dart │ │ │ │ ├── platforms.dart │ │ │ │ ├── properties.dart │ │ │ │ ├── push │ │ │ │ │ ├── moe_push_service.dart │ │ │ │ │ ├── push_campaign.dart │ │ │ │ │ ├── push_campaign_data.dart │ │ │ │ │ ├── push_config.dart │ │ │ │ │ └── push_token_data.dart │ │ │ │ └── user_deletion_data.dart │ │ │ │ ├── moengage_flutter_platform_interface.dart │ │ │ │ └── utils │ │ │ │ ├── data_payload_mapper.dart │ │ │ │ ├── in_app_payload_mapper.dart │ │ │ │ ├── init_config_payload_mapper.dart │ │ │ │ ├── push_payload_mapper.dart │ │ │ │ └── utils.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ ├── compator.dart │ │ │ ├── data_payload_mapper_test.dart │ │ │ ├── data_provider │ │ │ ├── data_provider.dart │ │ │ └── json_data.dart │ │ │ ├── data_tracking_test.dart │ │ │ ├── parser_test.dart │ │ │ └── utils_test.dart │ └── moengage_flutter_web │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ ├── constants.dart │ │ ├── extensions.dart │ │ ├── moengage_flutter_web.dart │ │ └── utils.dart │ │ ├── pubspec.yaml │ │ └── test │ │ └── moengage_flutter_web_test.dart ├── moengage_geofence │ ├── moengage_geofence │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── example │ │ │ └── README.md │ │ ├── lib │ │ │ ├── moengage_geofence.dart │ │ │ └── src │ │ │ │ └── moengage_geofence.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_geofence_test.dart │ ├── moengage_geofence_android │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── moengage │ │ │ │ │ └── flutter │ │ │ │ │ └── geofence │ │ │ │ │ ├── Constants.kt │ │ │ │ │ └── MoEngageGeofencePlugin.kt │ │ │ └── user-agent.gradle │ │ ├── lib │ │ │ └── moengage_geofence_android.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_geofence_android_test.dart │ ├── moengage_geofence_ios │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── ios │ │ │ ├── .gitignore │ │ │ ├── Assets │ │ │ │ └── .gitkeep │ │ │ ├── Classes │ │ │ │ ├── MoEngageFlutterGeofence.swift │ │ │ │ ├── MoEngageFlutterGeofenceConstants.swift │ │ │ │ ├── MoEngageGeofencePlugin.h │ │ │ │ └── MoEngageGeofencePlugin.m │ │ │ └── moengage_geofence_ios.podspec │ │ ├── lib │ │ │ └── moengage_geofence_ios.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── moengage_geofence_ios_test.dart │ └── moengage_geofence_platform_interface │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ ├── moengage_geofence_platform_interface.dart │ │ └── src │ │ │ ├── internal │ │ │ ├── method_channel_moengage_geofence.dart │ │ │ └── moe_geofence_constants.dart │ │ │ └── moengage_geofence_platform_interface.dart │ │ ├── pubspec.yaml │ │ └── test │ │ └── moengage_geofence_platform_interface_test.dart └── moengage_inbox │ ├── moengage_inbox │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── config.json │ ├── example │ │ └── README.md │ ├── lib │ │ ├── moengage_inbox.dart │ │ └── src │ │ │ └── moengage_inbox.dart │ ├── pubspec.yaml │ └── test │ │ └── moengage_inbox_test.dart │ ├── moengage_inbox_android │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── android │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ ├── settings.gradle │ │ ├── src │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── moengage │ │ │ │ └── flutter │ │ │ │ └── inbox │ │ │ │ ├── Constants.kt │ │ │ │ └── MoEngageInboxPlugin.kt │ │ └── user-agent.gradle │ ├── lib │ │ └── moengage_inbox_android.dart │ ├── pubspec.yaml │ └── test │ │ └── moengage_inbox_test.dart │ ├── moengage_inbox_ios │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── ios │ │ ├── .gitignore │ │ ├── Assets │ │ │ └── .gitkeep │ │ ├── Classes │ │ │ ├── MoEngageFlutterInbox.swift │ │ │ ├── MoEngageFlutterInboxConstants.swift │ │ │ ├── MoEngageInboxPlugin.h │ │ │ └── MoEngageInboxPlugin.m │ │ └── moengage_inbox_ios.podspec │ ├── lib │ │ └── moengage_inbox_ios.dart │ ├── pubspec.yaml │ └── test │ │ └── moengage_inbox_test.dart │ └── moengage_inbox_platform_interface │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── lib │ ├── moengage_inbox_platform_interface.dart │ └── src │ │ ├── internal │ │ ├── constants.dart │ │ └── moe_inbox_utils.dart │ │ ├── method_channel_moengage_inbox.dart │ │ ├── model │ │ ├── action.dart │ │ ├── action_type.dart │ │ ├── inbox_data.dart │ │ ├── inbox_message.dart │ │ ├── media.dart │ │ ├── media_type.dart │ │ ├── models.dart │ │ ├── navigation_action.dart │ │ ├── navigation_type.dart │ │ └── text_content.dart │ │ ├── moengage_inbox_platform_interface.dart │ │ └── payload_transformer.dart │ ├── pubspec.yaml │ └── test │ ├── inbox_comparator.dart │ ├── parser_test.dart │ └── src │ ├── data_provider_provider.dart │ └── json_data_provider.dart ├── pubspec.yaml └── scripts ├── format.sh ├── ktlint-format.sh ├── setup.sh └── verify.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{kt,kts}] 2 | insert_final_newline = false 3 | indent_size = 4 4 | 5 | [*.java] 6 | indent_style = tab 7 | tab_width = 2 8 | indent_size = 2 -------------------------------------------------------------------------------- /.github/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/.github/logo.png -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Jira Ticket 2 | 3 | ### Description 4 | -------------------------------------------------------------------------------- /.github/scripts/dry-run.sh: -------------------------------------------------------------------------------- 1 | cd "$(dirname "$0")/../.." || exit 2 | echo "Current directory: $(pwd)" 3 | outputs=$( melos exec -c 1 --no-private --ignore="*example*" -- dart pub publish --dry-run) 4 | error_detected=false 5 | warning_detected=false 6 | while IFS= read -r line; do 7 | if echo "$line" | grep -q "Building package"; then 8 | error_detected=false 9 | warning_detected=false 10 | fi 11 | if echo "$line" | grep -q "Constraints that are too tight"; then 12 | continue 13 | elif echo "$line" | grep -q -E "^error:"; then 14 | error_detected=true 15 | echo "Error detected: $line" 16 | elif echo "$line" | grep -q -E "^warning:"; then 17 | warning_detected=true 18 | echo "Warning detected: $line" 19 | fi 20 | done <<< "$outputs" 21 | if [ "$error_detected" = true ]; then 22 | echo "Errors detected. Failing the build step." 23 | exit 1 24 | elif [ "$warning_detected" = true ]; then 25 | echo "Warnings detected. Following up on the warnings, but the build will continue." 26 | fi -------------------------------------------------------------------------------- /.github/scripts/release.main.kts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env kotlin 2 | 3 | @file:Import("../../../sdk-automation-scripts/scripts/hybrid/flutter-release.main.kts") 4 | 5 | releasePlugins() -------------------------------------------------------------------------------- /.github/scripts/verify-format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "$GITHUB_WORKSPACE" || exit 3 | echo "Current directory: $(pwd)" 4 | unformatted_files=$(git ls-files --modified | grep ".*\.dart$") 5 | 6 | # Check if there are any modified (unformatted) files 7 | if [[ -n $unformatted_files ]]; then 8 | printf "\n\n-------------------------\n\n" 9 | echo "The following files are not formatted correctly:" 10 | echo "$unformatted_files" # This will list the file names 11 | printf "\n\n-------------------------\n\n" 12 | 13 | # Optionally checkout the files to discard changes if running in CI 14 | if [[ $GITHUB_WORKFLOW ]]; then 15 | git checkout . &> /dev/null 16 | fi 17 | 18 | echo "To fix these files locally, run: 'melos run format'" 19 | exit 1 20 | else 21 | echo "✅ All files are formatted correctly." 22 | fi -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | .idea 9 | *.iml 10 | android/.settings 11 | exampleObjC 12 | example/android/app/local.properties 13 | example/android/app/google-services.json 14 | example/ios/Runner/GoogleService-Info.plist 15 | **pubspec.lock 16 | /geofence/example/android/gradle/wrapper/gradle-wrapper.jar 17 | **.flutter-plugins-dependencies 18 | **.flutter-plugins 19 | **pubspec_overrides.yaml 20 | -------------------------------------------------------------------------------- /.woodpecker.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pipeline: 3 | download: 4 | image: docker 5 | commands: 6 | - docker pull 612427630422.dkr.ecr.us-east-1.amazonaws.com/sre/moe-trufflehog 7 | - docker pull 612427630422.dkr.ecr.us-east-1.amazonaws.com/sre/checkov 8 | volumes: 9 | - /var/run/docker.sock:/var/run/docker.sock 10 | - /home/ec2-user/.docker:/root/.docker 11 | 12 | secret-checker: 13 | image: 612427630422.dkr.ecr.us-east-1.amazonaws.com/sre/moe-trufflehog 14 | commands: 15 | - python /moe-truffleHog/truffleHog/truffleHog.py --regex --rules /moe-truffleHog/rules.json --max_depth 1 --branch "${DRONE_BRANCH}" "https://github.com/${DRONE_REPO}.git" --entropy true 16 | 17 | notify_to_slack: 18 | image: plugins/slack 19 | when: 20 | status: [ failure ] 21 | secrets: [ SLACK_WEBHOOK ] 22 | settings: 23 | template: > 24 | {{repo.name}} ({{build.branch}}) <{{ build.link }}|{{ repo.owner }}/{{ repo.name }}#{{truncate build.commit 8}}> build failed. Tokens Found, Please remove tokens {{ build.author }}. 25 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | # Release Process 2 | 3 | - Create a new branch from `development` for any new feature or bugfix 4 | - After QA, merge the feature/bugfix branch into `development` 5 | - Once all the releasing features/changes into `development`, checkout release branch from `development` 6 | - Update Changelog date and package release versions and raise a PR to `development` 7 | - Once PR is merged, trigger the Release Plugins action to publish the updated plugins to `pub.dev`. -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 68587a0916366e9512a78df22c44163d041dd5f3 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /example/android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "xxxxxxxxxxxxxx", 4 | "firebase_url": "https://xxxxxxxxxxxxxx.firebaseio.com", 5 | "project_id": "moesampleapp", 6 | "storage_bucket": "moesampleapp.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:xxxxxxxxxxxxxx:android:xxxxxxxxxxxxxx", 12 | "android_client_info": { 13 | "package_name": "com.moengage.sampleapp" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "xxxxxxxxxxxxxx.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.moengage.sampleapp", 22 | "certificate_hash": "xxxxxxxxxxxxxx" 23 | } 24 | }, 25 | { 26 | "client_id": "xxxxxxxxxxxxxx.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "xxxxxxxxxxxxxx" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "xxxxxxxxxxxxxx.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /example/android/app/keystore.properties: -------------------------------------------------------------------------------- 1 | storeFilePath=moengage123.jks 2 | storePassword=moengage123 3 | keyAlias=moengage123 4 | keyPassword=moengage123 -------------------------------------------------------------------------------- /example/android/app/moengage123.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/moengage123.jks -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/umang/Dev/androidSDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | # Required for ignoring Missing Class warning in HMS sdk. 19 | -ignorewarnings -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/moengage/sampleapp/CustomPushListener.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.sampleapp 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.os.Bundle 6 | import com.moengage.core.internal.logger.Logger 7 | import com.moengage.core.model.AccountMeta 8 | import com.moengage.plugin.base.push.PluginPushCallback 9 | 10 | /** 11 | * @author Umang Chamaria 12 | * Date: 2020/12/06 13 | */ 14 | class CustomPushListener(accountMeta: AccountMeta) : PluginPushCallback(accountMeta) { 15 | 16 | private val tag = "CustomPushListener" 17 | 18 | override fun onNotificationClick(activity: Activity, payload: Bundle): Boolean { 19 | Logger.print { "$tag onNotificationClick() : " } 20 | return super.onNotificationClick(activity, payload) 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/moengage/sampleapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.sampleapp 2 | 3 | import android.content.Intent 4 | import android.content.res.Configuration 5 | import android.os.Bundle 6 | import android.util.Log 7 | import com.moengage.flutter.MoEFlutterHelper.Companion.getInstance 8 | import io.flutter.embedding.android.FlutterActivity 9 | import io.flutter.embedding.engine.FlutterEngine 10 | 11 | class MainActivity : FlutterActivity() { 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | processIntent(intent) 15 | } 16 | 17 | override fun onConfigurationChanged(newConfig: Configuration) { 18 | super.onConfigurationChanged(newConfig) 19 | Log.d("MainActivity", " : onConfigurationChanged() : ${newConfig.orientation}") 20 | // Checks the orientation of the screen 21 | getInstance().onConfigurationChanged() 22 | } 23 | 24 | override fun configureFlutterEngine(flutterEngine: FlutterEngine) { 25 | super.configureFlutterEngine(flutterEngine) 26 | // GeneratedPluginRegistrant.registerWith(flutterEngine); 27 | } 28 | 29 | override fun onNewIntent(intent: Intent) { 30 | super.onNewIntent(intent) 31 | processIntent(intent) 32 | } 33 | 34 | private fun processIntent(intent: Intent?) { 35 | if (intent == null) return 36 | Log.d("MainActivity", " : processIntent() : ${intent.data}") 37 | } 38 | } -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.9.23' 3 | repositories { 4 | google() 5 | gradlePluginPortal() 6 | maven { url 'https://developer.huawei.com/repo/' } 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:8.7.3' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | classpath 'com.google.gms:google-services:4.4.2' 13 | classpath 'com.huawei.agconnect:agcp:1.9.1.300' 14 | // classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.1" 15 | } 16 | } 17 | // apply plugin: 'org.jlleitschuh.gradle.ktlint' 18 | 19 | allprojects { 20 | repositories { 21 | mavenLocal() 22 | google() 23 | maven { url 'https://developer.huawei.com/repo/' } 24 | } 25 | } 26 | 27 | rootProject.buildDir = '../build' 28 | subprojects { 29 | project.buildDir = "${rootProject.buildDir}/${project.name}" 30 | } 31 | subprojects { 32 | project.evaluationDependsOn(':app') 33 | } 34 | 35 | task clean(type: Delete) { 36 | delete rootProject.buildDir 37 | } 38 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | org.gradle.jvmargs=-Xmx1536M 4 | 5 | android.enableR8=true 6 | android.defaults.buildfeatures.buildconfig=true -------------------------------------------------------------------------------- /example/android/gradle/appLibs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | glide = "4.16.0" 3 | 4 | [libraries] 5 | fcm = { module = "com.google.firebase:firebase-messaging", version = "23.4.1" } 6 | playLocation = { module = "com.google.android.gms:play-services-location", version = "21.0.1" } 7 | kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version = "1.9.23" } 8 | hmsPush = { module = "com.huawei.hms:push", version = "6.10.0.300" } 9 | adIdentifier = { module = "com.google.android.gms:play-services-ads-identifier", version = "18.0.1" } 10 | lifecycleOwner = { module = "androidx.lifecycle:lifecycle-process", version = "2.7.0" } 11 | expresso = { module = "androidx.test.espresso:espresso-core", version = "3.5.1" } 12 | androidJUnit = { module = "androidx.test.ext:junit", version = "1.1.5" } 13 | junit = { module = "junit:junit", version = "4.13.2" } 14 | 15 | 16 | glideCore = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 10 15:19:57 IST 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | 17 | dependencyResolutionManagement { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | versionCatalogs { 23 | libs { 24 | create("moengage") { 25 | from("com.moengage:android-dependency-catalog:4.7.0") 26 | } 27 | create("appLibs") { 28 | from(files("../android/gradle/appLibs.versions.toml")) 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /example/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | 2d3fe686ad810a0d099d9e3a0d437a80 -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 10.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/NotificationServices/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | NotificationServices 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionPointIdentifier 26 | com.apple.usernotifications.service 27 | NSExtensionPrincipalClass 28 | $(PRODUCT_MODULE_NAME).NotificationService 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/ios/NotificationServices/NotificationService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationService.swift 3 | // NotificationServices 4 | // 5 | // Created by Chengappa C D on 06/11/20. 6 | // Copyright © 2020 The Chromium Authors. All rights reserved. 7 | // 8 | 9 | import UserNotifications 10 | import MoEngageRichNotification 11 | 12 | class NotificationService: UNNotificationServiceExtension { 13 | 14 | var contentHandler: ((UNNotificationContent) -> Void)? 15 | var bestAttemptContent: UNMutableNotificationContent? 16 | 17 | override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { 18 | self.contentHandler = contentHandler 19 | bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) 20 | MoEngageSDKRichNotification.setAppGroupID("group.com.alphadevs.MoEngage.NotificationServices") 21 | MoEngageSDKRichNotification.handle(richNotificationRequest: request, withContentHandler: contentHandler) 22 | } 23 | 24 | override func serviceExtensionTimeWillExpire() { 25 | // Called just before the extension will be terminated by the system. 26 | // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. 27 | if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { 28 | contentHandler(bestAttemptContent) 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /example/ios/NotificationServices/NotificationServices.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.security.application-groups 8 | 9 | group.com.alphadevs.MoEngage.NotificationServices 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/PushTemplates/NotificationViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationViewController.swift 3 | // PushTemplates 4 | // 5 | // Created by Chengappa C D on 23/02/21. 6 | // Copyright © 2021 The Chromium Authors. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import UserNotifications 11 | import UserNotificationsUI 12 | import MoEngageRichNotification 13 | 14 | class NotificationViewController: UIViewController, UNNotificationContentExtension { 15 | 16 | @IBOutlet var label: UILabel? 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | MoEngageSDKRichNotification.setAppGroupID("group.com.alphadevs.MoEngage.NotificationServices") 21 | } 22 | 23 | func didReceive(_ notification: UNNotification) { 24 | MoEngageSDKRichNotification.addPushTemplate(toController: self, withNotification: notification) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /example/ios/PushTemplates/PushTemplates.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | group.com.alphadevs.MoEngage.NotificationServices 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /example/ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.security.application-groups 8 | 9 | group.com.alphadevs.MoEngage.NotificationServices 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/lib/cards/cards_helper.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | // ignore_for_file: type=lint 3 | 4 | import 'package:collection/collection.dart'; 5 | import 'package:moengage_cards/moengage_cards.dart'; 6 | 7 | extension CardExtension on Card { 8 | Widget? getImageWidget() { 9 | return template.containers[0].widgets 10 | .firstWhereOrNull((Widget w) => w.widgetType == WidgetType.image); 11 | } 12 | 13 | Widget? getHeaderWidget() { 14 | return template.containers[0].widgets.firstWhereOrNull( 15 | (Widget w) => w.widgetType == WidgetType.text && w.id == 1); 16 | } 17 | 18 | Widget? getMessageWidget() { 19 | return template.containers[0].widgets.firstWhereOrNull( 20 | (Widget w) => w.widgetType == WidgetType.text && w.id == 2); 21 | } 22 | 23 | Widget? getButtonWidget() { 24 | return template.containers[0].widgets 25 | .firstWhereOrNull((Widget w) => w.widgetType == WidgetType.button); 26 | } 27 | 28 | Container? getContainer() { 29 | return template.containers.firstOrNull; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /example/lib/constants.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | // ignore_for_file: type=lint 3 | 4 | /// MoEngage AppId / Workspace ID 5 | const String WORKSPACE_ID = ''; 6 | -------------------------------------------------------------------------------- /example/lib/second_page.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | // ignore_for_file: type=lint 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class SecondPage extends StatelessWidget { 7 | const SecondPage({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: const Text('Second Page'), 14 | ), 15 | body: const Center( 16 | child: Text('Page 2'), 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | void main() { 11 | test('Sample Test', () { 12 | // This is a Sample Test that will always pass. 13 | // It's just here to satisfy the test requirements. 14 | expect(1 + 1, equals(2)); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /example/web/serviceworker.js: -------------------------------------------------------------------------------- 1 | importScripts("//cdn.moengage.com/webpush/releases/serviceworker_cdn.min.latest.js?date="); 2 | -------------------------------------------------------------------------------- /melos.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_flutter 2 | repository: https://github.com/moengage/Flutter-SDK/ 3 | 4 | command: 5 | bootstrap: 6 | usePubspecOverrides: true 7 | packages: 8 | - packages/* 9 | - packages/*/* 10 | - packages/*/*/* 11 | - example 12 | scripts: 13 | analyze: melos exec -- flutter analyze 14 | format: melos exec -- dart format . 15 | get: melos exec -- flutter pub get 16 | dry-run: flutter pub publish --dry-run 17 | unittest: 18 | run: melos exec -- flutter test 19 | select-package: 20 | dir-exists: 21 | - test 22 | scope: "*interface*" -------------------------------------------------------------------------------- /packages/moengage_cards/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards/example/README.md: -------------------------------------------------------------------------------- 1 | # moengage_cards_example 2 | 3 | Demonstrates how to use the moengage_cards plugin. 4 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards/lib/moengage_cards.dart: -------------------------------------------------------------------------------- 1 | /// Export MoEngage Cards Module Public Classes 2 | export 'package:moengage_cards_platform_interface/moengage_cards_platform_interface.dart'; 3 | export 'src/moengage_cards.dart'; 4 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_cards 2 | description: MoEngage Cards Plugin 3 | version: 5.2.0 4 | homepage: https://moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | platforms: 13 | android: 14 | default_package: moengage_cards_android 15 | ios: 16 | default_package: moengage_cards_ios 17 | 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | moengage_cards_android: 4.2.0 22 | moengage_cards_ios: 4.2.0 23 | moengage_cards_platform_interface: 4.0.2 24 | moengage_flutter: ^9.0.0 25 | 26 | dev_dependencies: 27 | flutter_test: 28 | sdk: flutter 29 | mocktail: ^0.3.0 30 | plugin_platform_interface: ^2.0.0 31 | 32 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards/test/moengage_cards_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_cards\_android 2 | 3 | The Android implementation of [`moengage_cards`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_cards` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_cards 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .cxx 10 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "moengage_cards" 2 | 3 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/src/main/kotlin/com/moengage/flutter/cards/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.flutter.cards 2 | 3 | internal const val CHANNEL_NAME = "com.moengage/cards" 4 | internal const val MODULE_TAG = "MoEFlutterCards_" 5 | 6 | internal const val METHOD_INITIALIZE = "initialize" 7 | internal const val METHOD_REFRESH_CARDS = "refreshCards" 8 | internal const val METHOD_ON_CARD_SECTION_LOADED = "onCardSectionLoaded" 9 | internal const val METHOD_ON_CARD_SECTION_UNLOADED = "onCardSectionUnLoaded" 10 | internal const val METHOD_GET_CARDS_CATEGORIES = "getCardsCategories" 11 | internal const val METHOD_CARDS_INFO = "getCardsInfo" 12 | internal const val METHOD_CARD_CLICKED = "cardClicked" 13 | internal const val METHOD_CARD_DELIVERED = "cardDelivered" 14 | internal const val METHOD_CARD_SHOWN = "cardShown" 15 | internal const val METHOD_CARDS_FOR_CATEGORY = "cardsForCategory" 16 | internal const val METHOD_DELETE_CARDS = "deleteCards" 17 | internal const val METHOD_IS_ALL_CATEGORY_ENABLED = "isAllCategoryEnabled" 18 | internal const val METHOD_NEW_CARDS_COUNT = "getNewCardsCount" 19 | internal const val METHOD_UN_CLICKED_CARDS_COUNT = "unClickedCardsCount" 20 | internal const val METHOD_FETCH_CARDS = "fetchCards" 21 | 22 | internal const val METHOD_INBOX_OPEN_CARDS_SYNC = "onInboxOpenCardsSync" 23 | internal const val METHOD_PULL_TO_REFRESH_CARDS_SYNC = "onPullToRefreshCardsSync" 24 | internal const val METHOD_GENERIC_CARDS_SYNC = "onCardsSync" -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/android/user-agent.gradle: -------------------------------------------------------------------------------- 1 | import java.util.regex.Matcher 2 | import java.util.regex.Pattern 3 | 4 | String libraryVersionName = "UNKNOWN" 5 | File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') 6 | 7 | if (pubspec.exists()) { 8 | String yaml = pubspec.text 9 | // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. 10 | Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) 11 | if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") 12 | } 13 | 14 | android { 15 | defaultConfig { 16 | // BuildConfig.VERSION_NAME 17 | buildConfigField("String", 'MOENGAGE_CARDS_FLUTTER_LIBRARY_VERSION', "\"${libraryVersionName}\"") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_cards_android 2 | description: Android implementation of the moengage_cards plugin 3 | version: 4.2.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_cards 13 | platforms: 14 | android: 15 | package: com.moengage.flutter.cards 16 | pluginClass: MoEngageCardsPlugin 17 | dartPluginClass: MoEngageCardsAndroid 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | moengage_cards_platform_interface: ^4.0.0 23 | moengage_flutter: ^9.0.0 24 | 25 | dev_dependencies: 26 | flutter_test: 27 | sdk: flutter 28 | plugin_platform_interface: ^2.0.0 29 | 30 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_android/test/moengage_cards_android_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Cards iOS Plugin 2 | 3 | # 25-03-2025 4 | 5 | ## 4.2.0 6 | - Updated MoEngageCards to `4.20.0` 7 | 8 | # 18-02-2025 9 | 10 | ## 4.1.1 11 | - Updated MoEngageCards to `4.19.2` 12 | 13 | # 29-01-2025 14 | 15 | ## 4.1.0 16 | - Updated MoEngageCards to `4.19.1` 17 | 18 | # 25-11-2024 19 | 20 | ## 4.0.2 21 | - Internal improvements. 22 | 23 | # 03-10-2024 24 | 25 | ## 4.0.1 26 | - Fixed dependency version incompatibility issue with `moengage_flutter` 27 | 28 | # 30-09-2024 29 | 30 | ## 4.0.0 31 | - Refresh cards on uniqueID set 32 | - Updated MoEngageCards to `4.18.0` 33 | 34 | # 07-08-2024 35 | 36 | ## 3.0.1 37 | - Internal Improvements 38 | 39 | # 07-08-2024 40 | 41 | ## 3.0.0 42 | - Internal Improvements 43 | 44 | # 31-07-2024 45 | 46 | ## 2.3.0 47 | - Updated MoEngageCards to `4.17.0` 48 | 49 | # 03-07-2024 50 | 51 | ## 2.2.0 52 | - Internal Improvements 53 | 54 | # 02-05-2024 55 | 56 | ## 2.1.0 57 | - Updated MoEngageCards to 4.16.0 58 | 59 | # 21-03-2024 60 | 61 | ## 2.0.0 62 | - Updated MoEngageCards to 4.15.0 63 | 64 | # 30-01-2024 65 | 66 | ## 1.2.0 67 | - Updated MoEngageCards to 4.14.0 68 | 69 | # 01-12-2023 70 | 71 | ## 1.1.0 72 | - Updated MoEngageCards to 4.13.0 73 | 74 | # 13-09-2023 75 | 76 | ## 1.0.0 77 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_cards\_ios 2 | 3 | The iOS implementation of [`moengage_cards`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_cards` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_cards 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/packages/moengage_cards/moengage_cards_ios/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/ios/Classes/MoEngageCardsUtil.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MoEngageCardsUtil.swift 3 | // moengage_cards 4 | // 5 | // Created by Soumya Mahunt on 26/06/23. 6 | // 7 | 8 | import Flutter 9 | import MoEngagePluginCards 10 | 11 | enum MoEngageCardsUtil { 12 | static func resume( 13 | channel method: String, 14 | havingResult result: @escaping FlutterResult, 15 | withData data: [String: Any] 16 | ) { 17 | let resultData = Self.serialize(data: data) 18 | MoEngagePluginCardsLogger.debug( 19 | "Providing data \(data) to client for channel method \(method)", 20 | forData: data 21 | ) 22 | DispatchQueue.main.async { result(resultData) } 23 | } 24 | 25 | static func serialize(data: [String: Any]) -> String { 26 | if let jsonData = try? JSONSerialization.data(withJSONObject: data), 27 | let jsonStr = String(data: jsonData, encoding: .utf8) { 28 | return jsonStr 29 | } else { 30 | return "" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/ios/moengage_cards_ios.podspec: -------------------------------------------------------------------------------- 1 | require 'yaml' 2 | pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) 3 | libraryVersion = pubspec['version'].gsub('+', '-') 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'moengage_cards_ios' 7 | s.version = libraryVersion 8 | s.summary = 'A flutter plugin for using Cards from MoEngage iOS SDKs.' 9 | s.description = <<-DESC 10 | A flutter plugin for using Cards from MoEngage iOS SDKs. 11 | DESC 12 | s.homepage = 'https://www.moengage.com/' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'MoEngage Inc.' => 'mobiledevs@moengage.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.platform = :ios, '11.0' 18 | 19 | s.dependency 'Flutter' 20 | s.dependency 'MoEngagePluginCards', '2.3.0' 21 | 22 | # Flutter.framework does not contain a i386 slice. 23 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 24 | s.swift_version = '5.0' 25 | end 26 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_cards_ios 2 | description: iOS implementation of the moengage_cards plugin 3 | version: 4.2.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_cards 13 | platforms: 14 | ios: 15 | pluginClass: MoEngageCardsPlugin 16 | dartPluginClass: MoEngageCardsIOS 17 | 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | moengage_cards_platform_interface: ^4.0.0 22 | moengage_flutter: ^9.0.0 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | plugin_platform_interface: ^2.0.0 28 | 29 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_ios/test/moengage_cards_ios_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Cards Platform Interface 2 | 3 | # 25-11-2024 4 | 5 | ## 4.0.2 6 | - Internal improvements. 7 | 8 | # 03-10-2024 9 | 10 | ## 4.0.1 11 | - Fixed dependency version incompatibility issue with `moengage_flutter` 12 | 13 | # 30-09-2024 14 | 15 | ## 4.0.0 16 | - Refresh cards on uniqueID set 17 | 18 | # 07-08-2024 19 | 20 | ## 3.0.0 21 | - Internal Improvements 22 | 23 | # 21-03-2024 24 | 25 | ## 2.0.0 26 | - Updated Minimum Supported `moengage_flutter` version to `7.0.0` 27 | 28 | # 07-12-2023 29 | 30 | ## 1.1.0 31 | - Updated Minimum Supported `moengage_flutter` version to `6.1.0` 32 | 33 | # 13-09-2023 34 | 35 | ## 1.0.0 36 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/README.md: -------------------------------------------------------------------------------- 1 | # moengage_cards_platform_interface 2 | 3 | A common platform interface for the [`moengage_cards`][1] plugin. 4 | 5 | This interface allows platform-specific implementations of the `moengage_cards` 6 | plugin, as well as the plugin itself, to ensure they are supporting the 7 | same interface. 8 | 9 | # Usage 10 | 11 | To implement a new platform-specific implementation of `moengage_cards`, extend 12 | [`MoEngageCardsPlatformInterface`][2] with an implementation that performs the 13 | platform-specific behavior, and when you register your plugin, set the default 14 | `MoEngageCardsPlatformInterface` by calling 15 | `MoEngageCardsPlatformInterface.instance = MyPlatformMoEngageCards()`. 16 | 17 | # Note on breaking changes 18 | 19 | Strongly prefer non-breaking changes (such as adding a method to the interface) 20 | over breaking changes for this package. 21 | 22 | See https://flutter.dev/go/platform-interface-breaking-changes for a discussion 23 | on why a less-clean interface is preferable to a breaking change. 24 | 25 | [1]: 26 | [2]: lib/moengage_cards_platform_interface.dart -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/internal/callback_cache.dart: -------------------------------------------------------------------------------- 1 | import '../../moengage_cards_platform_interface.dart'; 2 | 3 | /// Callback Cache for Cards Module 4 | class CallbackCache { 5 | /// Set cards sync complete callback listener 6 | /// Currently applicable for AppOpen Sync, fetching cards when unique id is set. 7 | CardsSyncListener? cardsSyncListener; 8 | 9 | /// Inbox Open Cards Sync Listener 10 | CardsSyncListener? inboxOpenSyncListener; 11 | 12 | /// Pull To Refresh Cards Sync Listener 13 | CardsSyncListener? pullToRefreshOpenSyncListener; 14 | } 15 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/internal/cards_instance_provider.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | import 'callback_cache.dart'; 3 | 4 | class CardsInstanceProvider { 5 | factory CardsInstanceProvider() => _instance; 6 | CardsInstanceProvider._internal(); 7 | static final CardsInstanceProvider _instance = 8 | CardsInstanceProvider._internal(); 9 | 10 | final Map _caches = {}; 11 | 12 | CallbackCache getCallbackCacheForInstance(String appId) { 13 | final CallbackCache? cache = _caches[appId]; 14 | if (cache != null) { 15 | return cache; 16 | } else { 17 | final CallbackCache instanceCache = CallbackCache(); 18 | _caches[appId] = instanceCache; 19 | return instanceCache; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/internal/cards_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import '../../moengage_cards_platform_interface.dart'; 3 | import 'cards_instance_provider.dart'; 4 | 5 | /// Common Implementation of Cards Platform Interface 6 | abstract class MoEngageCardsPlatform extends MoEngageCardsPlatformInterface { 7 | /// Cards Method Channel 8 | MethodChannel methodChannel = const MethodChannel(cardsMethodChannel); 9 | 10 | @override 11 | void refreshCards(String appId, CardsSyncListener cardsSyncListener) { 12 | CardsInstanceProvider() 13 | .getCallbackCacheForInstance(appId) 14 | .pullToRefreshOpenSyncListener = cardsSyncListener; 15 | } 16 | 17 | @override 18 | void onCardsSectionLoaded(String appId, CardsSyncListener cardsSyncListener) { 19 | CardsInstanceProvider() 20 | .getCallbackCacheForInstance(appId) 21 | .inboxOpenSyncListener = cardsSyncListener; 22 | } 23 | 24 | @override 25 | void setSyncCompleteListener( 26 | CardsSyncListener cardsSyncListener, String appId) { 27 | CardsInstanceProvider() 28 | .getCallbackCacheForInstance(appId) 29 | .cardsSyncListener = cardsSyncListener; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/action/action.dart: -------------------------------------------------------------------------------- 1 | import '../enums/action_type.dart'; 2 | 3 | ///Base class all Action. 4 | abstract class Action { 5 | /// [Action] constructor 6 | Action(this.actionType); 7 | 8 | /// Action Type - Currently Only Navigation Action is Supported 9 | ActionType actionType; 10 | 11 | /// Abstract Function, should be overridden by Implementation Class 12 | Map toJson(); 13 | } 14 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/cards_data.dart: -------------------------------------------------------------------------------- 1 | import '../internal/constants.dart'; 2 | import 'card.dart'; 3 | 4 | /// Data for Cards for particular Category 5 | class CardsData { 6 | /// [CardsData] Constructor 7 | CardsData({required this.category, required this.cards}); 8 | 9 | /// Get [CardsData] from Json [Map] 10 | factory CardsData.fromJson(Map json) => CardsData( 11 | category: (json[keyCategory] ?? argumentAllCards) as String, 12 | cards: List.from((json[keyCards] ?? []) as Iterable) 13 | .map((e) => Card.fromJson(e as Map)) 14 | .toList(), 15 | ); 16 | 17 | /// Category in which Cards belong to 18 | String category; 19 | 20 | /// [List] of [Card] Model 21 | List cards; 22 | 23 | /// Convert [CardsData] to Json [Map] 24 | Map toJson() => { 25 | keyCategory: category, 26 | keyCards: cards.map((Card e) => e.toJson()).toList() 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/cards_info.dart: -------------------------------------------------------------------------------- 1 | import '../internal/constants.dart'; 2 | import 'card.dart'; 3 | 4 | /// All data for cards. 5 | class CardsInfo { 6 | /// [CardsInfo] Constructor 7 | CardsInfo({ 8 | required this.shouldShowAllTab, 9 | required this.categories, 10 | required this.cards, 11 | }); 12 | 13 | /// Get [CardsInfo] from Json [Map] 14 | factory CardsInfo.fromJson(Map json) { 15 | return CardsInfo( 16 | shouldShowAllTab: (json[keyShouldShowAllTab] ?? false) as bool, 17 | categories: List.from((json[keyCategories] ?? []) as Iterable) 18 | .map((e) => e.toString()) 19 | .toList(), 20 | cards: List.from((json[keyCards] ?? []) as Iterable) 21 | .map((e) => Card.fromJson(e as Map)) 22 | .toList(), 23 | ); 24 | } 25 | 26 | /// True is showing ALL tabs is enabled else false. 27 | final bool shouldShowAllTab; 28 | 29 | /// All configured categories for cards. 30 | final List categories; 31 | 32 | /// All cards which are eligible for display currently. 33 | final List cards; 34 | 35 | /// Convert [CardsInfo] to Json [Map] 36 | Map toJson() => { 37 | keyShouldShowAllTab: shouldShowAllTab, 38 | keyCategories: categories, 39 | keyCards: cards.map((Card e) => e.toJson()) 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/enums/action_type.dart: -------------------------------------------------------------------------------- 1 | /// Type of Action to be performed 2 | /// Note: Currently, only Navigation Action is Supported 3 | enum ActionType { 4 | /// Navigation Action 5 | navigate 6 | } 7 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/enums/template_type.dart: -------------------------------------------------------------------------------- 1 | /// Card Template Types available in Dashboard 2 | enum TemplateType { 3 | /// Basic Card Template 4 | basic, 5 | 6 | /// Illustration Card Template 7 | illustration 8 | } 9 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/enums/widget_type.dart: -------------------------------------------------------------------------------- 1 | /// Types of UI widgets supported. 2 | enum WidgetType { 3 | /// Widget that loads text content. 4 | text, 5 | 6 | /// Widget that loads an image or gif 7 | image, 8 | 9 | /// Widget that loads button content. 10 | button, 11 | } 12 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/model.dart: -------------------------------------------------------------------------------- 1 | export 'action/action.dart'; 2 | export 'action/navigation_action.dart'; 3 | export 'campaign_state.dart'; 4 | export 'card.dart'; 5 | export 'cards_data.dart'; 6 | export 'cards_info.dart'; 7 | export 'container.dart'; 8 | export 'display_control.dart'; 9 | export 'enums/action_type.dart'; 10 | export 'enums/template_type.dart'; 11 | export 'enums/widget_type.dart'; 12 | export 'meta_data.dart'; 13 | export 'navigation_type.dart'; 14 | export 'show_time.dart'; 15 | export 'style/button_style.dart'; 16 | export 'style/container_style.dart'; 17 | export 'style/image_style.dart'; 18 | export 'style/text_style.dart'; 19 | export 'style/widget_style.dart'; 20 | export 'sync_data.dart'; 21 | export 'sync_type.dart'; 22 | export 'template.dart'; 23 | export 'widget.dart'; 24 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/navigation_type.dart: -------------------------------------------------------------------------------- 1 | /// Navigation Action Types 2 | enum NavigationType { 3 | /// Navigation is done using screen name. 4 | screenName, 5 | 6 | /// Navigation is done using a deep-link Url or http(s) url. 7 | deepLink, 8 | 9 | /// Navigation to a rich-landing url 10 | richLanding 11 | } 12 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/show_time.dart: -------------------------------------------------------------------------------- 1 | import '../internal/constants.dart'; 2 | 3 | /// Time span during card can be shown 4 | class ShowTime { 5 | /// [ShowTime] Constructor 6 | ShowTime({required this.startTime, required this.endTime}); 7 | 8 | /// Get [ShowTime] from Json [Map] 9 | factory ShowTime.fromJson(Map json) { 10 | return ShowTime( 11 | startTime: (json[keyStartTime] ?? '') as String, 12 | endTime: (json[keyEndTime] ?? '') as String, 13 | ); 14 | } 15 | 16 | /// Start time for the time range. 17 | String startTime; 18 | 19 | /// End time for the time range. 20 | String endTime; 21 | 22 | /// Convert [ShowTime] to Json [Map] 23 | Map toJson() => 24 | {keyStartTime: startTime, keyEndTime: endTime}; 25 | } 26 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/style/button_style.dart: -------------------------------------------------------------------------------- 1 | import '../../internal/constants.dart'; 2 | import 'widget_style.dart'; 3 | 4 | ///Style for Button Widget - [WidgetType.button] 5 | class ButtonStyle extends WidgetStyle { 6 | /// [ButtonStyle] Constructor 7 | ButtonStyle({required String backgroundColor, required this.fontSize}) 8 | : super(backgroundColor); 9 | 10 | /// Get [ButtonStyle] from Json [Map] 11 | factory ButtonStyle.fromJson(Map json) { 12 | return ButtonStyle( 13 | backgroundColor: 14 | (json[keyBackgroundColor] ?? defaultTextBgColor) as String, 15 | fontSize: (json[keyFontSize] ?? defaultFontSize) as int, 16 | ); 17 | } 18 | 19 | /// Font Size for Button Text 20 | int fontSize; 21 | 22 | @override 23 | Map toJson() => 24 | {keyBackgroundColor: backgroundColor, keyFontSize: fontSize}; 25 | } 26 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/style/container_style.dart: -------------------------------------------------------------------------------- 1 | import '../../internal/constants.dart'; 2 | 3 | /// Style for [Container] widget 4 | class ContainerStyle { 5 | /// [ContainerStyle] Constructor 6 | ContainerStyle({required this.backgroundColor}); 7 | 8 | /// Get [ContainerStyle] from Json [Map] 9 | factory ContainerStyle.fromJson(Map json) { 10 | return ContainerStyle( 11 | backgroundColor: 12 | (json[keyBackgroundColor] ?? defaultContainerBgColor) as String, 13 | ); 14 | } 15 | 16 | /// Container Background Color Hex Code 17 | String backgroundColor; 18 | 19 | /// Convert [ContainerStyle] to Json [Map] 20 | Map toJson() => {keyBackgroundColor: backgroundColor}; 21 | } 22 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/style/image_style.dart: -------------------------------------------------------------------------------- 1 | import '../../internal/constants.dart'; 2 | import 'widget_style.dart'; 3 | 4 | ///Style for Button Widget - [WidgetType.image] 5 | class ImageStyle extends WidgetStyle { 6 | /// [ImageStyle] Constructor 7 | ImageStyle({required String backgroundColor}) : super(backgroundColor); 8 | 9 | /// Get [ImageStyle] from Json [Map] 10 | factory ImageStyle.fromJson(Map json) { 11 | return ImageStyle( 12 | backgroundColor: 13 | (json[keyBackgroundColor] ?? defaultTextBgColor) as String, 14 | ); 15 | } 16 | 17 | @override 18 | Map toJson() => {keyBackgroundColor: backgroundColor}; 19 | } 20 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/style/text_style.dart: -------------------------------------------------------------------------------- 1 | import '../../internal/constants.dart'; 2 | import 'widget_style.dart'; 3 | 4 | ///Style for Button Widget - [WidgetType.text] 5 | class TextStyle extends WidgetStyle { 6 | /// [TextStyle] Constructor 7 | TextStyle({required String backgroundColor, required this.fontSize}) 8 | : super(backgroundColor); 9 | 10 | /// Get [TextStyle] from Json [Map] 11 | factory TextStyle.fromJson(Map json) { 12 | return TextStyle( 13 | backgroundColor: 14 | (json[keyBackgroundColor] ?? defaultTextBgColor) as String, 15 | fontSize: (json[keyFontSize] ?? defaultFontSize) as int, 16 | ); 17 | } 18 | 19 | ///Font Size for Text Widget 20 | int fontSize; 21 | 22 | @override 23 | Map toJson() => 24 | {keyBackgroundColor: backgroundColor, keyFontSize: fontSize}; 25 | } 26 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/style/widget_style.dart: -------------------------------------------------------------------------------- 1 | /// Base style for all widgets. 2 | abstract class WidgetStyle { 3 | /// [WidgetStyle] Constructor 4 | WidgetStyle(this.backgroundColor); 5 | 6 | /// Background color for the widget. 7 | String backgroundColor; 8 | 9 | /// Convert [WidgetStyle] to Json [Map] 10 | Map toJson(); 11 | } 12 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/sync_data.dart: -------------------------------------------------------------------------------- 1 | import '../internal/constants.dart'; 2 | import '../internal/payload_mapper.dart'; 3 | import 'sync_type.dart'; 4 | 5 | /// Sync Complete Data 6 | class SyncCompleteData { 7 | /// [SyncCompleteData] Constructor 8 | SyncCompleteData({required this.hasUpdates, required this.syncType}); 9 | 10 | /// Get [SyncCompleteData] from Json [Map] 11 | factory SyncCompleteData.fromJson(Map data) { 12 | return SyncCompleteData( 13 | hasUpdates: (data[keyHasUpdates] ?? false) as bool, 14 | syncType: syncTypeFromString(data[keySyncType] as String), 15 | ); 16 | } 17 | 18 | /// Indicating if there were any updates in the cards post sync. true if there are any new 19 | /// updates present else false. This value is true even if card(s) are deleted. 20 | bool hasUpdates; 21 | 22 | /// Condition under which sync was triggered. Refer to [SyncType] 23 | SyncType syncType; 24 | 25 | /// Convert [SyncCompleteData] to Json [Map] 26 | Map toJson() => 27 | {keySyncType: syncTypeToString(syncType), keyHasUpdates: hasUpdates}; 28 | 29 | @override 30 | String toString() { 31 | return 'SyncCompleteData{hasUpdates: $hasUpdates, syncType: $syncType}'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/sync_type.dart: -------------------------------------------------------------------------------- 1 | /// Card Sync Types 2 | enum SyncType { 3 | /// Sync when user Opens the App 4 | appOpen, 5 | 6 | /// Sync when user lands on Inbox Screen 7 | inboxOpen, 8 | 9 | /// Sync when user performs pull to refresh action 10 | pullToRefresh, 11 | 12 | /// Sync type when SDK sync the cards immediately. 13 | /// Currently applicable for SDK fetching cards immediately when uniqueId is set 14 | immediate 15 | } 16 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/lib/src/model/template.dart: -------------------------------------------------------------------------------- 1 | import '../internal/constants.dart'; 2 | import 'container.dart'; 3 | import 'enums/template_type.dart'; 4 | 5 | /// Card Template data. 6 | class Template { 7 | /// [Template] Constructor 8 | Template({ 9 | required this.templateType, 10 | required this.containers, 11 | required this.kvPairs, 12 | }); 13 | 14 | /// Get [Template] from Json [Map] 15 | factory Template.fromJson(Map json) { 16 | return Template( 17 | templateType: TemplateType.values.byName(json[keyTemplateType] as String), 18 | containers: List.from( 19 | ((json[keyContainers] ?? []) as Iterable).map( 20 | (dataJson) => Container.fromJson(dataJson as Map), 21 | ), 22 | ), 23 | kvPairs: 24 | (json[keyKVPairs] ?? {}) as Map, 25 | ); 26 | } 27 | 28 | /// Type of Template 29 | TemplateType templateType; 30 | 31 | /// Containers in the template. 32 | List containers; 33 | 34 | /// Additional data associated to the template 35 | Map kvPairs; 36 | 37 | /// Convert [Template] to Json [Map] 38 | Map toJson() => { 39 | keyTemplateType: templateType.name, 40 | keyContainers: containers.map((Container e) => e.toJson()).toList(), 41 | keyKVPairs: kvPairs 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_cards_platform_interface 2 | description: A common platform interface for the moengage_cards plugin. 3 | version: 4.0.2 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | moengage_flutter: ^9.0.0 14 | plugin_platform_interface: ^2.1.0 15 | 16 | dev_dependencies: 17 | collection: ^1.16.0 18 | flutter_test: 19 | sdk: flutter 20 | -------------------------------------------------------------------------------- /packages/moengage_cards/moengage_cards_platform_interface/test/cards_mock_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:moengage_cards_platform_interface/src/internal/method_channel_moengage_cards.dart'; 2 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 3 | 4 | /// Mock Platform Interface. 5 | class MockCardsPlatform extends MethodChannelMoEngageCards 6 | with MockPlatformInterfaceMixin {} 7 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "9.2.1" 3 | } 4 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/example/README.md: -------------------------------------------------------------------------------- 1 | # moengage_flutter_example 2 | 3 | Demonstrates how to use the moengage_flutter plugin. 4 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/lib/moengage_flutter.dart: -------------------------------------------------------------------------------- 1 | export 'package:moengage_flutter/src/moengage_flutter.dart'; 2 | export 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart'; 3 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_flutter 2 | description: Flutter Plugin for MoEngage Platform. MoEngage is an Intelligent Customer Engagement Platform 3 | version: 9.2.1 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | assets: 12 | - config.json 13 | plugin: 14 | platforms: 15 | android: 16 | default_package: moengage_flutter_android 17 | ios: 18 | default_package: moengage_flutter_ios 19 | web: 20 | default_package: moengage_flutter_web 21 | 22 | dependencies: 23 | flutter: 24 | sdk: flutter 25 | moengage_flutter_android: 3.3.1 26 | moengage_flutter_ios: 3.3.0 27 | moengage_flutter_platform_interface: 3.2.0 28 | moengage_flutter_web: 4.1.0 29 | 30 | dev_dependencies: 31 | flutter_test: 32 | sdk: flutter 33 | mocktail: ^0.3.0 34 | plugin_platform_interface: ^2.0.0 35 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/test/data_provider/data_provider.dart: -------------------------------------------------------------------------------- 1 | const num number = 10.56; 2 | 3 | const setUserAttributesData = { 4 | 'bool': true, 5 | 'int': 10, 6 | 'double': 10.5, 7 | 'num': number, 8 | 'string': 'data', 9 | 'int-array': [1, 2, 3, 4], 10 | 'double-array': [1.0, 1.5, 2.456], 11 | 'num-array': [1.04, 1, 2.456], 12 | 'string-array': ['data', 'array'] 13 | }; 14 | 15 | const unsetUserAttributesData = {'obj': {}}; 16 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/test/mock_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:moengage_flutter_platform_interface/src/internal/method_channel_moengage_flutter.dart'; 2 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 3 | 4 | /// Mock Platform Interface. 5 | class MockMoEngageFlutterPlatform extends MethodChannelMoEngageFlutter 6 | with MockPlatformInterfaceMixin { 7 | String? setUserAttributeLastUserAttributeName; 8 | dynamic setUserAttributeLastUserAttributeValue; 9 | String? setUserAttributeLastAppId; 10 | 11 | @override 12 | void setUserAttribute( 13 | String userAttributeName, userAttributeValue, String appId) { 14 | setUserAttributeLastUserAttributeName = userAttributeName; 15 | setUserAttributeLastUserAttributeValue = userAttributeValue; 16 | setUserAttributeLastAppId = appId; 17 | } 18 | 19 | void clear() { 20 | setUserAttributeLastUserAttributeName = null; 21 | setUserAttributeLastUserAttributeValue = null; 22 | setUserAttributeLastAppId = null; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter/test/moengage_flutter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:moengage_flutter/moengage_flutter.dart'; 3 | 4 | import 'data_provider/data_provider.dart'; 5 | import 'mock_platform.dart'; 6 | 7 | void main() { 8 | TestWidgetsFlutterBinding.ensureInitialized(); 9 | final MockMoEngageFlutterPlatform mock = MockMoEngageFlutterPlatform(); 10 | MoEngageFlutterPlatform.instance = mock; 11 | 12 | tearDown(() => {mock.clear()}); 13 | 14 | test('User Attributes set', () async { 15 | final platform = MoEngageFlutter('12345'); 16 | for (final entry in setUserAttributesData.entries) { 17 | platform.setUserAttribute(entry.key, entry.value); 18 | expect(mock.setUserAttributeLastUserAttributeName, entry.key); 19 | expect(mock.setUserAttributeLastUserAttributeValue, entry.value); 20 | } 21 | }); 22 | 23 | test('User Attributes not set', () async { 24 | final platform = MoEngageFlutter('12345'); 25 | for (final entry in unsetUserAttributesData.entries) { 26 | platform.setUserAttribute(entry.key, entry.value); 27 | expect(mock.setUserAttributeLastUserAttributeName, null); 28 | expect(mock.setUserAttributeLastUserAttributeValue, null); 29 | } 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_flutter\_android 2 | 3 | The Android implementation of [`moengage_flutter`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_flutter` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_flutter 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | moengage_flutter 4 | Project moengage_flutter created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 10 12:53:35 IST 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'moengage_flutter' 2 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/src/main/kotlin/com/moengage/flutter/GlobalCache.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.flutter 2 | 3 | internal object GlobalCache { 4 | // Flag to Enable Queuing of events on App Background and on next App Open, the events will be flushed. 5 | var lifecycleAwareCallbackEnabled: Boolean = false 6 | } -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/src/main/kotlin/com/moengage/flutter/MoEFlutterHelper.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.flutter 2 | 3 | import com.moengage.core.internal.inapp.InAppManager 4 | import com.moengage.core.internal.logger.Logger 5 | import com.moengage.inapp.MoEInAppHelper 6 | 7 | /** 8 | * @author Arshiya Khanum 9 | */ 10 | public class MoEFlutterHelper { 11 | private val tag = "${MODULE_TAG}MoEFlutterHelper" 12 | 13 | public companion object { 14 | private var instance: MoEFlutterHelper? = null 15 | 16 | @JvmStatic 17 | public fun getInstance(): MoEFlutterHelper { 18 | return instance ?: synchronized(MoEFlutterHelper::class.java) { 19 | val inst = instance ?: MoEFlutterHelper() 20 | instance = inst 21 | inst 22 | } 23 | } 24 | } 25 | 26 | public fun onConfigurationChanged() { 27 | Logger.print { "$tag onConfigurationChanged() : " } 28 | if (!InAppManager.hasModule()) { 29 | Logger.print { "$tag onConfigurationChanged() : InApp module not found." } 30 | return 31 | } 32 | MoEInAppHelper.getInstance().onConfigurationChanged() 33 | } 34 | } -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/android/user-agent.gradle: -------------------------------------------------------------------------------- 1 | import java.util.regex.Matcher 2 | import java.util.regex.Pattern 3 | 4 | String libraryVersionName = "UNKNOWN" 5 | File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') 6 | 7 | if (pubspec.exists()) { 8 | String yaml = pubspec.text 9 | // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. 10 | Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) 11 | if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") 12 | } 13 | 14 | android { 15 | defaultConfig { 16 | // BuildConfig.VERSION_NAME 17 | buildConfigField("String", 'MOENGAGE_FLUTTER_LIBRARY_VERSION', "\"${libraryVersionName}\"") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/lib/src/internal/utils/payload_mapper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart'; 4 | 5 | /// Payload Mapper Util Class to convert JSON Payloads to Model Class 6 | /// @since 1.1.0 7 | class PayloadMapper { 8 | /// Log tag for Payload Mapper 9 | final tag = '${TAG}PayloadMapper'; 10 | 11 | /// Get [UserDeletionData] from Json String Payload 12 | /// [data] - JSON String Payload 13 | /// [appId] - MoEngage APP-Id 14 | /// @since 1.1.0 15 | UserDeletionData deSerializeDeleteUserData(String data, String appId) { 16 | try { 17 | final payload = jsonDecode(data) as Map; 18 | Logger.v('$tag deSerializeDeleteUserData(): $data'); 19 | return UserDeletionData( 20 | accountMeta: accountMetaFromMap( 21 | payload[keyAccountMeta] as Map), 22 | isSuccess: 23 | (payload[keyData][keyUserDeletionStatus] ?? false) as bool); 24 | } catch (ex) { 25 | Logger.e(' $tag deSerializeDeleteUserData(): Parsing Error', error: ex); 26 | return UserDeletionData( 27 | accountMeta: AccountMeta(appId), isSuccess: false); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_flutter_android 2 | description: Android implementation of the moengage_flutter plugin 3 | version: 3.3.1 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_flutter 13 | platforms: 14 | android: 15 | package: com.moengage.flutter 16 | pluginClass: MoEngageFlutterPlugin 17 | dartPluginClass: MoEngageFlutterAndroid 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | moengage_flutter_platform_interface: ^3.0.0 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | plugin_platform_interface: ^2.0.0 28 | 29 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/test/comparator.dart: -------------------------------------------------------------------------------- 1 | import 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart'; 2 | 3 | class Comparator { 4 | bool isUserDeletionDataEqual(UserDeletionData data1, UserDeletionData data2) { 5 | return data1.isSuccess == data2.isSuccess && 6 | isAccountMetaEqual(data1.accountMeta, data2.accountMeta); 7 | } 8 | 9 | bool isAccountMetaEqual(AccountMeta accountMeta1, AccountMeta accountMeta2) { 10 | return accountMeta1.appId == accountMeta2.appId; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/test/dataprovider/data_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart'; 2 | 3 | UserDeletionData userDeletionData = 4 | UserDeletionData(accountMeta: AccountMeta('1234'), isSuccess: true); 5 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/test/dataprovider/json_data.dart: -------------------------------------------------------------------------------- 1 | const String appId = '1234'; 2 | 3 | const String userDeletionJson = ''' 4 | { 5 | "accountMeta": { 6 | "appId": "1234" 7 | }, 8 | "data": { 9 | "isUserDeletionSuccess":true 10 | } 11 | } 12 | '''; 13 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_android/test/parser_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:moengage_flutter_android/src/internal/utils/payload_mapper.dart'; 3 | 4 | import 'comparator.dart'; 5 | import 'dataprovider/data_provider.dart'; 6 | import 'dataprovider/json_data.dart'; 7 | 8 | void main() { 9 | test('Test User Deletion Payload', () { 10 | expect( 11 | Comparator().isUserDeletionDataEqual( 12 | PayloadMapper().deSerializeDeleteUserData(userDeletionJson, appId), 13 | userDeletionData), 14 | true); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_flutter\_ios 2 | 3 | The iOS implementation of [`moengage_flutter`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_flutter` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_flutter 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/packages/moengage_flutter/moengage_flutter_ios/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/Classes/MoEngageFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface MoEngageFlutterPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/Classes/MoEngageFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "MoEngageFlutterPlugin.h" 2 | #import 3 | 4 | @implementation MoEngageFlutterPlugin 5 | + (void)registerWithRegistrar:(NSObject*)registrar { 6 | [MoEngageFlutterBridge registerWithRegistrar:registrar]; 7 | } 8 | @end 9 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/Classes/MoEngageFlutterPluginInfo.swift: -------------------------------------------------------------------------------- 1 | // Generated file, do not edit 2 | import Foundation 3 | struct MoEngageFlutterPluginInfo{ 4 | static let kVersion = "3.2.1" 5 | } 6 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/Classes/MoEngageFlutterUtil.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MoEngageFlutterUtil.swift 3 | // moengage_flutter_ios 4 | // 5 | // Created by Rakshitha on 11/09/24. 6 | // 7 | 8 | import Foundation 9 | import MoEngageCore 10 | 11 | enum MoEngageFlutterUtil { 12 | static func resume(channel method: String, havingResult result: @escaping FlutterResult, withData data: [String: Any]) { 13 | let resultData = serialize(data: data) 14 | MoEngageLogger.logDefault(message: "Response payload in PluginBase for method - \(method) is \(resultData)") 15 | DispatchQueue.main.async { result(resultData) } 16 | } 17 | 18 | static func serialize(data: [String: Any]) -> String { 19 | if let jsonData = try? JSONSerialization.data(withJSONObject: data), 20 | let jsonStr = String(data: jsonData, encoding: .utf8) { 21 | return jsonStr 22 | } else { 23 | return "" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/ios/moengage_flutter_ios.podspec: -------------------------------------------------------------------------------- 1 | 2 | require 'yaml' 3 | pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) 4 | libraryVersion = pubspec['version'].gsub('+', '-') 5 | 6 | Pod::Spec.new do |s| 7 | s.name = 'moengage_flutter_ios' 8 | s.version = libraryVersion 9 | s.platform = :ios 10 | s.ios.deployment_target = '11.0' 11 | s.summary = 'A flutter plugin for MoEngage iOS and Android SDKs.' 12 | s.description = <<-DESC 13 | A flutter plugin for MoEngage iOS and Android SDKs. 14 | DESC 15 | s.homepage = 'https://www.moengage.com/' 16 | s.license = { :file => '../LICENSE' } 17 | s.author = { 'MoEngage Inc.' => 'mobiledevs@moengage.com' } 18 | s.source = { :path => '.' } 19 | s.source_files = 'Classes/**/*' 20 | s.public_header_files = 'Classes/**/*.h' 21 | s.dependency 'Flutter' 22 | s.dependency 'MoEngagePluginBase', '5.3.0' 23 | s.swift_version = '5.0' 24 | s.prepare_command = <<-CMD 25 | echo // Generated file, do not edit > Classes/MoEngageFlutterPluginInfo.swift 26 | echo "import Foundation" >> Classes/MoEngageFlutterPluginInfo.swift 27 | echo "struct MoEngageFlutterPluginInfo{\n static let kVersion = \\"#{libraryVersion}\\" \n }" >> Classes/MoEngageFlutterPluginInfo.swift 28 | CMD 29 | 30 | end 31 | 32 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_flutter_ios 2 | description: iOS implementation of the moengage_flutter plugin 3 | version: 3.3.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_flutter 13 | platforms: 14 | ios: 15 | pluginClass: MoEngageFlutterPlugin 16 | dartPluginClass: MoEngageFlutterIOS 17 | 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | moengage_flutter_platform_interface: ^3.0.0 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | plugin_platform_interface: ^2.0.0 27 | 28 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_ios/test/moengage_flutter_ios_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Flutter Platform Interface 2 | 3 | # 25-03-2025 4 | 5 | ## 3.2.0 6 | - Adding support for identify user based on multiple identities 7 | 8 | # 25-11-2024 9 | 10 | ## 3.1.1 11 | - Internal improvements. 12 | 13 | # 30-09-2024 14 | 15 | ## 3.1.0 16 | 17 | - Added support for multiple self-handled in-apps 18 | 19 | # 07-08-2024 20 | 21 | ## 3.0.0 22 | - iOS 23 | - Added boolean user attribute tracking customization in initialization API 24 | 25 | # 03-07-2024 26 | 27 | ## 2.1.0 28 | - Added object type in accepted data and array types 29 | - Letting object type data pass through _addAttribute method 30 | 31 | # 21-03-2024 32 | 33 | ## 2.0.0 34 | - Removed support for Mi Push 35 | - Non-intrusive Nudges support 36 | - Send SelfHandled InApp Callback when data is null 37 | 38 | # 07-12-2023 39 | 40 | ## 1.1.0 41 | - Google Policy - Delete User details API 42 | - Added support for array in user attributes 43 | 44 | # 13-09-2023 45 | 46 | ## 1.0.0 47 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/README.md: -------------------------------------------------------------------------------- 1 | # moengage_flutter_platform_interface 2 | 3 | A common platform interface for the [`moengage_flutter`][1] plugin. 4 | 5 | This interface allows platform-specific implementations of the `moengage_flutter` 6 | plugin, as well as the plugin itself, to ensure they are supporting the 7 | same interface. 8 | 9 | # Usage 10 | 11 | To implement a new platform-specific implementation of `moengage_flutter`, extend 12 | [`MoEngageFlutterPlatform`][2] with an implementation that performs the 13 | platform-specific behavior, and when you register your plugin, set the default 14 | `MoEngageFlutterPlatform` by calling 15 | `MoEngageFlutterPlatform.instance = MyPlatformMoEngageFlutter()`. 16 | 17 | # Note on breaking changes 18 | 19 | Strongly prefer non-breaking changes (such as adding a method to the interface) 20 | over breaking changes for this package. 21 | 22 | See https://flutter.dev/go/platform-interface-breaking-changes for a discussion 23 | on why a less-clean interface is preferable to a breaking change. 24 | 25 | [1]: ../moengage_flutter 26 | [2]: lib/moengage_flutter_platform_interface.dart -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/internal/callback/callback_cache.dart: -------------------------------------------------------------------------------- 1 | import '../../../moengage_flutter_platform_interface.dart'; 2 | 3 | /// Native to Flutter Callback Cache 4 | class CallbackCache { 5 | /// Push Click Callback 6 | PushClickCallbackHandler? pushClickCallbackHandler; 7 | 8 | /// SelfHandledInApp Callback 9 | SelfHandledInAppCallbackHandler? selfHandledInAppCallbackHandler; 10 | 11 | /// InApp Click Callback 12 | InAppClickCallbackHandler? inAppClickCallbackHandler; 13 | 14 | /// InApp Shown Callback 15 | InAppShownCallbackHandler? inAppShownCallbackHandler; 16 | 17 | /// InApp Dismiss Callback 18 | InAppDismissedCallbackHandler? inAppDismissedCallbackHandler; 19 | } 20 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/internal/callback/callbacks.dart: -------------------------------------------------------------------------------- 1 | import '../../model/inapp/click_data.dart'; 2 | import '../../model/inapp/inapp_data.dart'; 3 | import '../../model/inapp/self_handled_data.dart'; 4 | import '../../model/permission_result.dart'; 5 | import '../../model/push/push_campaign_data.dart'; 6 | import '../../model/push/push_token_data.dart'; 7 | 8 | /// Push Click Callback 9 | typedef PushClickCallbackHandler = void Function(PushCampaignData data); 10 | 11 | /// PushToken Callback 12 | typedef PushTokenCallbackHandler = void Function(PushTokenData data); 13 | 14 | /// Self Handled InApp Available Callback 15 | typedef SelfHandledInAppCallbackHandler = void Function( 16 | SelfHandledCampaignData? data); 17 | 18 | /// InApp Click Action Callback 19 | typedef InAppClickCallbackHandler = void Function(ClickData data); 20 | 21 | /// InApp Shown Callback 22 | typedef InAppShownCallbackHandler = void Function(InAppData data); 23 | 24 | /// InApp Dismiss Callback 25 | typedef InAppDismissedCallbackHandler = void Function(InAppData data); 26 | 27 | /// Push Permission Result Callback 28 | typedef PermissionResultCallbackHandler = void Function( 29 | PermissionResultData data); 30 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/internal/core_instance_provider.dart: -------------------------------------------------------------------------------- 1 | import 'callback/callback_cache.dart'; 2 | 3 | /// Instance Specific Cache for Callbacks 4 | class CoreInstanceProvider { 5 | /// [CoreInstanceProvider] Constructor 6 | factory CoreInstanceProvider() => _instance; 7 | 8 | CoreInstanceProvider._internal(); 9 | static final CoreInstanceProvider _instance = 10 | CoreInstanceProvider._internal(); 11 | 12 | final Map _caches = {}; 13 | 14 | /// Get [CallbackCache] instance For provided MoEngage App Id 15 | CallbackCache getCallbackCacheForInstance(String appId) { 16 | final CallbackCache? cache = _caches[appId]; 17 | if (cache != null) { 18 | return cache; 19 | } else { 20 | final CallbackCache instanceCache = CallbackCache(); 21 | _caches[appId] = instanceCache; 22 | return instanceCache; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/internal/moe_cache.dart: -------------------------------------------------------------------------------- 1 | import 'callback/callbacks.dart'; 2 | 3 | /// Core Cache 4 | class Cache { 5 | /// Factory Constructor 6 | factory Cache() => _instance; 7 | 8 | Cache._internal(); 9 | 10 | static final Cache _instance = Cache._internal(); 11 | 12 | /// Push Token Result Callback 13 | PushTokenCallbackHandler? pushTokenCallbackHandler; 14 | 15 | /// Permission Result Callback 16 | PermissionResultCallbackHandler? permissionResultCallbackHandler; 17 | } 18 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/log_level.dart: -------------------------------------------------------------------------------- 1 | ///Log Level to handle type of Log 2 | enum LogLevel { 3 | /// No logs from the SDK would be printed. 4 | NO_LOG, 5 | 6 | /// Error logs from the SDK would be printed. 7 | ERROR, 8 | 9 | /// Warning logs from the SDK would be printed. 10 | WARN, 11 | 12 | /// Info logs from the SDK would be printed. 13 | INFO, 14 | 15 | /// Debug logs from the SDK would be printed. 16 | DEBUG, 17 | 18 | /// Verbose logs from the SDK would be printed. 19 | VERBOSE 20 | } 21 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/account_meta.dart: -------------------------------------------------------------------------------- 1 | /// Account Meta 2 | class AccountMeta { 3 | /// [AccountMeta] Constructor 4 | AccountMeta(this.appId); 5 | 6 | /// MoEngage AppId 7 | String appId; 8 | 9 | @override 10 | String toString() { 11 | return '{\nappId: $appId\n}'; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/analytics/analytics_config.dart: -------------------------------------------------------------------------------- 1 | /// Analytics Config 2 | class AnalyticsConfig { 3 | /// [AnalyticsConfig] Constructor 4 | AnalyticsConfig({required this.shouldTrackUserAttributeBooleanAsNumber}); 5 | 6 | /// [AnalyticsConfig] Default Named Constructor 7 | AnalyticsConfig.defaultConfig() 8 | : this(shouldTrackUserAttributeBooleanAsNumber: false); 9 | 10 | /// If [shouldTrackUserAttributeBooleanAsNumber] is true, 11 | /// boolean values in user-attributes are tracked as 0/1 in iOS 12 | /// instead of false/true respectively. 13 | bool shouldTrackUserAttributeBooleanAsNumber; 14 | } 15 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/app_status.dart: -------------------------------------------------------------------------------- 1 | /// Application Status 2 | enum MoEAppStatus { 3 | /// Fresh installation of the app instance. 4 | install, 5 | 6 | /// App was already present and user has updated the app 7 | update 8 | } 9 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/gender.dart: -------------------------------------------------------------------------------- 1 | import '../internal/constants.dart'; 2 | 3 | /// User attribute Gender options 4 | enum MoEGender { 5 | /// User Gender Male 6 | male, 7 | 8 | /// User Gender Female 9 | female, 10 | 11 | /// User Gender Other 12 | other 13 | } 14 | 15 | /// Convert Gender to String 16 | String genderToString(MoEGender gender) { 17 | switch (gender) { 18 | case MoEGender.male: 19 | return genderMale; 20 | case MoEGender.female: 21 | return genderFemale; 22 | case MoEGender.other: 23 | return genderOther; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/geo_location.dart: -------------------------------------------------------------------------------- 1 | /// User Attribute Location Attribute 2 | class MoEGeoLocation { 3 | /// [MoEGeoLocation] Constructor 4 | MoEGeoLocation(this.latitude, this.longitude); 5 | 6 | ///Latitude of location 7 | double latitude; 8 | 9 | /// Longitude of location 10 | double longitude; 11 | 12 | /// Convert [MoEGeoLocation] to Json [Map] 13 | Map toMap() { 14 | return {'latitude': latitude, 'longitude': longitude}; 15 | } 16 | 17 | @override 18 | String toString() { 19 | return '{\nlatitude: $latitude\nlatitude: $longitude\n}'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/action.dart: -------------------------------------------------------------------------------- 1 | import 'inapp_action_type.dart'; 2 | 3 | /// InApp Base Action 4 | abstract class Action { 5 | /// Base Constructor for Action 6 | Action(this.actionType); 7 | 8 | /// Type of Action 9 | ActionType actionType; 10 | } 11 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/campaign_context.dart: -------------------------------------------------------------------------------- 1 | /// Context of InApp Campaign 2 | class CampaignContext { 3 | /// [CampaignContext] Constructor 4 | CampaignContext(this.formattedCampaignId, this.attributes); 5 | 6 | /// Formatted Campaign Id 7 | String formattedCampaignId; 8 | 9 | /// Campaign Attributes 10 | Map attributes; 11 | 12 | @override 13 | String toString() { 14 | return '{\nformattedCampaignId: $formattedCampaignId\nattributes: $attributes\n}'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/campaign_data.dart: -------------------------------------------------------------------------------- 1 | import 'campaign_context.dart'; 2 | 3 | /// InApp Campaign Data 4 | class CampaignData { 5 | /// [CampaignData] Constructor 6 | CampaignData(this.campaignId, this.campaignName, this.context); 7 | 8 | /// InApp Campaign Id 9 | String campaignId; 10 | 11 | /// InApp Campaign Name 12 | String campaignName; 13 | 14 | /// Campaign Context of type [CampaignContext] 15 | CampaignContext context; 16 | 17 | @override 18 | String toString() { 19 | return '{\ncampaignId: $campaignId\ncampaignName: $campaignName\ncontext: $context\n}'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/click_data.dart: -------------------------------------------------------------------------------- 1 | import '../../model/account_meta.dart'; 2 | import '../inapp/action.dart'; 3 | import '../platforms.dart'; 4 | import 'campaign_data.dart'; 5 | 6 | /// InApp Click Data 7 | class ClickData { 8 | /// [ClickData] Constructor 9 | ClickData(this.platform, this.accountMeta, this.campaignData, this.action); 10 | 11 | /// Type of Platform [Android/IOS] 12 | Platforms platform; 13 | 14 | /// Instance of [AccountMeta] 15 | AccountMeta accountMeta; 16 | 17 | /// InApp Campaign Related Data 18 | CampaignData campaignData; 19 | 20 | /// InApp Action 21 | Action action; 22 | 23 | @override 24 | String toString() { 25 | return '{\nplatform: ${platform.asString}\naccountMeta: $accountMeta\ncampaignData: $campaignData\naction: $action\n}'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/display_rules.dart: -------------------------------------------------------------------------------- 1 | import '../../../moengage_flutter_platform_interface.dart'; 2 | 3 | /// InApp Campaign Display Rules 4 | class Rules { 5 | /// Creates an instance of [Rules] with the provided [screenName] and [context] 6 | Rules({this.screenName, List? context}) : context = context ?? []; 7 | 8 | /// Get [Rules] from Json [Map] 9 | factory Rules.fromJson(Map json) => Rules( 10 | screenName: (json[keyScreenName] ?? '').toString(), 11 | context: List.from((json[keyContexts] ?? []) as Iterable) 12 | .map((e) => e.toString()) 13 | .toList(), 14 | ); 15 | 16 | /// Screen name on which the campaign should be shown. 17 | String? screenName; 18 | 19 | /// Context for which the campaign should be shown. 20 | List context; 21 | 22 | @override 23 | String toString() { 24 | return 'Rules{screenName: $screenName, context: $context}'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/inapp_action_type.dart: -------------------------------------------------------------------------------- 1 | /// InApp Action Type 2 | enum ActionType { 3 | /// Navigation Action 4 | navigation, 5 | 6 | /// Custom Action 7 | custom 8 | } 9 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/inapp_custom_action.dart: -------------------------------------------------------------------------------- 1 | import '../inapp/action.dart'; 2 | 3 | /// Custom Action 4 | class CustomAction extends Action { 5 | /// [CustomAction] Constructor 6 | /// [actionType] Instance of [ActionType] 7 | /// [keyValuePairs] Key Value Pair Data 8 | CustomAction(super.actionType, this.keyValuePairs); 9 | 10 | ///Key-Value Pair entered on the MoEngage Platform during campaign creation. 11 | Map keyValuePairs; 12 | 13 | @override 14 | String toString() { 15 | return '{\nactionType: $actionType\nkeyValuePairs: $keyValuePairs\n}'; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/inapp_data.dart: -------------------------------------------------------------------------------- 1 | import '../../model/account_meta.dart'; 2 | import '../platforms.dart'; 3 | import 'campaign_data.dart'; 4 | 5 | /// InApp Data 6 | class InAppData { 7 | /// [InAppData] Constructor 8 | InAppData(this.platform, this.accountMeta, this.campaignData); 9 | 10 | /// Type of Platform [Android/IOS] 11 | Platforms platform; 12 | 13 | /// Instance of [AccountMeta] 14 | AccountMeta accountMeta; 15 | 16 | /// InApp Campaign Related Data 17 | CampaignData campaignData; 18 | 19 | @override 20 | String toString() { 21 | return '{\nplatform: ${platform.asString}\naccountMeta: $accountMeta\ncampaignData: $campaignData\n}'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/navigation_action.dart: -------------------------------------------------------------------------------- 1 | import '../inapp/action.dart'; 2 | import 'navigation_type.dart'; 3 | 4 | /// Navigation Action Data 5 | class NavigationAction extends Action { 6 | /// [NavigationAction] Constructor 7 | NavigationAction(super.actionType, this.navigationType, this.navigationUrl, 8 | this.keyValuePairs); 9 | 10 | /// Type of Navigation action. 11 | /// 12 | /// Possible value deep_linking or screen 13 | NavigationType navigationType; 14 | 15 | /// Deeplink Url or the Screen Name used for the action. 16 | String navigationUrl; 17 | 18 | /// [Map] of Key-Value pairs entered on the MoEngage Platform for 19 | /// navigation action of the campaign. 20 | Map keyValuePairs; 21 | 22 | @override 23 | String toString() { 24 | return '{\nactionType: $actionType\nnavigationType: $navigationType\nnavigationUrl: $navigationUrl\nkeyValuePairs: $keyValuePairs\n}'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/navigation_type.dart: -------------------------------------------------------------------------------- 1 | /// Navigation Types for Navigation Action 2 | enum NavigationType { 3 | /// Screen Name Navigation 4 | screenName, 5 | 6 | /// DeepLink Navigation 7 | deeplink 8 | } 9 | 10 | /// Extension for Converting Navigation Type Enum to String 11 | extension NavigationTypeExtension on NavigationType { 12 | /// Get [NavigationType] from [String] 13 | static NavigationType fromString(String navigationType) { 14 | switch (navigationType) { 15 | case _screenName: 16 | return NavigationType.screenName; 17 | case _deeplink: 18 | return NavigationType.deeplink; 19 | default: 20 | throw Exception( 21 | 'NavigationType.fromString() $navigationType not a valid navigation type.'); 22 | } 23 | } 24 | } 25 | 26 | const String _screenName = 'screen'; 27 | const String _deeplink = 'deep_linking'; 28 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/nudge_position.dart: -------------------------------------------------------------------------------- 1 | /// Position for Non-Intrusive Nudge Campaigns 2 | /// @since 2.0.0 3 | enum MoEngageNudgePosition { 4 | /// For nudge to be shown at the TOP 5 | top, 6 | 7 | /// For nudge to be shown at the BOTTOM 8 | bottom, 9 | 10 | /// For nudge to be shown at the BOTTOM_RIGHT 11 | bottomRight, 12 | 13 | /// For nudge to be shown at the BOTTOM_LEFT 14 | bottomLeft, 15 | 16 | /// For nudge to be shown at any available position 17 | any; 18 | } 19 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/self_handled_campaign.dart: -------------------------------------------------------------------------------- 1 | import 'display_rules.dart'; 2 | 3 | /// Self Handled Inpp Campaign Data 4 | class SelfHandledCampaign { 5 | /// [SelfHandledCampaign] Constructor 6 | SelfHandledCampaign(this.payload, this.dismissInterval, this.displayRules); 7 | 8 | /// Self handled campaign payload. 9 | String payload; 10 | 11 | /// Interval after which in-app should be dismissed, unit - Seconds 12 | int dismissInterval; 13 | 14 | /// InApp Campaign Display Rules 15 | Rules displayRules; 16 | 17 | @override 18 | String toString() { 19 | return 'SelfHandledCampaign{payload: $payload, dismissInterval: $dismissInterval, rules: $displayRules}'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/self_handled_campaigns_data.dart: -------------------------------------------------------------------------------- 1 | import '../../../moengage_flutter_platform_interface.dart'; 2 | 3 | /// Data for multiple Self Handled InApp Campaigns 4 | class SelfHandledCampaignsData { 5 | /// Creates an instance of [SelfHandledCampaignsData] with the provided [accountMeta] and [campaigns] 6 | SelfHandledCampaignsData( 7 | {required this.accountMeta, required this.campaigns}); 8 | 9 | /// Instance of [AccountMeta] 10 | AccountMeta accountMeta; 11 | 12 | /// List of [SelfHandledCampaignData] to be sent as part of callback to the client 13 | List campaigns; 14 | 15 | @override 16 | String toString() { 17 | return 'SelfHandledCampaignsData{accountMeta: $accountMeta, campaigns: $campaigns}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/inapp/self_handled_data.dart: -------------------------------------------------------------------------------- 1 | import '../../model/account_meta.dart'; 2 | import '../inapp/campaign_data.dart'; 3 | import '../platforms.dart'; 4 | import 'self_handled_campaign.dart'; 5 | 6 | /// Self Handled InApp Campaign Data 7 | class SelfHandledCampaignData { 8 | /// [SelfHandledCampaignData] Constructor 9 | SelfHandledCampaignData( 10 | this.campaignData, this.accountMeta, this.campaign, this.platform); 11 | 12 | /// Campaign Data of type [CampaignData] 13 | CampaignData campaignData; 14 | 15 | /// Instance of [AccountMeta] 16 | AccountMeta accountMeta; 17 | 18 | /// Self Handled Campaign Data 19 | SelfHandledCampaign campaign; 20 | 21 | /// Type of Platform [Android/IOS] 22 | Platforms platform; 23 | 24 | @override 25 | String toString() { 26 | return '{\ncampaignData: $campaignData\naccountMeta: $accountMeta\ncampaign: $campaign\nplatform: ${platform.asString}\n}'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/moe_init_config.dart: -------------------------------------------------------------------------------- 1 | import '../model/push/push_config.dart'; 2 | import 'analytics/analytics_config.dart'; 3 | 4 | /// Init Config instance to be passed during initialization. If it is not passed 5 | /// default values will be used. 6 | class MoEInitConfig { 7 | /// [MoEInitConfig] Constructor 8 | MoEInitConfig({PushConfig? pushConfig, AnalyticsConfig? analyticsConfig}) 9 | : pushConfig = pushConfig ?? PushConfig.defaultConfig(), 10 | analyticsConfig = analyticsConfig ?? AnalyticsConfig.defaultConfig(); 11 | 12 | /// Named Constructor with Default Config 13 | MoEInitConfig.defaultConfig() : this(); 14 | 15 | /// Instance of [PushConfig] - Configuration for Handling Push Notification 16 | PushConfig pushConfig; 17 | 18 | /// Instance of [AnalyticsConfig] - Configuration for Handling Data Tracking 19 | AnalyticsConfig analyticsConfig; 20 | } 21 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/permission_result.dart: -------------------------------------------------------------------------------- 1 | import '../model/permission_type.dart'; 2 | import 'platforms.dart'; 3 | 4 | /// Permission Result Data 5 | class PermissionResultData { 6 | /// [PermissionResultData] Constructor 7 | PermissionResultData(this.platform, this.isGranted, this.type); 8 | 9 | /// Type of Platform [Android/IOS] 10 | Platforms platform; 11 | 12 | /// Permission Granted Status 13 | bool isGranted; 14 | 15 | /// Permission Type 16 | PermissionType type; 17 | 18 | @override 19 | String toString() { 20 | return '{\nplatform: $platform,\nisGranted: $isGranted,\ntype: $type\n}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/permission_type.dart: -------------------------------------------------------------------------------- 1 | /// Permission Type 2 | enum PermissionType { 3 | /// Push Permission Type 4 | PUSH 5 | } 6 | 7 | /// Permission Type Extension 8 | extension PermissionTypeExtension on PermissionType { 9 | /// [PermissionType] From String 10 | static PermissionType fromString(String permissionType) { 11 | switch (permissionType) { 12 | case _permissionTypePush: 13 | return PermissionType.PUSH; 14 | default: 15 | throw Exception( 16 | 'PermissionType.fromString() $permissionType not a valid platform type.'); 17 | } 18 | } 19 | 20 | /// Convert [PermissionType] to String 21 | String get asString { 22 | switch (this) { 23 | case PermissionType.PUSH: 24 | return _permissionTypePush; 25 | } 26 | } 27 | } 28 | 29 | const String _permissionTypePush = 'push'; 30 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/platforms.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | /// Type of Platform 4 | enum Platforms { 5 | /// Android Platform 6 | android, 7 | 8 | /// Platform IOS 9 | iOS 10 | } 11 | 12 | /// Extension for [Platforms] 13 | extension PlatformsExtension on Platforms { 14 | /// Convert [Platforms] to String 15 | String get asString { 16 | switch (this) { 17 | case Platforms.android: 18 | return _platformAndroid; 19 | case Platforms.iOS: 20 | return _platformIOS; 21 | } 22 | } 23 | 24 | /// Get [Platforms] instance From String 25 | static Platforms fromString(String platform) { 26 | switch (platform) { 27 | case _platformIOS: 28 | return Platforms.iOS; 29 | case _platformAndroid: 30 | return Platforms.android; 31 | default: 32 | throw Exception( 33 | 'Platforms.fromString() $platform not a valid platform type.'); 34 | } 35 | } 36 | } 37 | 38 | /// Get Current Platform 39 | String? getPlatform() { 40 | if (Platform.isAndroid) { 41 | return _platformAndroid; 42 | } else if (Platform.isIOS) { 43 | return _platformIOS; 44 | } 45 | return null; 46 | } 47 | 48 | const String _platformAndroid = 'android'; 49 | const String _platformIOS = 'iOS'; 50 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/push/push_campaign.dart: -------------------------------------------------------------------------------- 1 | import '../../internal/constants.dart'; 2 | 3 | /// Push Campaign Related Data 4 | class PushCampaign { 5 | /// [PushCampaign] Constructor 6 | PushCampaign(this.isDefaultAction, this.clickedAction, this.payload, 7 | this.selfHandledPushRedirection); 8 | 9 | /// Default Push Click Action 10 | bool isDefaultAction; 11 | 12 | /// Click Action Data 13 | Map clickedAction; 14 | 15 | /// Campaign payload 16 | Map payload; 17 | 18 | /// If true, MoEngage SDK will not handle Push redirection for Screen name 19 | /// and DeepLinking Push Notifications. Client should handle redirection. 20 | bool selfHandledPushRedirection = false; 21 | 22 | /// To Convert [PushCampaign] to [Map] 23 | Map toMap() { 24 | return { 25 | keyIsDefaultAction: isDefaultAction, 26 | keyClickedAction: clickedAction, 27 | keyPayload: payload, 28 | keySelfHandledPushRedirection: selfHandledPushRedirection 29 | }; 30 | } 31 | 32 | @override 33 | String toString() { 34 | return '{\nisDefaultAction: $isDefaultAction\nclickedAction: $clickedAction\npayload: $payload\nselfHandledPushRedirection: $selfHandledPushRedirection \n}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/push/push_campaign_data.dart: -------------------------------------------------------------------------------- 1 | import '../account_meta.dart'; 2 | import '../platforms.dart'; 3 | import './push_campaign.dart'; 4 | 5 | /// Push Campaign Related Data 6 | class PushCampaignData { 7 | /// [PushCampaignData] Constructor 8 | PushCampaignData(this.platform, this.accountMeta, this.data); 9 | 10 | /// Type of Platform [Android/IOS] 11 | Platforms platform; 12 | 13 | /// Instance of [AccountMeta] 14 | AccountMeta accountMeta; 15 | 16 | /// [PushCampaign] Data 17 | PushCampaign data; 18 | 19 | @override 20 | String toString() { 21 | return '{\nplatform: ${platform.asString}\naccountMeta: $accountMeta\ndata: $data\n}'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/push/push_config.dart: -------------------------------------------------------------------------------- 1 | /// Push Notification Config 2 | class PushConfig { 3 | /// [PushConfig] Constructor 4 | PushConfig({required this.shouldDeliverCallbackOnForegroundClick}); 5 | 6 | /// [PushConfig] Default Named Constructor 7 | PushConfig.defaultConfig() 8 | : this(shouldDeliverCallbackOnForegroundClick: false); 9 | 10 | /// If [shouldDeliverCallbackOnForegroundClick] is true, when push notification 11 | /// is clicked on app foreground, MoEngage SDK will not handle the redirection. 12 | bool shouldDeliverCallbackOnForegroundClick; 13 | } 14 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/push/push_token_data.dart: -------------------------------------------------------------------------------- 1 | import '../platforms.dart'; 2 | import 'moe_push_service.dart'; 3 | 4 | /// Push Token Data 5 | class PushTokenData { 6 | /// Push Token Related Data 7 | PushTokenData(this.platform, this.token, this.pushService); 8 | 9 | /// Type of Platform [Android/IOS] 10 | Platforms platform; 11 | 12 | /// Push Token 13 | String token; 14 | 15 | /// Type of Push Service 16 | MoEPushService pushService; 17 | 18 | @override 19 | String toString() { 20 | return '{\nplatform: $platform\ntoken: $token\npushService: $pushService\n}'; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/lib/src/model/user_deletion_data.dart: -------------------------------------------------------------------------------- 1 | import 'account_meta.dart'; 2 | 3 | /// User Deletion Data 4 | /// @author Gowtham KK 5 | /// @since 1.1.0 6 | class UserDeletionData { 7 | /// Constructor for User Deletion Data 8 | UserDeletionData({required this.accountMeta, required this.isSuccess}); 9 | 10 | /// Instance of [AccountMeta] 11 | /// @since 1.1.0 12 | AccountMeta accountMeta; 13 | 14 | /// True if the user is deleted successfully, else false. 15 | /// @since 1.1.0 16 | bool isSuccess; 17 | } 18 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_flutter_platform_interface 2 | description: A common platform interface for the moengage_flutter plugin. 3 | version: 3.2.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | plugin_platform_interface: ^2.1.0 14 | 15 | dev_dependencies: 16 | collection: ^1.16.0 17 | flutter_test: 18 | sdk: flutter 19 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/test/data_payload_mapper_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart'; 3 | 4 | import 'data_provider/data_provider.dart'; 5 | 6 | void main() { 7 | final Map payload = getAccountMeta(dummyAppId); 8 | 9 | test('Test payload for String Identity', () { 10 | payload[keyData] = { 11 | keyUserIdentity: {keyUniqueUserIdentity: 'id1'} 12 | }; 13 | expect(getIdentifyUserPayload('id1', dummyAppId), payload); 14 | }); 15 | 16 | test('Test payload for Map Identity', () { 17 | payload[keyData] = { 18 | keyUserIdentity: {'key1': 'id1'} 19 | }; 20 | expect(getIdentifyUserPayload({'key1': 'id1'}, dummyAppId), payload); 21 | }); 22 | 23 | test('Test payload for Map Identity With Number', () { 24 | payload[keyData] = { 25 | keyUserIdentity: {'key1': 'id1', 'key2': 2} 26 | }; 27 | expect(getIdentifyUserPayload({'key1': 'id1', 'key2': 2}, dummyAppId), payload); 28 | }); 29 | 30 | test('Test payload for Map Identity With Null', () { 31 | payload[keyData] = { 32 | keyUserIdentity: {'key1': 'id1', 'key2': null} 33 | }; 34 | expect(getIdentifyUserPayload({'key1': 'id1', 'key2': null}, dummyAppId), payload); 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_platform_interface/test/utils_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart'; 3 | 4 | void main() { 5 | test('Test Supported Identity with type String', () { 6 | expect(isSupportedIdentity('identity'), true); 7 | }); 8 | 9 | test('Test Supported Identity with type Map', () { 10 | expect(isSupportedIdentity({'id1': 'value1'}), true); 11 | }); 12 | 13 | test('Test Supported Identity with type Map', () { 14 | expect(isSupportedIdentity({'id1': 'value1', 'id2': 2}), true); 15 | }); 16 | 17 | test('Test Supported Identity with type Map', () { 18 | expect(isSupportedIdentity({'id1': 'value1', 'id2': null}), true); 19 | }); 20 | 21 | test('Test Supported Identity with type Map', () { 22 | expect(isSupportedIdentity({'id1': 2}), true); 23 | }); 24 | 25 | test('Test Supported Identity with type Map', () { 26 | expect(isSupportedIdentity({2: 'string'}), false); 27 | }); 28 | 29 | test('Test Supported Identity with type Number', () { 30 | expect(isSupportedIdentity(2), false); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/.gitignore: -------------------------------------------------------------------------------- 1 | .packages 2 | .flutter-plugins 3 | pubspec.lock 4 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Flutter Web Plugin 2 | 3 | # 25-03-2025 4 | 5 | ## 4.1.0 6 | - Adding support for identify user based on multiple identities 7 | 8 | # 25-11-2024 9 | 10 | ## 4.0.1 11 | - Internal improvements. 12 | 13 | # 07-08-2024 14 | 15 | ## 4.0.0 16 | - Internal Improvements 17 | 18 | # 03-07-2024 19 | 20 | ## 3.1.0 21 | - Created a relay function which can be invoked from a timer to ensure proper initialisation of web sdk 22 | - Added object support in user attribute-tracking method 23 | 24 | # 21-03-2024 25 | 26 | ## 3.0.0 27 | - Updated Minimum Supported `moengage_flutter` version to `7.0.0` 28 | 29 | # 24-12-2023 30 | 31 | ## 2.1.1 32 | - Moengage undefine error handling if webSDK not integrated 33 | 34 | # 07-12-2023 35 | 36 | ## 2.1.0 37 | - Added support for array in user attributes 38 | 39 | # 13-09-2023 40 | 41 | ## 2.0.0 42 | - Initial Release with Federated Plugin -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_flutter\_web 2 | 3 | The Web implementation of [`moengage_flutter`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_flutter` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_flutter 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin 16 | 17 | If events and/or user attributes are unable to get tracked (in case of all-user billing or after user subscribes in push-subscriber billing), then you can call moengageInitialiser function at a delay based on your load time- 18 | 19 | ``` 20 | // import this dependency at the top of the file 21 | import 'dart:async'; 22 | 23 | /* inside initialise function, replace moengageInitialiser(); with Timer(const Duration(seconds: 5), moengageInitialiser); */ 24 | JsObject? _moengage; 25 | @override 26 | void initialise(MoEInitConfig moEInitConfig, String appId) { 27 | Logger.d('initialise() : Initialising MoEngage web SDK'); 28 | Timer(const Duration(seconds: 5), moengageInitialiser); // 5 seconds delay, just for example 29 | } 30 | ``` -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/lib/constants.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | // Method Names 3 | const String methodInitialise = 'initialise'; 4 | const String methodTrackEvent = 'trackEvent'; 5 | const String methodSetUserAttribute = 'setUserAttribute'; 6 | const String methodSetUserAttributeTimeStamp = 'setUserAttributeTimeStamp'; 7 | const String methodSetAlias = 'setAlias'; 8 | const String methodLogout = 'logout'; 9 | 10 | // SDK Method Names 11 | const String methodTrackEventSDK = 'track_event'; 12 | const String methodSetUserAttributeSDK = 'add_user_attribute'; 13 | const String methodSetUniqueIdSDK = 'add_unique_user_id'; 14 | const String methodSetAliasSDK = 'update_unique_user_id'; 15 | const String methodLogoutSDK = 'destroy_session'; 16 | 17 | // Keys Constants 18 | String keyEventName = 'eventName'; 19 | String keyEventAttributes = 'eventAttributes'; 20 | String keyAttributeValue = 'attributeValue'; 21 | String keyAttributeName = 'attributeName'; 22 | String keyAlias = 'alias'; 23 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/lib/extensions.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | 3 | import 'package:moengage_flutter_platform_interface/moengage_flutter_platform_interface.dart' 4 | show MoEProperties; 5 | 6 | extension MoEEvent on MoEProperties { 7 | Map getNormalizedEventAttributeJson() { 8 | final Map dateTimeAttributesParsed = {}; 9 | dateTimeAttributes.forEach( 10 | (String k, String v) => dateTimeAttributesParsed[k] = { 11 | keyTimeStampWeb: DateTime.parse(v).millisecondsSinceEpoch.toString() 12 | }, 13 | ); 14 | return { 15 | _keyEventAttributes: { 16 | ...generalAttributes, 17 | ...locationAttributes, 18 | ...dateTimeAttributesParsed 19 | }, 20 | _keyIsNonInteractive: isNonInteractive 21 | }; 22 | } 23 | } 24 | 25 | String keyTimeStampWeb = 'dartTimeStamp'; 26 | String keyPayload = 'payload'; 27 | String keyKvPair = 'kvPair'; 28 | String _keyEventAttributes = 'eventAttributes'; 29 | String _keyIsNonInteractive = 'isNonInteractive'; 30 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_flutter_web 2 | description: Web implementation of the moengage_flutter plugin 3 | version: 4.1.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_flutter 13 | platforms: 14 | web: 15 | pluginClass: MoEngageFlutterWeb 16 | fileName: moengage_flutter_web.dart 17 | 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | flutter_web_plugins: 22 | sdk: flutter 23 | moengage_flutter_platform_interface: ^3.0.0 24 | 25 | dev_dependencies: 26 | flutter_test: 27 | sdk: flutter 28 | 29 | -------------------------------------------------------------------------------- /packages/moengage_flutter/moengage_flutter_web/test/moengage_flutter_web_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence/example/README.md: -------------------------------------------------------------------------------- 1 | # moengage_geofence_example 2 | 3 | Demonstrates how to use the moengage_geofence plugin. 4 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence/lib/moengage_geofence.dart: -------------------------------------------------------------------------------- 1 | export 'src/moengage_geofence.dart'; 2 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence/lib/src/moengage_geofence.dart: -------------------------------------------------------------------------------- 1 | import 'package:moengage_flutter/moengage_flutter.dart' show Logger; 2 | import 'package:moengage_geofence_platform_interface/moengage_geofence_platform_interface.dart'; 3 | 4 | /// Helper Class to interact with MoEngage GeoFence Feature 5 | class MoEngageGeofence { 6 | /// Constructor for [MoEngageGeofence] 7 | MoEngageGeofence(this.appId); 8 | 9 | /// MoEngage App ID 10 | late String appId; 11 | 12 | final String _tag = '${moduleTagGeofence}MoEngageGeofence'; 13 | 14 | /// Starts Geofence Monitoring 15 | void startGeofenceMonitoring() { 16 | Logger.v('$_tag Starting GeoFence Monitoring'); 17 | MoEngageGeofencePlatform.instance.startGeofenceMonitoring(appId); 18 | } 19 | 20 | /// Stops Geofence Monitoring 21 | void stopGeofenceMonitoring() { 22 | Logger.v('$_tag Stopping GeoFence Monitoring'); 23 | MoEngageGeofencePlatform.instance.stopGeofenceMonitoring(appId); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_geofence 2 | description: Flutter Plugin for using Geofence feature of MoEngage Platform. 3 | version: 5.2.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | moengage_flutter: ^9.0.0 14 | moengage_geofence_android: 3.3.0 15 | moengage_geofence_ios: 3.3.0 16 | moengage_geofence_platform_interface: 3.0.2 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | 22 | flutter: 23 | plugin: 24 | platforms: 25 | android: 26 | default_package: moengage_geofence_android 27 | ios: 28 | default_package: moengage_geofence_ios -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence/test/moengage_geofence_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_geofence\_android 2 | 3 | The Android implementation of [`moengage_geofence`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_geofence` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_geofence 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'moengage_geofence_flutter' -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/src/main/kotlin/com/moengage/flutter/geofence/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.flutter.geofence 2 | 3 | internal const val CHANNEL_NAME = "com.moengage/geofence" 4 | 5 | internal const val METHOD_NAME_START_GEOFENCE_MONITORING = "startGeofenceMonitoring" 6 | internal const val METHOD_NAME_STOP_GEOFENCE_MONITORING = "stopGeofenceMonitoring" -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/android/user-agent.gradle: -------------------------------------------------------------------------------- 1 | import java.util.regex.Matcher 2 | import java.util.regex.Pattern 3 | 4 | String libraryVersionName = "UNKNOWN" 5 | File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') 6 | 7 | if (pubspec.exists()) { 8 | String yaml = pubspec.text 9 | // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. 10 | Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) 11 | if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") 12 | } 13 | 14 | android { 15 | defaultConfig { 16 | // BuildConfig.VERSION_NAME 17 | buildConfigField("String", 'MOENGAGE_GEOFENCE_FLUTTER_LIBRARY_VERSION', "\"${libraryVersionName}\"") 18 | } 19 | } -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_geofence_android 2 | description: Android implementation of the moengage_geofence plugin 3 | version: 3.3.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_geofence 13 | platforms: 14 | android: 15 | package: com.moengage.flutter.geofence 16 | pluginClass: MoEngageGeofencePlugin 17 | dartPluginClass: MoEngageGeofenceAndroid 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | moengage_flutter: ^9.0.0 23 | moengage_geofence_platform_interface: ^3.0.0 24 | 25 | dev_dependencies: 26 | flutter_test: 27 | sdk: flutter 28 | plugin_platform_interface: ^2.0.0 29 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_android/test/moengage_geofence_android_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Geofence iOS Plugin 2 | 3 | # 25-03-2025 4 | 5 | ## 3.3.0 6 | - Internal improvements 7 | 8 | # 18-02-2025 9 | 10 | ## 3.2.1 11 | - Internal improvements 12 | 13 | # 29-01-2025 14 | 15 | ## 3.2.0 16 | - Updated MoEngageGeofence to 5.19.0 17 | 18 | # 25-11-2024 19 | 20 | ## 3.1.2 21 | - Internal improvements. 22 | 23 | # 03-10-2024 24 | 25 | ## 3.1.1 26 | - Fixed dependency version incompatibility issue with `moengage_flutter` 27 | 28 | # 30-09-2024 29 | 30 | ## 3.1.0 31 | - Updated MoEngageGeofence to 5.18.0 32 | 33 | # 07-08-2024 34 | 35 | ## 3.0.0 36 | - Internal Improvements 37 | 38 | # 31-07-2024 39 | 40 | ## 2.3.0 41 | - Updated MoEngageGeofence to 5.17.0 42 | 43 | # 03-07-2024 44 | 45 | ## 2.2.0 46 | - Internal Improvements 47 | 48 | # 02-05-2024 49 | 50 | ## 2.1.0 51 | - Updated MoEngageGeofence to 5.16.0 52 | 53 | # 21-03-2024 54 | 55 | ## 2.0.0 56 | - Updated MoEngageGeofence to 5.15.0 57 | 58 | # 30-01-2024 59 | 60 | ## 1.2.0 61 | - Updated MoEngageGeofence to 5.14.0 62 | 63 | # 01-12-2023 64 | 65 | ## 1.1.0 66 | - Updated MoEngageGeofence to 5.13.0 67 | 68 | # 13-09-2023 69 | 70 | ## 1.0.0 71 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_geofence\_ios 2 | 3 | The iOS implementation of [`moengage_geofence`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_geofence` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_geofence 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/packages/moengage_geofence/moengage_geofence_ios/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/Classes/MoEngageFlutterGeofence.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import MoEngagePluginGeofence 4 | 5 | public class MoEngageFlutterGeofence: NSObject, FlutterPlugin { 6 | public static func register(with registrar: FlutterPluginRegistrar) { 7 | let channel = FlutterMethodChannel(name: MoEngageFlutterGeofenceConstants.channel, binaryMessenger: registrar.messenger()) 8 | let instance = MoEngageFlutterGeofence() 9 | registrar.addMethodCallDelegate(instance, channel: channel) 10 | } 11 | 12 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 13 | guard let payload = call.arguments as? [String: Any] else { return } 14 | 15 | switch call.method { 16 | case MoEngageFlutterGeofenceConstants.startGeofenceMonitoring : 17 | MoEngagePluginGeofenceBridge.sharedInstance.startGeofenceMonitoring(payload) 18 | case MoEngageFlutterGeofenceConstants.stopGeofenceMonitoring : 19 | MoEngagePluginGeofenceBridge.sharedInstance.stopGeofenceMonitoring(payload) 20 | default: 21 | break 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/Classes/MoEngageFlutterGeofenceConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MoEngageFlutterGeofenceConstants.swift 3 | // moengage_geofence 4 | // 5 | // Created by Rakshitha on 02/09/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct MoEngageFlutterGeofenceConstants { 11 | static let channel = "com.moengage/geofence" 12 | static let startGeofenceMonitoring = "startGeofenceMonitoring" 13 | static let stopGeofenceMonitoring = "stopGeofenceMonitoring" 14 | } 15 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/Classes/MoEngageGeofencePlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface MoEngageGeofencePlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/Classes/MoEngageGeofencePlugin.m: -------------------------------------------------------------------------------- 1 | #import "MoEngageGeofencePlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "moengage_geofence_ios-Swift.h" 9 | #endif 10 | 11 | @implementation MoEngageGeofencePlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [MoEngageFlutterGeofence registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/ios/moengage_geofence_ios.podspec: -------------------------------------------------------------------------------- 1 | require 'yaml' 2 | pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) 3 | libraryVersion = pubspec['version'].gsub('+', '-') 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'moengage_geofence_ios' 7 | s.version = libraryVersion 8 | s.summary = 'A flutter plugin to manage geofence for MoEngage iOS SDK.' 9 | s.description = <<-DESC 10 | A flutter plugin for MoEngage iOS SDK 11 | DESC 12 | s.homepage = 'https://www.moengage.com/' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'MoEngage Inc.' => 'mobiledevs@moengage.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '11.0' 19 | s.swift_version = '5.0' 20 | s.dependency 'MoEngagePluginGeofence', '3.3.0' 21 | end 22 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_geofence_ios 2 | description: iOS implementation of the moengage_geofence plugin 3 | version: 3.3.0 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_geofence 13 | platforms: 14 | ios: 15 | pluginClass: MoEngageGeofencePlugin 16 | dartPluginClass: MoEngageGeofenceIOS 17 | 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | moengage_flutter: ^9.0.0 22 | moengage_geofence_platform_interface: ^3.0.0 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | plugin_platform_interface: ^2.0.0 28 | 29 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_ios/test/moengage_geofence_ios_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Geofence Platform Interface 2 | 3 | # 25-11-2024 4 | 5 | ## 3.0.2 6 | - Internal improvements. 7 | 8 | # 03-10-2024 9 | 10 | ## 3.0.1 11 | - Fixed dependency version incompatibility issue with `moengage_flutter` 12 | 13 | # 07-08-2024 14 | 15 | ## 3.0.0 16 | - Internal Improvements 17 | 18 | # 21-03-2024 19 | 20 | ## 2.0.0 21 | - Updated Minimum Supported `moengage_flutter` version to `7.0.0` 22 | 23 | # 07-12-2023 24 | 25 | ## 1.1.0 26 | - Updated Minimum Supported `moengage_flutter` version to `6.1.0` 27 | 28 | # 13-09-2023 29 | 30 | ## 1.0.0 31 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/README.md: -------------------------------------------------------------------------------- 1 | # moengage_geofence_platform_interface 2 | 3 | A common platform interface for the [`moengage_geofence`][1] plugin. 4 | 5 | This interface allows platform-specific implementations of the `moengage_geofence` 6 | plugin, as well as the plugin itself, to ensure they are supporting the 7 | same interface. 8 | 9 | # Usage 10 | 11 | To implement a new platform-specific implementation of `moengage_geofence`, extend 12 | [`MoEngageGeofencePlatform`][2] with an implementation that performs the 13 | platform-specific behavior, and when you register your plugin, set the default 14 | `MoEngageGeofencePlatform` by calling 15 | `MoEngageGeofencePlatform.instance = MyPlatformMoEngageGeofence()`. 16 | 17 | # Note on breaking changes 18 | 19 | Strongly prefer non-breaking changes (such as adding a method to the interface) 20 | over breaking changes for this package. 21 | 22 | See https://flutter.dev/go/platform-interface-breaking-changes for a discussion 23 | on why a less-clean interface is preferable to a breaking change. 24 | 25 | [1]: ../moengage_geofence 26 | [2]: lib/moengage_geofence_platform_interface.dart -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/lib/moengage_geofence_platform_interface.dart: -------------------------------------------------------------------------------- 1 | export 'src/internal/moe_geofence_constants.dart'; 2 | export 'src/moengage_geofence_platform_interface.dart'; 3 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/lib/src/internal/method_channel_moengage_geofence.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:moengage_flutter/moengage_flutter.dart' 3 | show Logger, getAccountMeta; 4 | import '../../moengage_geofence_platform_interface.dart'; 5 | 6 | /// An implementation of [MoEngageGeofencePlatform] that uses method channels. 7 | class MethodChannelMoEngageGeofence extends MoEngageGeofencePlatform { 8 | /// The method channel used to interact with the native platform. 9 | final MethodChannel _channel = const MethodChannel(geoFenceChannelName); 10 | 11 | final String _tag = '${moduleTagGeofence}MoEAndroidGeofence'; 12 | 13 | @override 14 | void startGeofenceMonitoring(String appId) { 15 | try { 16 | _channel.invokeMethod( 17 | methodStartGeofenceMonitoring, 18 | getAccountMeta(appId), 19 | ); 20 | } catch (e) { 21 | Logger.e('$_tag Error: startGeofenceMonitoring() : $e'); 22 | } 23 | } 24 | 25 | @override 26 | void stopGeofenceMonitoring(String appId) { 27 | try { 28 | _channel.invokeMethod( 29 | methodStopGeofenceMonitoring, 30 | getAccountMeta(appId), 31 | ); 32 | } catch (e) { 33 | Logger.e('$_tag Error: stopGeofenceMonitoring() : $e'); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/lib/src/internal/moe_geofence_constants.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | const String moduleTagGeofence = 'Geofence_'; 3 | 4 | // Plugin Channel 5 | const String geoFenceChannelName = 'com.moengage/geofence'; 6 | 7 | // Method names 8 | const String methodStartGeofenceMonitoring = 'startGeofenceMonitoring'; 9 | const String methodStopGeofenceMonitoring = 'stopGeofenceMonitoring'; 10 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_geofence_platform_interface 2 | description: A common platform interface for the moengage_geofence plugin. 3 | version: 3.0.2 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | moengage_flutter: ^9.0.0 14 | plugin_platform_interface: ^2.1.0 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | -------------------------------------------------------------------------------- /packages/moengage_geofence/moengage_geofence_platform_interface/test/moengage_geofence_platform_interface_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "8.2.1" 3 | } 4 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/example/README.md: -------------------------------------------------------------------------------- 1 | # moengage_inbox_example 2 | 3 | Demonstrates how to use the moengage_inbox plugin. 4 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/lib/moengage_inbox.dart: -------------------------------------------------------------------------------- 1 | export 'package:moengage_inbox_platform_interface/moengage_inbox_platform_interface.dart'; 2 | export 'src/moengage_inbox.dart'; 3 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/lib/src/moengage_inbox.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:moengage_inbox_platform_interface/moengage_inbox_platform_interface.dart'; 4 | 5 | /// Helper Class to interact with MoEngage Cards Feature 6 | class MoEngageInbox { 7 | /// [MoEngageInbox] Constructor 8 | MoEngageInbox(this.appId); 9 | 10 | /// AppId Available in MoEngage Platform 11 | late String appId; 12 | 13 | ///Marks the given message as clicked and tracks a click event for the same. 14 | /// [message] - [InboxMessage] data 15 | void trackMessageClicked(InboxMessage message) { 16 | MoEngageInboxPlatform.instance.trackMessageClicked(message, appId); 17 | } 18 | 19 | /// Deletes the given message from inbox. 20 | /// [message] - [InboxMessage] data 21 | void deleteMessage(InboxMessage message) { 22 | MoEngageInboxPlatform.instance.deleteMessage(message, appId); 23 | } 24 | 25 | /// Gets all the messages saved in the inbox 26 | /// Returns [List] of [InboxData] 27 | Future fetchAllMessages() async { 28 | return MoEngageInboxPlatform.instance.fetchAllMessages(appId); 29 | } 30 | 31 | /// Returns the count of un-clicked messages in the inbox 32 | Future getUnClickedCount() async { 33 | return MoEngageInboxPlatform.instance.getUnClickedCount(appId); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_inbox 2 | description: Flutter Plugin for using Notification Center feature of MoEngage Platform, to provide an Inbox to view all the notifications received by your application. 3 | version: 8.2.1 4 | homepage: https://moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | moengage_flutter: ^9.0.0 14 | moengage_inbox_android: 3.3.1 15 | moengage_inbox_ios: 3.3.1 16 | moengage_inbox_platform_interface: 3.0.3 17 | 18 | dev_dependencies: 19 | flutter_lints: ^2.0.0 20 | flutter_test: 21 | sdk: flutter 22 | plugin_platform_interface: ^2.0.0 23 | 24 | flutter: 25 | assets: 26 | - config.json 27 | plugin: 28 | platforms: 29 | android: 30 | default_package: moengage_inbox_android 31 | ios: 32 | default_package: moengage_inbox_ios -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox/test/moengage_inbox_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_inbox\_android 2 | 3 | The Android implementation of [`moengage_inbox`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_inbox` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_inbox 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'moengage_inbox' 2 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/src/main/kotlin/com/moengage/flutter/inbox/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.moengage.flutter.inbox 2 | 3 | /** 4 | * @author Umang Chamaria 5 | * Date: 2020/10/29 6 | */ 7 | const val CHANNEL_NAME = "com.moengage/inbox" 8 | 9 | const val METHOD_NAME_UN_CLICKED_COUNT = "unClickedCount" 10 | const val METHOD_NAME_FETCH_MESSAGES = "fetchMessages" 11 | const val METHOD_NAME_DELETE_MESSAGE = "deleteMessage" 12 | const val METHOD_NAME_TRACK_CLICKED = "trackMessageClicked" 13 | 14 | const val INTEGRATION_TYPE = "flutter" 15 | 16 | // Asset Location for config.json under moengage_flutter package. 17 | const val ASSET_CONFIG_FILE_PATH = "flutter_assets/packages/moengage_inbox/config.json" 18 | const val VERSION_KEY = "version" 19 | 20 | const val ERROR_CODE_INBOX = "INBOX_ERROR" -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/android/user-agent.gradle: -------------------------------------------------------------------------------- 1 | import java.util.regex.Matcher 2 | import java.util.regex.Pattern 3 | 4 | String libraryVersionName = "UNKNOWN" 5 | File pubspec = new File(project.projectDir.parentFile, 'pubspec.yaml') 6 | 7 | if (pubspec.exists()) { 8 | String yaml = pubspec.text 9 | // Using \s*['|"]?([^\n|'|"]*)['|"]? to extract version number. 10 | Matcher versionMatcher = Pattern.compile("^version:\\s*['|\"]?([^\\n|'|\"]*)['|\"]?\$", Pattern.MULTILINE).matcher(yaml) 11 | if (versionMatcher.find()) libraryVersionName = versionMatcher.group(1).replaceAll("\\+", "-") 12 | } 13 | 14 | android { 15 | defaultConfig { 16 | // BuildConfig.VERSION_NAME 17 | buildConfigField("String", 'MOENGAGE_INBOX_FLUTTER_LIBRARY_VERSION', "\"${libraryVersionName}\"") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_inbox_android 2 | description: Android implementation of the moengage_inbox plugin 3 | version: 3.3.1 4 | homepage: https://moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_inbox 13 | platforms: 14 | android: 15 | package: com.moengage.flutter.inbox 16 | pluginClass: MoEngageInboxPlugin 17 | dartPluginClass: MoEngageInboxAndroid 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | moengage_flutter: ^9.0.0 23 | moengage_inbox_platform_interface: ^3.0.0 24 | 25 | dev_dependencies: 26 | flutter_test: 27 | sdk: flutter 28 | plugin_platform_interface: ^2.0.0 29 | 30 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_android/test/moengage_inbox_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Inbox iOS Plugin 2 | 3 | # 24-04-2025 4 | 5 | ## 3.3.1 6 | - BugFix: 7 | - ANR while accessing fetchAllMessages API in Main Thread 8 | 9 | # 25-03-2025 10 | 11 | ## 3.3.0 12 | - Updated MoEngageInbox to 2.19.1 13 | 14 | # 18-02-2025 15 | 16 | ## 3.2.1 17 | - Internal improvements 18 | 19 | # 29-01-2025 20 | 21 | ## 3.2.0 22 | - Updated MoEngageInbox to 2.19.0 23 | 24 | # 25-11-2024 25 | 26 | ## 3.1.2 27 | - Internal improvements. 28 | 29 | # 03-10-2024 30 | 31 | ## 3.1.1 32 | - Fixed dependency version incompatibility issue with `moengage_flutter` 33 | 34 | # 30-09-2024 35 | 36 | ## 3.1.0 37 | - Updated MoEngageInbox to 2.18.0 38 | 39 | # 07-08-2024 40 | 41 | ## 3.0.0 42 | - Internal Improvements 43 | 44 | # 31-07-2024 45 | 46 | ## 2.3.0 47 | - Updated MoEngageInbox to 2.17.0 48 | 49 | # 03-07-2024 50 | 51 | ## 2.2.0 52 | - Internal Improvements 53 | 54 | # 02-05-2024 55 | 56 | ## 2.1.0 57 | - Updated MoEngageInbox to 2.16.0 58 | 59 | # 21-03-2024 60 | 61 | ## 2.0.0 62 | - Updated MoEngageInbox to 2.15.0 63 | 64 | # 30-01-2024 65 | 66 | ## 1.2.0 67 | - Updated MoEngageInbox to 2.14.0 68 | 69 | # 01-12-2023 70 | 71 | ## 1.1.0 72 | - Updated MoEngageInbox to 2.13.0 73 | 74 | # 13-09-2023 75 | 76 | ## 1.0.0 77 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/README.md: -------------------------------------------------------------------------------- 1 | # moengage\_inbox\_ios 2 | 3 | The iOS implementation of [`moengage_inbox`][1]. 4 | 5 | ## Usage 6 | 7 | This package is [endorsed][2], which means you can simply use `moengage_inbox` 8 | normally. This package will be automatically included in your app when you do, 9 | so you do not need to add it to your `pubspec.yaml`. 10 | 11 | However, if you `import` this package to use any of its APIs directly, you 12 | should add it to your `pubspec.yaml` as usual. 13 | 14 | [1]: https://pub.dev/packages/moengage_inbox 15 | [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moengage/Flutter-SDK/219d6e5f84b76262c0bd7d282bd11c571562f86c/packages/moengage_inbox/moengage_inbox_ios/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/ios/Classes/MoEngageFlutterInboxConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MoEngageFlutterInboxConstants.swift 3 | // moengage_inbox 4 | // 5 | // Created by Chengappa C D on 06/11/20. 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | struct MoEngageFlutterInboxConstants{ 12 | 13 | static let kPluginChannelName = "com.moengage/inbox" 14 | 15 | struct MethodNames { 16 | static let kFetchMessages = "fetchMessages" 17 | static let kTrackMessageClicked = "trackMessageClicked" 18 | static let kDeleteMessage = "deleteMessage" 19 | static let kGetUnclickedCount = "unClickedCount" 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/ios/Classes/MoEngageInboxPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface MoEngageInboxPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/ios/Classes/MoEngageInboxPlugin.m: -------------------------------------------------------------------------------- 1 | #import "MoEngageInboxPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "moengage_inbox_ios-Swift.h" 9 | #endif 10 | 11 | @implementation MoEngageInboxPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [MoEngageFlutterInbox registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/ios/moengage_inbox_ios.podspec: -------------------------------------------------------------------------------- 1 | require 'yaml' 2 | pubspec = YAML.load_file(File.join('..', 'pubspec.yaml')) 3 | libraryVersion = pubspec['version'].gsub('+', '-') 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'moengage_inbox_ios' 7 | s.version = libraryVersion 8 | s.platform = :ios 9 | s.ios.deployment_target = '11.0' 10 | s.summary = 'A flutter plugin for using Notification Inbox from MoEngage iOS and Android SDKs.' 11 | s.description = <<-DESC 12 | A flutter plugin for using Notification Inbox from MoEngage iOS and Android SDKs. 13 | DESC 14 | s.homepage = 'https://www.moengage.com/' 15 | s.license = { :file => '../LICENSE' } 16 | s.author = { 'MoEngage Inc.' => 'mobiledevs@moengage.com' } 17 | s.source = { :path => '.' } 18 | s.source_files = 'Classes/**/*' 19 | s.dependency 'Flutter' 20 | s.dependency 'MoEngagePluginInbox', '3.3.0' 21 | s.swift_version = '5.0' 22 | end -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_inbox_ios 2 | description: iOS implementation of the moengage_inbox plugin 3 | version: 3.3.1 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | flutter: 11 | plugin: 12 | implements: moengage_inbox 13 | platforms: 14 | ios: 15 | pluginClass: MoEngageInboxPlugin 16 | dartPluginClass: MoEngageInboxIOS 17 | 18 | dependencies: 19 | flutter: 20 | sdk: flutter 21 | moengage_flutter: ^9.0.0 22 | moengage_inbox_platform_interface: ^3.0.0 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | plugin_platform_interface: ^2.0.0 28 | 29 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_ios/test/moengage_inbox_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('Sample Test', () { 5 | // This is a Sample Test that will always pass. 6 | // It's just here to satisfy the test requirements. 7 | expect(1 + 1, equals(2)); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # MoEngage Inbox Platform Interface 2 | 3 | # 24-04-2025 4 | 5 | ## 3.0.3 6 | - BugFix: 7 | - ANR while accessing fetchAllMessages API in Main Thread 8 | 9 | # 25-11-2024 10 | 11 | ## 3.0.2 12 | - Internal improvements. 13 | 14 | # 03-10-2024 15 | 16 | ## 3.0.1 17 | - Fixed dependency version incompatibility issue with `moengage_flutter` 18 | 19 | # 07-08-2024 20 | 21 | ## 3.0.0 22 | - Internal Improvements 23 | 24 | # 21-03-2024 25 | 26 | ## 2.0.0 27 | - Updated Minimum Supported `moengage_flutter` version to `7.0.0` 28 | 29 | # 07-12-2023 30 | 31 | ## 1.1.0 32 | - Updated Minimum Supported `moengage_flutter` version to `6.1.0` 33 | 34 | # 13-09-2023 35 | 36 | ## 1.0.0 37 | - Initial Release -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2023 MoEngage Inc. 2 | All rights reserved. 3 | * Use of source code or binaries contained within MoEngage SDK is permitted only to enable use of the MoEngage platform by customers of MoEngage. 4 | * Modification of source code and inclusion in mobile apps is explicitly allowed provided that all other conditions are met. 5 | * Neither the name of MoEngage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6 | * Redistribution of source code or binaries is disallowed except with specific prior written permission. Any such redistribution must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/README.md: -------------------------------------------------------------------------------- 1 | # moengage_inbox_platform_interface 2 | 3 | A common platform interface for the [`moengage_inbox`][1] plugin. 4 | 5 | This interface allows platform-specific implementations of the `moengage_inbox` 6 | plugin, as well as the plugin itself, to ensure they are supporting the 7 | same interface. 8 | 9 | # Usage 10 | 11 | To implement a new platform-specific implementation of `moengage_inbox`, extend 12 | [`MoEngageInboxPlatform`][2] with an implementation that performs the 13 | platform-specific behavior, and when you register your plugin, set the default 14 | `MoEngageInboxPlatform` by calling 15 | `MoEngageInboxPlatform.instance = MyPlatformMoEngageInbox()`. 16 | 17 | # Note on breaking changes 18 | 19 | Strongly prefer non-breaking changes (such as adding a method to the interface) 20 | over breaking changes for this package. 21 | 22 | See https://flutter.dev/go/platform-interface-breaking-changes for a discussion 23 | on why a less-clean interface is preferable to a breaking change. 24 | 25 | [1]: ../moengage_inbox 26 | [2]: lib/moengage_inbox_platform_interface.dart -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/moengage_inbox_platform_interface.dart: -------------------------------------------------------------------------------- 1 | export 'src/internal/constants.dart'; 2 | export 'src/internal/moe_inbox_utils.dart'; 3 | export 'src/model/models.dart'; 4 | export 'src/moengage_inbox_platform_interface.dart'; 5 | export 'src/payload_transformer.dart'; 6 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/internal/moe_inbox_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:moengage_flutter/moengage_flutter.dart' 2 | show keyAccountMeta, keyAppId, keyData; 3 | import '../model/inbox_message.dart'; 4 | import '../payload_transformer.dart'; 5 | 6 | /// Get Impression Payload [Map] 7 | Map getImpressionPayload( 8 | InboxMessage inboxMessage, String appId) { 9 | final dynamic inboxPayload = messageToMap(inboxMessage); 10 | return { 11 | keyAccountMeta: {keyAppId: appId}, 12 | keyData: inboxPayload 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/action.dart: -------------------------------------------------------------------------------- 1 | import '../../moengage_inbox_platform_interface.dart'; 2 | 3 | /// Action Data for [InboxMessage] 4 | class Action { 5 | /// [Action] Constructor 6 | Action(this.actionType); 7 | 8 | /// Type of Action 9 | ActionType actionType; 10 | 11 | @override 12 | String toString() { 13 | return 'Action{actionType: $actionType}'; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/action_type.dart: -------------------------------------------------------------------------------- 1 | /// Action Type for [InboxMessage] 2 | enum ActionType { 3 | /// Navigation Action 4 | navigation 5 | } 6 | 7 | /// Extension functions for [ActionType] 8 | extension ActionTypeExt on ActionType { 9 | /// Convert [ActionType] to [String] 10 | String get asString { 11 | switch (this) { 12 | case ActionType.navigation: 13 | return _valueNavigation; 14 | } 15 | } 16 | 17 | /// Get [ActionType] from [String] 18 | static ActionType fromString(String string) { 19 | switch (string) { 20 | case _valueNavigation: 21 | return ActionType.navigation; 22 | } 23 | throw Exception('unsupported type'); 24 | } 25 | } 26 | 27 | const String _valueNavigation = 'navigation'; 28 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/inbox_data.dart: -------------------------------------------------------------------------------- 1 | import 'inbox_message.dart'; 2 | 3 | /// Inbox Messages Data 4 | class InboxData { 5 | /// [InboxData] Constructor 6 | InboxData(this.platform, this.messages); 7 | 8 | /// Native platform from which the callback was triggered. 9 | String platform; 10 | 11 | /// List of [InboxMessage] 12 | List messages; 13 | 14 | @override 15 | String toString() { 16 | return 'InboxData{platform: $platform, messages: $messages}'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/media.dart: -------------------------------------------------------------------------------- 1 | import 'media_type.dart'; 2 | 3 | /// Media associated with the [InboxMessage] 4 | class Media { 5 | /// [Media] constructor 6 | Media(this.mediaType, this.url); 7 | 8 | /// Content type of the Media. 9 | MediaType mediaType; 10 | 11 | /// Url for the media content. Generally a http(s) url. 12 | String url; 13 | 14 | @override 15 | String toString() { 16 | return 'Media{mediaType: $mediaType, url: $url}'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/media_type.dart: -------------------------------------------------------------------------------- 1 | /// Possible media types for [InboxMessage] 2 | enum MediaType { 3 | /// Image Type 4 | image, 5 | 6 | /// Audio Type 7 | audio, 8 | 9 | /// Video Type 10 | video 11 | } 12 | 13 | /// Extension Util For [MediaType] 14 | extension MediaTypeExt on MediaType { 15 | /// Convert [MediaType] to [String] 16 | String get asString { 17 | switch (this) { 18 | case MediaType.image: 19 | return _valueImage; 20 | case MediaType.audio: 21 | return _valueAudio; 22 | case MediaType.video: 23 | return _valueVideo; 24 | } 25 | } 26 | 27 | /// Get [MediaType] Instance from [String] 28 | static MediaType fromString(String string) { 29 | switch (string) { 30 | case _valueImage: 31 | return MediaType.image; 32 | case _valueAudio: 33 | return MediaType.audio; 34 | case _valueVideo: 35 | return MediaType.video; 36 | } 37 | throw Exception('unsupported type'); 38 | } 39 | } 40 | 41 | const String _valueAudio = 'audio'; 42 | const String _valueImage = 'image'; 43 | const String _valueVideo = 'video'; 44 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/models.dart: -------------------------------------------------------------------------------- 1 | export 'action.dart'; 2 | export 'action_type.dart'; 3 | export 'inbox_data.dart'; 4 | export 'inbox_message.dart'; 5 | export 'media.dart'; 6 | export 'media_type.dart'; 7 | export 'navigation_action.dart'; 8 | export 'navigation_type.dart'; 9 | export 'text_content.dart'; 10 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/navigation_action.dart: -------------------------------------------------------------------------------- 1 | import 'action.dart'; 2 | import 'navigation_type.dart'; 3 | 4 | /// Navigation Action 5 | class NavigationAction extends Action { 6 | /// [NavigationAction] Constructor 7 | NavigationAction( 8 | super.actionType, this.navigationType, this.value, this.kvPair); 9 | 10 | /// Navigation Type 11 | NavigationType navigationType; 12 | 13 | /// Url or screen name to navigate to 14 | String value; 15 | 16 | /// Additional Key value pair associated with action 17 | Map kvPair; 18 | 19 | @override 20 | String toString() { 21 | return 'NavigationAction{navigationType: $navigationType, value: $value, kvPair: $kvPair}'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/navigation_type.dart: -------------------------------------------------------------------------------- 1 | /// Navigation Type for Inbox Action 2 | enum NavigationType { 3 | /// DeepLinking Action 4 | deepLink, 5 | 6 | /// RichLanding Action 7 | richLanding, 8 | 9 | /// Screen Name Action 10 | screenName 11 | } 12 | 13 | /// Extension for [NavigationType] 14 | extension NavigationTypeExt on NavigationType { 15 | /// Convert [NavigationType] to String 16 | String get asString { 17 | switch (this) { 18 | case NavigationType.deepLink: 19 | return _valueDeepLink; 20 | case NavigationType.screenName: 21 | return _valueScreenName; 22 | case NavigationType.richLanding: 23 | return _valueRichLanding; 24 | } 25 | } 26 | 27 | /// Get [NavigationType] From String 28 | static NavigationType fromString(String string) { 29 | switch (string) { 30 | case _valueRichLanding: 31 | return NavigationType.richLanding; 32 | case _valueDeepLink: 33 | return NavigationType.deepLink; 34 | case _valueScreenName: 35 | return NavigationType.screenName; 36 | } 37 | throw Exception('unsupported type'); 38 | } 39 | } 40 | 41 | const String _valueDeepLink = 'deepLink'; 42 | const String _valueRichLanding = 'richLanding'; 43 | const String _valueScreenName = 'screenName'; 44 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/lib/src/model/text_content.dart: -------------------------------------------------------------------------------- 1 | /// Text Content for [InboxMessage] 2 | class TextContent { 3 | /// [InboxMessage] Constructor 4 | TextContent(this.title, this.message, this.summary, this.subtitle); 5 | 6 | /// Title string for the inbox message. 7 | String title; 8 | 9 | /// Message string for the inbox message. 10 | String message; 11 | 12 | /// Summary string for the inbox message. 13 | /// 14 | /// Note: This is present for Android Platform. 15 | String summary; 16 | 17 | /// Subtitle string for the inbox message. 18 | /// 19 | /// Note: This is present only for the iOS Platform. 20 | String subtitle; 21 | 22 | @override 23 | String toString() { 24 | return 'title: $title, message: $message, summary: $summary, subtitle: $subtitle'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_inbox_platform_interface 2 | description: A common platform interface for the moengage_inbox plugin. 3 | version: 3.0.3 4 | homepage: https://www.moengage.com 5 | 6 | environment: 7 | sdk: ">=2.17.0 <4.0.0" 8 | flutter: ">=3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | moengage_flutter: ^9.0.0 14 | plugin_platform_interface: ^2.1.0 15 | 16 | dev_dependencies: 17 | collection: ^1.16.0 18 | flutter_test: 19 | sdk: flutter 20 | 21 | -------------------------------------------------------------------------------- /packages/moengage_inbox/moengage_inbox_platform_interface/test/parser_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:moengage_inbox_platform_interface/moengage_inbox_platform_interface.dart'; 3 | 4 | import 'inbox_comparator.dart'; 5 | import 'src/data_provider_provider.dart'; 6 | import 'src/json_data_provider.dart'; 7 | 8 | void main() { 9 | test('Test Inbox Data', () { 10 | expect( 11 | InboxComparator().isInboxDataEqual( 12 | deSerializeInboxMessages(inboxPayload), inboxData), 13 | true); 14 | }); 15 | 16 | test('Test Inbox Click Parser', () { 17 | expect(fetchUnclickedCount(inboxClickData), 1); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: moengage_workspace 2 | description: Workspace for MoEngage SDK 3 | version: 0.0.1 4 | publish_to: 'none' 5 | 6 | environment: 7 | sdk: '>=2.18.0 <4.0.0' 8 | dev_dependencies: 9 | melos: ^3.1.0 -------------------------------------------------------------------------------- /scripts/format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ORIGINAL_DIR=$(pwd) 3 | cd "$(dirname "$0")/.." || exit 4 | echo "Running flutter Format" 5 | dart format . 6 | echo "Running Kt Lint Format" 7 | (cd example/android && ./gradlew ktlintformat) 8 | cd "$ORIGINAL_DIR" || exit -------------------------------------------------------------------------------- /scripts/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ORIGINAL_DIR=$(pwd) 3 | cd "$(dirname "$0")/.." || exit 4 | dart pub global activate melos 5 | melos clean 6 | melos bootstrap 7 | melos exec -- flutter pub get 8 | echo "All Flutter projects updated." 9 | cd "$ORIGINAL_DIR" || exit -------------------------------------------------------------------------------- /scripts/verify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ORIGINAL_DIR=$(pwd) 3 | cd "$(dirname "$0")/.." || exit 4 | echo "Running Unit Test" 5 | melos unittest 6 | echo "Running flutter analyze" 7 | melos analyze 8 | echo "Running dry run" 9 | ./github/scripts/dry_run.sh 10 | echo "Project Verification Completed." 11 | cd "$ORIGINAL_DIR" || exit --------------------------------------------------------------------------------