Skip to content

Commit

Permalink
Merge pull request #50 from apptentive/develop
Browse files Browse the repository at this point in the history
Release 6.2.2
  • Loading branch information
frankus authored Nov 17, 2023
2 parents d0dd695 + 0803a91 commit 669af45
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://help.github.com/en/articles/about-code-owners

* @frankus @LuqKhan @PoornimaApptentive
8 changes: 6 additions & 2 deletions .scripts/changes.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
- Apptentive Android SDK: 6.1.0
- Apptentive iOS SDK: 6.2.2
- Apptentive Android SDK: 6.5.0
- Apptentive iOS SDK: 6.5.0

#### Bugs Fixed:

- Fixed an issue where calling register multiple times would hang on Android builds
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 2023-11-17 - v6.2.2

- Apptentive Android SDK: 6.5.0
- Apptentive iOS SDK: 6.5.0

#### Bugs Fixed:

- Fixed an issue where calling register multiple times would hang on Android builds

# 2023-08-02 - v6.1.2

- Apptentive Android SDK: 6.1.0
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ android {
}

dependencies {
implementation 'com.apptentive:apptentive-kit-android:6.1.0'
implementation 'com.apptentive:apptentive-kit-android:6.5.0'
testImplementation 'junit:junit:4.13.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class ApptentiveFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware
"registerListeners" -> registerListeners(result)
"unregisterListeners" -> unregisterListeners(result)
"sendAttachmentText" -> sendAttachmentText(call, result)
"isSDKRegistered" -> isSDKRegistered(result)
"handleRequestPushPermissions" -> { /* Only iOS. */ }
else -> result.notImplemented()
}
Expand All @@ -119,13 +120,17 @@ class ApptentiveFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware
private fun register(call: MethodCall, result: Result) {
val configuration = unpackConfiguration(call.argument("configuration")!!)
try {
Apptentive.register(application, configuration) { registerResult ->
if (registerResult is RegisterResult.Success) {
isApptentiveRegistered = true
Log.d(LogTag("Flutter"), "register ApptentiveActivityInfoCallback")
Apptentive.registerApptentiveActivityInfoCallback(activityInfo)
if (Apptentive.isRegistered()) {
result.error(ERROR_CODE, "Apptentive instance is already registered.", null)
} else {
Apptentive.register(application, configuration) { registerResult ->
if (registerResult is RegisterResult.Success) {
isApptentiveRegistered = true
Log.d(LogTag("Flutter"), "register ApptentiveActivityInfoCallback")
Apptentive.registerApptentiveActivityInfoCallback(activityInfo)
}
result.success(registerResult is RegisterResult.Success)
}
result.success(registerResult is RegisterResult.Success)
}
} catch (e: Exception) {
result.error(ERROR_CODE, "Failed to register Apptentive instance.", e.toString())
Expand Down Expand Up @@ -310,6 +315,14 @@ class ApptentiveFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware
}
}

private fun isSDKRegistered(result: Result) {
try {
result.success(Apptentive.isRegistered())
} catch (e: Exception) {
result.error(ERROR_CODE, "Failed to check if Apptentive SDK is registered.", e.toString())
}
}

private fun getUnreadMessageCount(result: Result) {
try {
val unreadMessages: Int = Apptentive.getUnreadMessageCount()
Expand Down
6 changes: 3 additions & 3 deletions ios/apptentive_flutter.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'apptentive_flutter'
s.version = "6.1.2"
s.version = "6.2.2"
s.summary = 'Apptentive SDK for Flutter'
s.description = <<-DESC
Apptentive SDK for Flutter
Expand All @@ -12,8 +12,8 @@ Apptentive SDK for Flutter
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'ApptentiveKit', '~> 6.2.2'
s.platform = :ios, '11.0'
s.dependency 'ApptentiveKit', '6.5.0'
s.platform = :ios, '13.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down
7 changes: 6 additions & 1 deletion lib/apptentive_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ApptentiveConfiguration {
this.shouldEncryptStorage = false,
this.shouldSanitizeLogMessages = true,
this.distributionName = "Flutter",
this.distributionVersion = "6.1.2",
this.distributionVersion = "6.2.2",
this.ratingInteractionThrottleLength = 604800000, // 1 week
this.customAppStoreURL
});
Expand Down Expand Up @@ -193,6 +193,11 @@ class ApptentiveFlutter {
return successful;
}

static Future<bool> isSDKRegistered() async {
final bool registered = await _channel.invokeMethod('isSDKRegistered', {});
return registered;
}

// Pack the Apptentive Configuration into a map object <String, Any>
static Map _packConfiguration(ApptentiveConfiguration configuration) {
return {
Expand Down
6 changes: 1 addition & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
name: apptentive_flutter
description: Apptentive SDK for Flutter
version: 6.1.2
version: 6.2.2
repository: https://github.com/apptentive/apptentive-flutter
issue_tracker: https://github.com/apptentive/apptentive-flutter/issues
documentation: https://learn.apptentive.com/knowledge-base/apptentive-sdk-flutter-plugin-guide/

environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"

dependencies:
flutter:
sdk: flutter

dev_dependencies:
flutter_test:
sdk: flutter

flutter:
plugin:
platforms:
Expand Down

0 comments on commit 669af45

Please sign in to comment.