Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-sdk tools:overrideLibrary="androidx.security"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:label="flutter_demo"
<uses-sdk tools:overrideLibrary="androidx.security" />

<application
android:label="test_proj"
tools:replace="android:label"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand All @@ -37,4 +39,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT" />
<data android:mimeType="text/plain" />
</intent>
</queries>
</manifest>
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.6.1'
classpath 'com.android.tools.build:gradle:8.9.1'
classpath 'com.google.gms:google-services:4.4.4'
classpath 'com.huawei.agconnect:agcp:1.9.1.302'
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.6.1" apply false
id "com.android.application" version "8.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.3.10" apply false
}

Expand Down
62 changes: 34 additions & 28 deletions lib/insider/MessageCenter.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_demo/components/CustomButton.dart';
import 'package:flutter_demo/insider/MessageCenterInboxPage.dart';

import 'package:flutter_insider/flutter_insider.dart';
import 'package:flutter_insider/src/identifiers.dart';

class MessageCenter extends StatelessWidget {
MessageCenter();
Expand All @@ -16,47 +16,53 @@ class MessageCenter extends StatelessWidget {
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Get Message Center Data', onPressed: () async {
// --- MESSAGE CENTER --- //
DateTime startDate = DateTime.now().subtract(const Duration(days: 90));
DateTime endDate = DateTime.now().add(const Duration(days: 90));

print('[INSIDER][getMessageCenterData]: Method is triggered , waiting response.');

List? messageCenterData =
await FlutterInsider.Instance.getMessageCenterData(startDate, endDate, 100);

print('[INSIDER][getMessageCenterData]: $messageCenterData');
}),
child: CustomButton(
buttonText: 'Open App Cards',
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AppCardsPage(),
),
);
},
),
),
],
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Get Message Center Data With Identifiers', onPressed: () async {
// --- MESSAGE CENTER WITH IDENTIFIERS --- //
DateTime startDate = DateTime.now().subtract(const Duration(days: 90));
DateTime endDate = DateTime.now().add(const Duration(days: 90));

FlutterInsiderIdentifiers identifiers = FlutterInsiderIdentifiers()
.addEmail("test@example.com")
.addPhoneNumber("+1234567890")
.addUserID("user123");

print('[INSIDER][getMessageCenterDataWithIdentifiers]: Method is triggered , waiting response.');
child: CustomButton(buttonText: 'Get Campaigns Data (Console)', onPressed: () async {
print('[INSIDER][getCampaigns]: Method is triggered, waiting response...');

List? messageCenterData =
await FlutterInsider.Instance.getMessageCenterDataWithIdentifiers(startDate, endDate, identifiers, 100);
try {
final response = await FlutterInsider.Instance.appCards.getCampaigns();

print('[INSIDER][getMessageCenterDataWithIdentifiers]: $messageCenterData');
if (response != null) {
print('[INSIDER][getCampaigns]: Received ${response.appCards.length} app cards');
for (var card in response.appCards) {
print(' - Card ID: ${card.id}');
print(' Title: ${card.content?.title ?? "N/A"}');
print(' Description: ${card.content?.description ?? "N/A"}');
print(' Read: ${card.isRead}');
print(' Images: ${card.images?.length ?? 0}');
print(' Buttons: ${card.buttons?.length ?? 0}');
}
} else {
print('[INSIDER][getCampaigns]: No campaigns data received');
}
} catch (e) {
print('[INSIDER][getCampaigns]: Error: $e');
}
}),
),
],
),
],
);
}
}
}
Loading