Skip to content
Merged
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
32 changes: 14 additions & 18 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,21 +22,18 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 34
namespace "com.useinsider.flutterdemo"
compileSdk 34
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

sourceSets {
Expand All @@ -45,10 +43,8 @@ android {
defaultConfig {
// FIXME-INSIDER: Please change with your application ID.
applicationId "com.useinsider.flutterdemo"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
minSdk 24
targetSdk flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// FIXME-INSIDER: Please change with your partner name.
Expand Down Expand Up @@ -87,7 +83,7 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24"
}

apply plugin: 'com.google.gms.google-services'
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_demo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.flutter_demo">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_demo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
8 changes: 3 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
buildscript {
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand All @@ -8,10 +7,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.huawei.agconnect:agcp:1.7.2.300'
classpath 'com.android.tools.build:gradle:8.3.2'
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.huawei.agconnect:agcp:1.9.1.301'
}
}

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-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.3.2" apply false
id "org.jetbrains.kotlin.android" version "1.9.24" apply false
}

include ":app"
Binary file added assets/images/insider-one.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/InsiderNotificationService/NotificationService.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ -(void)didReceiveNotificationRequest:(UNNotificationRequest *)request withConten
NSString *nextButtonText = @">>";
NSString *goToAppText = @"Launch App";

[InsiderPushNotification showInsiderRichPush:request appGroup:APP_GROUP nextButtonText:nextButtonText goToAppText:goToAppText success:^(UNNotificationAttachment *attachment) {
[InsiderPushNotification showInsiderRichPush:self.bestAttemptContent appGroup:APP_GROUP nextButtonText:nextButtonText goToAppText:goToAppText success:^(UNNotificationAttachment *attachment) {
if (attachment) {
self.bestAttemptContent.attachments = [NSArray arrayWithObject:attachment];
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '13.5'
platform :ios, '14.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
21 changes: 21 additions & 0 deletions lib/insider/ContentOptimizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,27 @@ class ContentOptimizer extends StatelessWidget {
),
],
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Get Variable Without Cache',
onPressed: () async {
// --- CONTENT OPTIMIZER WITHOUT CACHE --- //

var contentOptimizerString =
await FlutterInsider.Instance.getContentStringWithoutCache(
"variableName",
"defaultValue",
ContentOptimizerDataType.ELEMENT);

print('[INSIDER][getContentStringWithoutCache]: $contentOptimizerString');
}),
),
],
),
],
);
}
Expand Down
14 changes: 14 additions & 0 deletions lib/insider/GDPR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ class GDPR extends StatelessWidget {
)
],
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Set Mobile App Access', onPressed: () {
FlutterInsider.Instance.setMobileAppAccess(true);

print('[INSIDER][setMobileAppAccess]: Method is triggered.');
}),
),
],
),
],
);
}
Expand Down
32 changes: 32 additions & 0 deletions lib/insider/Geofence.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
import 'package:flutter_demo/components/CustomButton.dart';

import 'package:flutter_insider/flutter_insider.dart';

class Geofence extends StatelessWidget {
Geofence();

@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Start Tracking Geofence',
onPressed: () {
// --- GEOFENCE --- //
FlutterInsider.Instance.startTrackingGeofence();

print('[INSIDER][startTrackingGeofence]: Method is triggered.');
}),
),
],
),
],
);
}
}

47 changes: 47 additions & 0 deletions lib/insider/InAppMessages.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_demo/components/CustomButton.dart';

import 'package:flutter_insider/flutter_insider.dart';

class InAppMessages extends StatelessWidget {
InAppMessages();

@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Enable InApp',
onPressed: () {
// --- ENABLE IN-APP MESSAGES --- //
FlutterInsider.Instance.enableInAppMessages();

print('[INSIDER][enableInAppMessages]: Method is triggered.');
}),
),
],
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Disable InApp',
onPressed: () {
// --- DISABLE IN-APP MESSAGES --- //
FlutterInsider.Instance.disableInAppMessages();

print('[INSIDER][disableInAppMessages]: Method is triggered.');
}),
),
],
),
],
);
}
}
38 changes: 0 additions & 38 deletions lib/insider/SocialProof.dart

This file was deleted.

3 changes: 3 additions & 0 deletions lib/insider/UserAttribute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class UserAttribute extends StatelessWidget {
currentUser.setLanguage("TR");
currentUser.setLocale("tr_TR");

// Custom Attributes
currentUser.setCustomAttributeWithBoolean("mobile_app_access", true);

print('[INSIDER][getCurrentUser]: Method is triggered.');
}),
),
Expand Down
26 changes: 26 additions & 0 deletions lib/insider/UserIdentifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,32 @@ class UserIdentifier extends StatelessWidget {
),
],
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: CustomButton(buttonText: 'Logout Resetting Insider ID',
backgroundColor: const Color.fromRGBO(229, 127, 116, 1),
onPressed: () async {
FlutterInsiderUser currentUser = FlutterInsider.Instance.getCurrentUser()!;
FlutterInsiderIdentifiers identifiers = new FlutterInsiderIdentifiers();

identifiers.addEmail("[email protected]");
identifiers.addPhoneNumber("+909876543210");
identifiers.addUserID("{crmID}");

List<FlutterInsiderIdentifiers> additionalIdentifiers = [identifiers];

// Logout Resetting Insider ID with Identifiers
currentUser.logoutResettingInsiderID(additionalIdentifiers);

print('[INSIDER][logoutResettingInsiderID]: Method is triggered.');
}),
),
],
),
],
);
}
Expand Down
Loading