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.1.0
Browse files Browse the repository at this point in the history
- Upgrade Flurry Android SDK version to 14.1.0
- Upgrade Flurry iOS SDK version to 12.2.0
- Support GPP Consents APIs
  • Loading branch information
poting-oath committed Feb 7, 2023
1 parent fd2d0c2 commit 20c3886
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 25 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.1.0 (2023-02-02)

#### Features

* Upgrade Flurry Android SDK version to 14.1.0
* Upgrade Flurry iOS SDK version to 12.2.0
* Support GPP Consents APIs

# v3.0.0 (2022-10-26)

#### Features
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ See [Android](https://flurry.github.io/flurry-android-sdk/analytics/index.html)-
Builder withAppVersion(String versionName); // iOS only. For Android, please use Flurry.setVersionName() instead.
Builder withContinueSessionMillis(int sessionMillis);
Builder withCrashReporting(bool crashReporting);
Builder.withGppConsent(String gppString, Set<int> gppSectionIds);
Builder withDataSaleOptOut(bool isOptOut);
Builder withIncludeBackgroundSessionsInMetrics(bool includeBackgroundSessionsInMetrics);
Builder withLogEnabled(bool enableLog);
Expand Down Expand Up @@ -339,6 +340,7 @@ See [Android](https://flurry.github.io/flurry-android-sdk/analytics/index.html)-
- **Methods to set privacy preferences**

```dart
void Flurry.setGppConsent(String gppString, Set<int> gppSectionIds);
void Flurry.setDataSaleOptOut(bool isOptOut);
void Flurry.deleteData();
void Flurry.openPrivacyDashboard();
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ android {
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

implementation 'com.flurry.android:analytics:14.0.0'
implementation 'com.flurry.android:marketing:14.0.0'
implementation 'com.flurry.android:analytics:14.1.0'
implementation 'com.flurry.android:marketing:14.1.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.flurry.android.marketing.messaging.notification.FlurryMessage;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

Expand All @@ -54,7 +55,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 = "3.0.0";
private static final String ORIGIN_VERSION = "3.1.0";

private Context context;

Expand Down Expand Up @@ -174,6 +175,11 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
boolean crashReporting = call.<Boolean>argument("crashReporting");
withCrashReporting(crashReporting);
break;
case "withGppConsent":
String gppString = call.argument("gppString");
List<Integer> gppSectionIds = call.argument("gppSectionIds");
builder.withGppConsent(gppString, new HashSet<>(gppSectionIds));
break;
case "withDataSaleOptOut":
boolean isOptOut = call.<Boolean>argument("isOptOut");
withDataSaleOptOut(isOptOut);
Expand Down Expand Up @@ -325,6 +331,11 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
case "setIAPReportingEnabled":
setIAPReportingEnabled();
break;
case "setGppConsent":
gppString = call.argument("gppString");
gppSectionIds = call.argument("gppSectionIds");
FlurryAgent.setGppConsent(gppString, new HashSet<>(gppSectionIds));
break;
case "setDataSaleOptOut":
isOptOut = call.<Boolean>argument("isOptOut");
setDataSaleOptOut(isOptOut);
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 33
compileSdkVersion flutter.compileSdkVersion

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 33
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
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:14.0.0'
implementation 'com.flurry.android:marketing:14.0.0'
implementation 'com.flurry.android:analytics:14.1.0'
implementation 'com.flurry.android:marketing:14.1.0'

implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.google.firebase:firebase-messaging:21.1.0'
}
}
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.3.0'
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-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
18 changes: 9 additions & 9 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Flurry-iOS-SDK/CrashReporter (12.1.1)
- Flurry-iOS-SDK/FlurryConfig (12.1.1):
- Flurry-iOS-SDK/CrashReporter (12.2.0)
- Flurry-iOS-SDK/FlurryConfig (12.2.0):
- Flurry-iOS-SDK/FlurrySDK
- Flurry-iOS-SDK/FlurryMessaging (12.1.1):
- Flurry-iOS-SDK/FlurryMessaging (12.2.0):
- Flurry-iOS-SDK/FlurrySDK
- Flurry-iOS-SDK/FlurrySDK (12.1.1):
- Flurry-iOS-SDK/FlurrySDK (12.2.0):
- Flurry-iOS-SDK/CrashReporter
- Flutter (1.0.0)
- flutter_flurry_sdk (0.0.1):
- Flurry-iOS-SDK/FlurryConfig (~> 12.1.1)
- Flurry-iOS-SDK/FlurryMessaging (~> 12.1.1)
- Flurry-iOS-SDK/FlurrySDK (~> 12.1.1)
- Flurry-iOS-SDK/FlurryConfig (~> 12.2.0)
- Flurry-iOS-SDK/FlurryMessaging (~> 12.2.0)
- Flurry-iOS-SDK/FlurrySDK (~> 12.2.0)
- Flutter

DEPENDENCIES:
Expand All @@ -28,9 +28,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_flurry_sdk/ios"

SPEC CHECKSUMS:
Flurry-iOS-SDK: 2ae2391515ae3248a63e95a397c1b393ae52b3a9
Flurry-iOS-SDK: acac6eb6761fc39f7accbf1f8c4859ef297c7ee9
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_flurry_sdk: fefbae580457c376cd0f42babc948f87225e0bbc
flutter_flurry_sdk: 1fe3874c8fd55c820d0563fa0297930ed74e35b9

PODFILE CHECKSUM: 1d5103e59c34489a395ae7f46690437f27451f42

Expand Down
4 changes: 3 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -232,6 +232,7 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -246,6 +247,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
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 @@ -43,5 +43,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: flutter_flurry_sdk_example
description: Demonstrates how to use the flutter_flurry_sdk plugin.
version: 1.0.0

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
Expand Down
18 changes: 17 additions & 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 = @"3.0.0";
NSString *originVersion = @"3.1.0";

static FlurryFlutterPlugin* sharedInstance;

Expand Down Expand Up @@ -219,6 +219,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[self flurryWithAppVersion:call.arguments];
} else if ([@"withContinueSessionMillis" isEqualToString:call.method]) {
[self flurryWithSessionContinueSeconds:call.arguments];
} else if([@"withGppConsent" isEqualToString:call.method]) {
[self flurryWithGppConsent:call.arguments];
} else if([@"withDataSaleOptOut" isEqualToString:call.method]) {
[self flurryWithDataSaleOptOut:call.arguments];
} else if([@"withIncludeBackgroundSessionsInMetrics" isEqualToString:call.method]) {
Expand Down Expand Up @@ -296,6 +298,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[self flurrySetAge:call.arguments];
} else if([@"setGender" isEqualToString:call.method]) {
[self flurrySetGender:call.arguments];
} else if([@"setGppConsent" isEqualToString:call.method]) {
[self flurrySetGppConsent:call.arguments];
} else if([@"setDataSaleOptOut" isEqualToString:call.method]) {
[self flurrySetDataSaleOptOut:call.arguments];
} else if([@"setIAPReportingEnabled" isEqualToString:call.method]) {
Expand Down Expand Up @@ -373,6 +377,12 @@ -(void) flurryWithSessionContinueSeconds:(nullable NSDictionary*)seconds {
[builder withSessionContinueSeconds:secondsInt];
}

-(void) flurryWithGppConsent:(NSDictionary *)gppConsent {
NSString* gppString = gppConsent[@"gppString"];
NSArray* gppSectionIds = gppConsent[@"gppSectionIds"];
[builder withGppConsent:gppString gppSectionIds:gppSectionIds];
}

-(void) flurryWithDataSaleOptOut:(NSDictionary*)optOut {
BOOL isOptOut = optOut[@"isOptOut"];
[builder withDataSaleOptOut:isOptOut];
Expand Down Expand Up @@ -616,6 +626,12 @@ -(void) flurrySetGender:(NSDictionary*)genderDict {
[Flurry setGender:gender];
}

-(void) flurrySetGppConsent:(NSDictionary *)gppConsent {
NSString* gppString = gppConsent[@"gppString"];
NSArray* gppSectionIds = gppConsent[@"gppSectionIds"];
[Flurry setGppConsent:gppString gppSectionIds:gppSectionIds];
}

-(void) flurrySetDataSaleOptOut:(NSDictionary*)optOut {
BOOL isOptOut = optOut[@"isOptOut"];
[FlurryCCPA setDataSaleOptOut:isOptOut];
Expand Down
2 changes: 1 addition & 1 deletion ios/flutter_flurry_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Run `pod lib lint flutter_flurry_sdk.podspec` to validate before publishing.
#

sdkVersion = '12.1.1'
sdkVersion = '12.2.0'

Pod::Spec.new do |s|
s.name = 'flutter_flurry_sdk'
Expand Down
17 changes: 17 additions & 0 deletions lib/flurry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ class Flurry {
flurryAgent?.setSslPinningEnabled(sslPinningEnabled);
}

/// Set Flurry Consent for the IAB Global Privacy Platform (GPP). To pass an IAB string to Flurry.
///
/// Set Flurry Consent for the IAB Global Privacy Platform (GPP) with the GPP string of
/// [gppString], and the GPP section IDs of [gppSectionIds].
static void setGppConsent(String gppString, Set<int> gppSectionIds) {
flurryAgent?.setGppConsent(gppString, gppSectionIds);
}

/// Sends CCPA compliance data to Flurry.
///
/// Opts out or opt in to data sale to third parties based boolean value of
Expand Down Expand Up @@ -462,6 +470,15 @@ class Builder {
return this;
}

/// Set Flurry Consent for the IAB Global Privacy Platform (GPP). To pass an IAB string to Flurry.
///
/// Set Flurry Consent for the IAB Global Privacy Platform (GPP) with the GPP string of
/// [gppString], and the GPP section IDs of [gppSectionIds].
Builder withGppConsent(String gppString, Set<int> gppSectionIds) {
builderAgent?.withGppConsent(gppString, gppSectionIds);
return this;
}

/// Sends CCPA compliance data to Flurry.
///
/// Sends CCPA compliance data to Flurry on the user's choice to opt out or
Expand Down
16 changes: 16 additions & 0 deletions lib/src/flurry_agent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ class FlurryAgent {
}
}

void setGppConsent(String gppString, Set<int> gppSectionIds) {
_agentChannel.invokeMethod(
'setGppConsent', <String, dynamic>{
'gppString': gppString,
'gppSectionIds': gppSectionIds.toList()
});
}

void setDataSaleOptOut(bool isOptOut) {
_agentChannel.invokeMethod(
'setDataSaleOptOut', <String, dynamic>{'isOptOut': isOptOut});
Expand Down Expand Up @@ -334,6 +342,14 @@ class BuilderAgent {
<String, dynamic>{'crashReporting': crashReporting});
}

void withGppConsent(String gppString, Set<int> gppSectionIds) {
_agentBuilderChannel.invokeMethod(
'withGppConsent', <String, dynamic>{
'gppString': gppString,
'gppSectionIds': gppSectionIds.toList()
});
}

void withDataSaleOptOut(bool isOptOut) {
_agentBuilderChannel.invokeMethod(
'withDataSaleOptOut', <String, dynamic>{'isOptOut': isOptOut});
Expand Down
4 changes: 2 additions & 2 deletions 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: 3.0.0
version: 3.1.0
homepage: https://www.flurry.com/
repository: https://github.com/flurry/flutter-flurry-sdk

Expand All @@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down

0 comments on commit 20c3886

Please sign in to comment.