From 5975978dd7b0e1df9edb8afc8bea4b41f20fbd43 Mon Sep 17 00:00:00 2001 From: Melih Karadas Date: Thu, 12 Sep 2024 10:38:51 +0300 Subject: [PATCH] Updated to version 3.12.0+nh --- CHANGELOG.md | 20 +++++++- android/build.gradle | 19 ++++---- ios/flutter_insider.podspec | 6 +-- lib/flutter_insider.dart | 2 +- lib/src/identifiers.dart | 11 ++--- lib/src/user.dart | 93 +++++++++++++++++-------------------- pubspec.yaml | 2 +- 7 files changed, 82 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f57dc3..ea1661f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -272,4 +272,22 @@ ## 3.10.9+nh -* iOS Geofence SDK updated. \ No newline at end of file +* iOS Geofence SDK updated. + +## 3.11.0 + +* iOS & Android SDK updated. +* Removed setCustomKeyValuePairForPushIntent method. + +## 3.11.0+nh + +* iOS & Android SDK updated. +* Removed setCustomKeyValuePairForPushIntent method. + +## 3.12.0 + +* iOS & Android SDK updated. + +## 3.12.0+nh + +* iOS & Android SDK updated. \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 3c473fb..ca67cbc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'com.useinsider.insider.flutter_insider' -version '3.10.9+nh-SNAPSHOT' +version '3.12.0+nh-SNAPSHOT' buildscript { repositories { @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' + classpath 'com.android.tools.build:gradle:8.4.2' } } @@ -23,10 +23,10 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 30 + compileSdkVersion 34 defaultConfig { - minSdkVersion 18 + minSdkVersion 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { @@ -37,13 +37,14 @@ android { dependencies { implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.security:security-crypto:1.1.0-alpha06' - implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - implementation 'com.google.android.gms:play-services-location:21.0.1' - implementation 'com.google.firebase:firebase-messaging:23.0.5' + implementation 'com.google.firebase:firebase-messaging:24.0.0' + implementation 'com.google.android.gms:play-services-location:21.3.0' implementation 'com.google.android.play:review:2.0.1' - implementation 'com.appsflyer:af-android-sdk:6.14.0' - implementation 'com.useinsider:insider:14.2.5-nh' + implementation 'com.useinsider:insider:14.4.0-nh' implementation 'com.useinsider:insiderhybrid:1.1.5' + + implementation 'com.appsflyer:af-android-sdk:6.14.0' } diff --git a/ios/flutter_insider.podspec b/ios/flutter_insider.podspec index bb71284..0d78629 100644 --- a/ios/flutter_insider.podspec +++ b/ios/flutter_insider.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'flutter_insider' - s.version = '3.10.9' + s.version = '3.12.0' s.summary = 'Flutter Plugin For Insider SDK' s.description = <<-DESC Flutter Plugin For Insider SDK @@ -12,8 +12,8 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.dependency 'InsiderMobile', '13.4.3' - s.dependency 'InsiderGeofence', '1.1.3' + s.dependency 'InsiderMobile', '13.6.2' + s.dependency 'InsiderGeofence', '1.2.0' s.dependency 'InsiderHybrid', '1.4.0' s.ios.deployment_target = '12.0' end diff --git a/lib/flutter_insider.dart b/lib/flutter_insider.dart index cb29f13..0b9831b 100644 --- a/lib/flutter_insider.dart +++ b/lib/flutter_insider.dart @@ -21,7 +21,7 @@ class FlutterInsider { args["appGroup"] = appGroup; args["partnerName"] = partnerName; - args["sdkVersion"] = "F-3.10.9+nh"; + args["sdkVersion"] = "F-3.12.0+nh"; if (customEndpoint != null) { args["customEndpoint"] = customEndpoint; diff --git a/lib/src/identifiers.dart b/lib/src/identifiers.dart index 022b7d5..a3feefb 100644 --- a/lib/src/identifiers.dart +++ b/lib/src/identifiers.dart @@ -1,4 +1,3 @@ -import 'dart:async'; import 'constants.dart'; class FlutterInsiderIdentifiers { @@ -8,7 +7,7 @@ class FlutterInsiderIdentifiers { identifiers = new Map(); } - Future addEmail(String email) async { + FlutterInsiderIdentifiers addEmail(String email) { if (email == null) return this; identifiers!.addAll({Constants.ADD_EMAIL: email}); @@ -16,7 +15,7 @@ class FlutterInsiderIdentifiers { return this; } - Future addPhoneNumber(String phoneNumber) async { + FlutterInsiderIdentifiers addPhoneNumber(String phoneNumber) { if (phoneNumber == null) return this; identifiers!.addAll({Constants.ADD_PHONE_NUMBER: phoneNumber}); @@ -24,7 +23,7 @@ class FlutterInsiderIdentifiers { return this; } - Future addUserID(String userID) async { + FlutterInsiderIdentifiers addUserID(String userID) { if (userID == null) return this; identifiers!.addAll({Constants.ADD_USER_ID: userID}); @@ -32,7 +31,7 @@ class FlutterInsiderIdentifiers { return this; } - Future addCustomIdentifier(String key, String value) async { + FlutterInsiderIdentifiers addCustomIdentifier(String key, String value) { if (key == null || value == null) return this; identifiers!.addAll({key: value}); @@ -40,7 +39,7 @@ class FlutterInsiderIdentifiers { return this; } - Future getIdentifiers() async { + Map? getIdentifiers() { return identifiers; } } diff --git a/lib/src/user.dart b/lib/src/user.dart index 20707c2..9362734 100644 --- a/lib/src/user.dart +++ b/lib/src/user.dart @@ -1,4 +1,3 @@ -import 'dart:async'; import 'package:flutter/services.dart'; import 'package:flutter_insider/src/identifiers.dart'; import 'utils.dart'; @@ -11,7 +10,7 @@ class FlutterInsiderUser { this._channel = methodChannel; } - Future setGender(int gender) async { + FlutterInsiderUser setGender(int gender) { try { if (gender == null) return this; @@ -25,7 +24,7 @@ class FlutterInsiderUser { return this; } - Future setBirthday(DateTime birthday) async { + FlutterInsiderUser setBirthday(DateTime birthday) { try { if (birthday == null) return this; @@ -39,7 +38,7 @@ class FlutterInsiderUser { return this; } - Future setName(String name) async { + FlutterInsiderUser setName(String name) { try { if (name == null) return this; @@ -53,7 +52,7 @@ class FlutterInsiderUser { return this; } - Future setSurname(String surname) async { + FlutterInsiderUser setSurname(String surname) { try { if (surname == null) return this; @@ -67,7 +66,7 @@ class FlutterInsiderUser { return this; } - Future setLanguage(String language) async { + FlutterInsiderUser setLanguage(String language) { try { if (language == null) return this; _setUserAttribute(Constants.SET_LANGUAGE, language); @@ -78,7 +77,7 @@ class FlutterInsiderUser { return this; } - Future setLocale(String locale) async { + FlutterInsiderUser setLocale(String locale) { try { if (locale == null) return this; @@ -92,7 +91,7 @@ class FlutterInsiderUser { return this; } - Future setFacebookID(String facebookID) async { + FlutterInsiderUser setFacebookID(String facebookID) { try { if (facebookID == null) return this; @@ -106,7 +105,7 @@ class FlutterInsiderUser { return this; } - Future setTwitterID(String twitterID) async { + FlutterInsiderUser setTwitterID(String twitterID) { try { if (twitterID == null) return this; @@ -120,7 +119,7 @@ class FlutterInsiderUser { return this; } - Future setAge(int age) async { + FlutterInsiderUser setAge(int age) { try { if (age == null) return this; @@ -134,7 +133,7 @@ class FlutterInsiderUser { return this; } - Future setSMSOptin(bool smsOptin) async { + FlutterInsiderUser setSMSOptin(bool smsOptin) { try { if (smsOptin == null) return this; @@ -148,7 +147,7 @@ class FlutterInsiderUser { return this; } - Future setEmailOptin(bool emailOptin) async { + FlutterInsiderUser setEmailOptin(bool emailOptin) { try { if (emailOptin == null) return this; @@ -161,7 +160,7 @@ class FlutterInsiderUser { return this; } - Future setLocationOptin(bool locationOptin) async { + FlutterInsiderUser setLocationOptin(bool locationOptin) { try { if (locationOptin == null) return this; @@ -175,7 +174,7 @@ class FlutterInsiderUser { return this; } - Future setPushOptin(bool pushOptin) async { + FlutterInsiderUser setPushOptin(bool pushOptin) { try { if (pushOptin == null) return this; @@ -189,7 +188,7 @@ class FlutterInsiderUser { return this; } - Future setWhatsappOptin(bool whatsappOptin) async { + FlutterInsiderUser setWhatsappOptin(bool whatsappOptin) { try { if (whatsappOptin == null) return this; @@ -203,7 +202,7 @@ class FlutterInsiderUser { return this; } - Future setEmail(String email) async { + FlutterInsiderUser setEmail(String email) { try { if (email == null) return this; @@ -217,7 +216,7 @@ class FlutterInsiderUser { return this; } - Future setPhoneNumber(String phoneNumber) async { + FlutterInsiderUser setPhoneNumber(String phoneNumber) { try { if (phoneNumber == null) return this; @@ -231,13 +230,13 @@ class FlutterInsiderUser { return this; } - _setUserAttribute(String key, dynamic value) async { + _setUserAttribute(String key, dynamic value) { try { if (key == null || value == null) return; Map? args = _createMapForMethodCall(key, value); - await _channel.invokeMethod(key, args); + _channel.invokeMethod(key, args); } catch (Exception) { FlutterInsiderUtils.putException(_channel, Exception); } @@ -260,13 +259,13 @@ class FlutterInsiderUser { return null; } - Future setCustomAttributeWithString(String key, String value) async { + FlutterInsiderUser setCustomAttributeWithString(String key, String value) { try { if (key == null || value == null) return this; Map? args = _createMapForMethodCall(key, value); - await _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_STRING, args); + _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_STRING, args); return this; } catch (Exception) { @@ -276,13 +275,13 @@ class FlutterInsiderUser { return this; } - Future setCustomAttributeWithInt(String key, int value) async { + FlutterInsiderUser setCustomAttributeWithInt(String key, int value) { try { if (key == null || value == null) return this; Map? args = _createMapForMethodCall(key, value); - await _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_INT, args); + _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_INT, args); return this; } catch (Exception) { @@ -292,13 +291,13 @@ class FlutterInsiderUser { return this; } - Future setCustomAttributeWithDouble(String key, double value) async { + FlutterInsiderUser setCustomAttributeWithDouble(String key, double value) { try { if (key == null || value == null) return this; Map? args = _createMapForMethodCall(key, value); - await _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE, args); + _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_DOUBLE, args); return this; } catch (Exception) { @@ -308,13 +307,13 @@ class FlutterInsiderUser { return this; } - Future setCustomAttributeWithBoolean(String key, bool value) async { + FlutterInsiderUser setCustomAttributeWithBoolean(String key, bool value) { try { if (key == null || value == null) return this; Map? args = _createMapForMethodCall(key, value); - await _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN, args); + _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_BOOLEAN, args); return this; } catch (Exception) { @@ -324,13 +323,13 @@ class FlutterInsiderUser { return this; } - Future setCustomAttributeWithDate(String key, DateTime value) async { + FlutterInsiderUser setCustomAttributeWithDate(String key, DateTime value) { try { if (key == null || value == null) return this; Map? args = _createMapForMethodCall(key, FlutterInsiderUtils.getDateForParsing(value)); - await _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_DATE, args); + _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_DATE, args); return this; } catch (Exception) { @@ -339,13 +338,13 @@ class FlutterInsiderUser { return this; } - Future setCustomAttributeWithArray(String key, List value) async { + FlutterInsiderUser setCustomAttributeWithArray(String key, List value) { try { if (key == null || value == null) return this; Map? args = _createMapForMethodCall(key, value); - await _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_ARRAY, args); + _channel.invokeMethod(Constants.SET_CUSTOM_ATTRIBUTE_WITH_ARRAY, args); return this; } catch (Exception) { @@ -355,7 +354,7 @@ class FlutterInsiderUser { return this; } - Future unsetCustomAttribute(String key) async { + FlutterInsiderUser unsetCustomAttribute(String key) { try { if (key == null) return this; @@ -363,7 +362,7 @@ class FlutterInsiderUser { args["key"] = key; - await _channel.invokeMethod(Constants.UNSET_CUSTOM_ATTRIBUTE, args); + _channel.invokeMethod(Constants.UNSET_CUSTOM_ATTRIBUTE, args); return this; } catch (Exception) { @@ -373,43 +372,37 @@ class FlutterInsiderUser { return this; } - Future login(FlutterInsiderIdentifiers identifiers, {Function? insiderIDResult}) async { + void login(FlutterInsiderIdentifiers identifiers, {Function? insiderIDResult}) { try { Map args = {}; - args["identifiers"] = await identifiers.getIdentifiers(); + args["identifiers"] = identifiers.getIdentifiers(); if (insiderIDResult != null) { args["insiderID"] = "insiderID"; - String? insiderID = await _channel.invokeMethod(Constants.LOGIN, args); + _channel.invokeMethod(Constants.LOGIN, args).then((insiderID) { + insiderIDResult(insiderID); + }).catchError((error) { + FlutterInsiderUtils.putException(_channel, error); + }); - insiderIDResult(insiderID); - - return this; + return; } - await _channel.invokeMethod(Constants.LOGIN, args); - - return this; + _channel.invokeMethod(Constants.LOGIN, args); } catch (Exception) { FlutterInsiderUtils.putException(_channel, Exception); } - - return this; } - Future logout() async { + void logout() { try { Map args = {}; - await _channel.invokeMethod(Constants.LOGOUT, args); - - return this; + _channel.invokeMethod(Constants.LOGOUT, args); } catch (Exception) { FlutterInsiderUtils.putException(_channel, Exception); } - - return this; } } diff --git a/pubspec.yaml b/pubspec.yaml index 297a715..8392376 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_insider description: Flutter Plugin For Insider SDK. For more information, please visit our website. -version: 3.10.9+nh +version: 3.12.0+nh homepage: https://www.useinsider.com environment: