Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Update for v3.0.0
Browse files Browse the repository at this point in the history
- Upgrade Flurry Android SDK version to 14.0.0
- Migrate to comply with JDK 11 and Gradle 7
- Upgrade target SDK to Android 13 (API level 33)
  • Loading branch information
poting-oath committed Oct 26, 2022
1 parent 91a2ab5 commit fd2d0c2
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 26 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
* [Flurry Android SDK Release Notes](https://developer.yahoo.com/flurry/docs/releasenotes/android/)
* [Flurry iOS SDK Release Notes](https://developer.yahoo.com/flurry/docs/releasenotes/ios/)

# v3.0.0 (2022-10-26)

#### Features

* Upgrade Flurry Android SDK version to 14.0.0
* Migrate to comply with JDK 11 and Gradle 7
* Upgrade target SDK to Android 13 (API level 33)

### v2.2.1 (2022-08-02)

#### Bug Fixes
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ A Flutter plugin for Flurry SDK
.withCrashReporting(true)
.withLogEnabled(true)
.withLogLevel(LogLevel.debug)
.withReportLocation(true)
.build(
androidAPIKey: FLURRY_ANDROID_API_KEY,
iosAPIKey: FLURRY_IOS_API_KEY);
Expand Down Expand Up @@ -301,6 +302,7 @@ See [Android](https://flurry.github.io/flurry-android-sdk/analytics/index.html)-
Builder withIncludeBackgroundSessionsInMetrics(bool includeBackgroundSessionsInMetrics);
Builder withLogEnabled(bool enableLog);
Builder withLogLevel(LogLevel logLevel); // LogLevel = { verbose, debug, info, warn, error, assertion }
Builder withReportLocation(bool reportLocation); // Android only
Builder withMessaging(bool enableMessaging, MessagingListener listener);
Builder withPerformanceMetrics(int performanceMetrics); // Performance = { none, coldStart, screenTime, all }
Builder withSslPinningEnabled(bool sslPinningEnabled); // Android only
Expand Down
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:7.1.3'
}
}

Expand All @@ -22,7 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 16
Expand All @@ -32,6 +32,6 @@ android {
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

implementation 'com.flurry.android:analytics:13.3.0'
implementation 'com.flurry.android:marketing:13.3.0'
implementation 'com.flurry.android:analytics:14.0.0'
implementation 'com.flurry.android:marketing:14.0.0'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class FlurryFlutterPlugin implements FlutterPlugin, MethodCallHandler, Ac
private static final String TAG = "FlurryFlutterPlugin";

private static final String ORIGIN_NAME = "flutter-flurry-sdk";
private static final String ORIGIN_VERSION = "2.2.1";
private static final String ORIGIN_VERSION = "3.0.0";

private Context context;

Expand Down Expand Up @@ -190,6 +190,10 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
String logLevelStr = call.argument("logLevelStr");
withLogLevel(logLevelStr);
break;
case "withReportLocation":
boolean reportLocation = call.<Boolean>argument("reportLocation");
builder.withReportLocation(reportLocation);
break;
case "withPerformanceMetrics":
int performanceMetrics = call.<Integer>argument("performanceMetrics");
withPerformanceMetrics(performanceMetrics);
Expand Down Expand Up @@ -286,7 +290,7 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
}
break;
case "setReportLocation":
boolean reportLocation = call.<Boolean>argument("reportLocation");
reportLocation = call.<Boolean>argument("reportLocation");
setReportLocation(reportLocation);
break;
case "setSessionOrigin":
Expand Down Expand Up @@ -457,11 +461,12 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {

public void initializeFlurryBuilder() {
builder = new FlurryAgent.Builder();
builder.withSessionForceStart(true)
.withReportLocation(true);
}

public void buildFlurryBuilder(String apiKey) {
FlurryAgent.addOrigin(ORIGIN_NAME, ORIGIN_VERSION);
builder.withSessionForceStart(true);
builder.build(context, apiKey);
}

Expand Down
12 changes: 6 additions & 6 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.flutter_flurry_sdk_example"
minSdkVersion 16
targetSdkVersion 31
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -53,9 +53,9 @@ flutter {
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

implementation 'com.flurry.android:analytics:13.3.0'
implementation 'com.flurry.android:marketing:13.3.0'
implementation 'com.flurry.android:analytics:14.0.0'
implementation 'com.flurry.android:marketing:14.0.0'

implementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.google.firebase:firebase-messaging:21.1.0'
}
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
android:networkSecurityConfig="@xml/network_security_config"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- 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
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.google.gms:google-services:4.3.14'

}
}
Expand Down
2 changes: 1 addition & 1 deletion example/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-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Flurry-iOS-SDK: 2ae2391515ae3248a63e95a397c1b393ae52b3a9
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_flurry_sdk: 0fe83e49d614e9304cc5ba950e6262bb80bfdc3f
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_flurry_sdk: fefbae580457c376cd0f42babc948f87225e0bbc

PODFILE CHECKSUM: 1d5103e59c34489a395ae7f46690437f27451f42

Expand Down
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -411,7 +411,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -460,7 +460,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class FlurryExample {
.withCrashReporting(true)
.withLogEnabled(true)
.withLogLevel(LogLevel.debug)
.withReportLocation(true)
.withMessaging(true, MyMessagingListener())
.build(
androidAPIKey: FLURRY_ANDROID_API_KEY,
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/FlurryFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#endif

NSString *originName = @"flutter-flurry-sdk";
NSString *originVersion = @"2.2.1";
NSString *originVersion = @"3.0.0";

static FlurryFlutterPlugin* sharedInstance;

Expand Down
6 changes: 6 additions & 0 deletions lib/flurry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,12 @@ class Builder {
return this;
}

/// Sets user's preference to allow Flurry to record location via GPS.
Builder withReportLocation([bool reportLocation = true]) {
builderAgent?.withReportLocation(reportLocation);
return this;
}

/// Sets flag for performance metrics reporting.
Builder withPerformanceMetrics([int performanceMetrics = Performance.all]) {
builderAgent?.withPerformanceMetrics(performanceMetrics);
Expand Down
9 changes: 9 additions & 0 deletions lib/src/flurry_agent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ class BuilderAgent {
'withLogLevel', <String, dynamic>{'logLevelStr': logLevelStr});
}

void withReportLocation(bool reportLocation) {
if (Platform.isIOS) {
print('Flurry iOS SDK does not implement withReportLocation method');
} else {
_agentBuilderChannel.invokeMethod('withReportLocation',
<String, dynamic>{'reportLocation': reportLocation});
}
}

void withPerformanceMetrics(int performanceMetrics) {
if (Platform.isIOS) {
print('Flurry iOS SDK does not implement withPerformanceMetrics method');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_flurry_sdk
description: A Flutter plugin for Flurry Analytics SDK. Flurry Push for messaging and Flurry Config for remote configuration are supported by our plugin as well!
version: 2.2.1
version: 3.0.0
homepage: https://www.flurry.com/
repository: https://github.com/flurry/flutter-flurry-sdk

Expand Down

0 comments on commit fd2d0c2

Please sign in to comment.