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.3.0
Browse files Browse the repository at this point in the history
- Upgrade Flurry Android SDK version to 14.4.0
- Upgrade Flurry iOS SDK version to 12.4.0
- Support Timed event logging APIs with the 2nd key
  • Loading branch information
poting-oath committed Aug 30, 2023
1 parent 91d4efe commit c68ea21
Show file tree
Hide file tree
Showing 18 changed files with 332 additions and 138 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.3.0 (2023-08-28)

#### Features

* Upgrade Flurry Android SDK version to 14.4.0
* Upgrade Flurry iOS SDK version to 12.4.0
* Support Timed event logging APIs with the 2nd key

## v3.2.0 (2023-04-02)

#### Features
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,14 @@ See [Android](https://flurry.github.io/flurry-android-sdk/analytics/index.html)-
Future<EventRecordStatus> Flurry.logEvent(String eventId);
Future<EventRecordStatus> Flurry.logEventWithParameters(String eventId, Map<String, String> parameters);
Future<EventRecordStatus> Flurry.logTimedEvent(String eventId, bool timed);
Future<EventRecordStatus> Flurry.logTimedEventWithParamters(String eventId, Map<String, String> parameters, bool timed);
Future<EventRecordStatus> Flurry.logTimedEventWithParameters(String eventId, Map<String, String> parameters, bool timed);
Future<EventRecordStatus> Flurry.logTimedEventId(String eventId, String timedId);
Future<EventRecordStatus> Flurry.logTimedEventIdWithParameters(String eventId, Map<String, String> parameters, String timedId);
void Flurry.endTimedEvent(String eventId);
void Flurry.endTimedEventWithParameters(String eventId, Map<String, String> parameters);
void Flurry.endTimedEventId(String eventId, String timedId);
void Flurry.endTimedEventIdWithParameters(String eventId, Map<String, String> parameters, String timedId);
Future<EventRecordStatus> Flurry.logStandardEvent(StandardEventId id, Param param);
Expand Down
6 changes: 4 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
namespace "com.flurry.android.flutter"

compileSdkVersion 33

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

implementation 'com.flurry.android:analytics:14.2.0'
implementation 'com.flurry.android:marketing:14.2.0'
implementation 'com.flurry.android:analytics:14.4.0'
implementation 'com.flurry.android:marketing:14.4.0'
}
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.flurry.android.flutter">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -55,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.2.0";
private static final String ORIGIN_VERSION = "3.3.0";

private Context context;

Expand Down Expand Up @@ -385,6 +385,19 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
status = logTimedEventWithParameters(eventId, parameters, timed);
result.success(status);
break;
case "logTimedEventId":
eventId = call.argument("eventId");
String timedId = call.<String>argument("timedId");
status = logTimedEventId(eventId, timedId);
result.success(status);
break;
case "logTimedEventIdWithParameters":
eventId = call.argument("eventId");
parameters = call.argument("parameters");
timedId = call.<String>argument("timedId");
status = logTimedEventIdWithParameters(eventId, parameters, timedId);
result.success(status);
break;
case "endTimedEvent":
eventId = call.argument("eventId");
endTimedEvent(eventId);
Expand All @@ -394,6 +407,17 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
parameters = call.argument("parameters");
endTimedEventWithParameters(eventId, parameters);
break;
case "endTimedEventId":
eventId = call.argument("eventId");
timedId = call.<String>argument("timedId");
endTimedEventId(eventId, timedId);
break;
case "endTimedEventIdWithParameters":
eventId = call.argument("eventId");
parameters = call.argument("parameters");
timedId = call.<String>argument("timedId");
endTimedEventIdWithParameters(eventId, parameters, timedId);
break;
case "logStandardEvent":
int standardId = call.<Integer>argument("id");
Map<Integer, String> flurryParam = call.<Map<Integer, String>>argument("flurryParam");
Expand Down Expand Up @@ -692,6 +716,16 @@ public int logTimedEventWithParameters(String eventId, Map<String, String> param
return (status != null) ? status.ordinal() : 0;
}

public int logTimedEventId(String eventId, String timedId) {
FlurryEventRecordStatus status = FlurryAgent.logEvent(eventId, timedId);
return (status != null) ? status.ordinal() : 0;
}

public int logTimedEventIdWithParameters(String eventId, Map<String, String> parameters, String timedId) {
FlurryEventRecordStatus status = FlurryAgent.logEvent(eventId, parameters, timedId);
return (status != null) ? status.ordinal() : 0;
}

public void endTimedEvent(String eventId) {
FlurryAgent.endTimedEvent(eventId);
}
Expand All @@ -700,6 +734,14 @@ public void endTimedEventWithParameters(String eventId, Map<String, String> para
FlurryAgent.endTimedEvent(eventId, parameters);
}

public void endTimedEventId(String eventId, String timedId) {
FlurryAgent.endTimedEvent(eventId, timedId);
}

public void endTimedEventIdWithParameters(String eventId, Map<String, String> parameters, String timedId) {
FlurryAgent.endTimedEvent(eventId, parameters, timedId);
}

public int logStandardEvent(int standardId, Map<Integer, String> flurryParam, Map<String, String> userParam) {
// Find the standard event ID.
if ((standardId < 0) || (standardId >= FlurryFlutterEvent.EVENTS.length)) {
Expand Down Expand Up @@ -923,7 +965,7 @@ private static Handler getHandler() {
*/
static class FlutterFlurryConfigListener implements FlurryConfigListener {

enum EventType {
public enum EventType {
FetchSuccess("FetchSuccess"),
FetchNoChange("FetchNoChange"),
FetchError("FetchError"),
Expand Down
6 changes: 4 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.example.flutter_flurry_sdk_example"

compileSdkVersion flutter.compileSdkVersion

defaultConfig {
Expand Down Expand Up @@ -53,8 +55,8 @@ flutter {
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

implementation 'com.flurry.android:analytics:14.2.0'
implementation 'com.flurry.android:marketing:14.2.0'
implementation 'com.flurry.android:analytics:14.4.0'
implementation 'com.flurry.android:marketing:14.4.0'

implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.google.firebase:firebase-messaging:21.1.0'
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/main/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_flurry_sdk_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
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.2.0)
- Flurry-iOS-SDK/FlurryConfig (12.2.0):
- Flurry-iOS-SDK/CrashReporter (12.4.0)
- Flurry-iOS-SDK/FlurryConfig (12.4.0):
- Flurry-iOS-SDK/FlurrySDK
- Flurry-iOS-SDK/FlurryMessaging (12.2.0):
- Flurry-iOS-SDK/FlurryMessaging (12.4.0):
- Flurry-iOS-SDK/FlurrySDK
- Flurry-iOS-SDK/FlurrySDK (12.2.0):
- Flurry-iOS-SDK/FlurrySDK (12.4.0):
- Flurry-iOS-SDK/CrashReporter
- Flutter (1.0.0)
- flutter_flurry_sdk (0.0.1):
- Flurry-iOS-SDK/FlurryConfig (~> 12.2.0)
- Flurry-iOS-SDK/FlurryMessaging (~> 12.2.0)
- Flurry-iOS-SDK/FlurrySDK (~> 12.2.0)
- Flurry-iOS-SDK/FlurryConfig (~> 12.4.0)
- Flurry-iOS-SDK/FlurryMessaging (~> 12.4.0)
- Flurry-iOS-SDK/FlurrySDK (~> 12.4.0)
- Flutter

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

SPEC CHECKSUMS:
Flurry-iOS-SDK: acac6eb6761fc39f7accbf1f8c4859ef297c7ee9
Flurry-iOS-SDK: 402045d874e9e330d2fbcdf48d82727292ade109
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_flurry_sdk: 1fe3874c8fd55c820d0563fa0297930ed74e35b9
flutter_flurry_sdk: 5693523848e564298997124810571f0d93590d09

PODFILE CHECKSUM: 1d5103e59c34489a395ae7f46690437f27451f42

Expand Down
3 changes: 2 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -237,6 +237,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 1.0.0
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0 <4.0.0"

dependencies:
flutter:
Expand Down
105 changes: 70 additions & 35 deletions 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.2.0";
NSString *originVersion = @"3.3.0";

static FlurryFlutterPlugin* sharedInstance;

Expand Down Expand Up @@ -259,10 +259,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[self flurryAddSessionProperty:call.arguments];
} else if([@"deleteData" isEqualToString:call.method]) {
[self flurrySetDelete];
} else if([@"endTimedEvent" isEqualToString:call.method]) {
[self flurryEndTimedEvent:call.arguments];
} else if([@"endTimedEventWithParameters" isEqualToString:call.method]) {
[self flurryEndTimedEventWithParameters:call.arguments];
} else if([@"getAgentVersion" isEqualToString:call.method]) {
NSNumber* agentVersion = [NSNumber numberWithLong:[self flurryGetAgentVersion]];
result(agentVersion);
Expand All @@ -280,14 +276,29 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
} else if([@"logEventWithParameters" isEqualToString:call.method]) {
NSNumber* logEvent = [NSNumber numberWithLong:[self flurryLogEventWithParameters:call.arguments]];
result(logEvent);
} else if([@"logPayment" isEqualToString:call.method]) {
NSNumber* num = [NSNumber numberWithLong:[self flurryLogPayment:call.arguments]];
result(num);
} else if([@"logTimedEvent" isEqualToString:call.method]) {
[self flurryLogTimedEvent:call.arguments];
NSNumber* logEvent = [NSNumber numberWithLong:[self flurryLogTimedEvent:call.arguments]];
result(logEvent);
} else if([@"logTimedEventWithParameters" isEqualToString:call.method]) {
NSNumber* logEvent = [NSNumber numberWithLong:[self flurryLogTimedEventWithParameters:call.arguments]];
result(logEvent);
} else if([@"logTimedEventId" isEqualToString:call.method]) {
NSNumber* logEvent = [NSNumber numberWithLong:[self flurryLogTimedEventId:call.arguments]];
result(logEvent);
} else if([@"logTimedEventIdWithParameters" isEqualToString:call.method]) {
NSNumber* logEvent = [NSNumber numberWithLong:[self flurryLogTimedEventIdWithParameters:call.arguments]];
result(logEvent);
} else if([@"endTimedEvent" isEqualToString:call.method]) {
[self flurryEndTimedEvent:call.arguments];
} else if([@"endTimedEventWithParameters" isEqualToString:call.method]) {
[self flurryEndTimedEventWithParameters:call.arguments];
} else if([@"endTimedEventId" isEqualToString:call.method]) {
[self flurryEndTimedEventId:call.arguments];
} else if([@"endTimedEventIdWithParameters" isEqualToString:call.method]) {
[self flurryEndTimedEventIdWithParameters:call.arguments];
} else if([@"logPayment" isEqualToString:call.method]) {
NSNumber* num = [NSNumber numberWithLong:[self flurryLogPayment:call.arguments]];
result(num);
} else if([@"onError" isEqualToString:call.method]) {
[self flurryLogError:call.arguments];
} else if([@"onErrorWithParameters" isEqualToString:call.method]) {
Expand Down Expand Up @@ -505,18 +516,6 @@ -(void) flurrySetDelete {
[FlurryCCPA setDelete];
}

-(void) flurryEndTimedEvent:(NSDictionary*) event {
NSString* eventId = event[@"eventId"];
[Flurry endTimedEvent:eventId withParameters:nil];
}

-(void) flurryEndTimedEventWithParameters:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
NSMutableDictionary* params = event[@"parameters"];

[Flurry endTimedEvent:eventId withParameters: params];
}

-(NSInteger) flurryGetAgentVersion {
NSString* str = [Flurry getFlurryAgentVersion];
NSArray *arrayOfComponents = [str componentsSeparatedByString:@"_"];
Expand Down Expand Up @@ -551,6 +550,56 @@ -(NSInteger) flurryLogEventWithParameters:(NSDictionary*)event {
return [Flurry logEvent:eventId withParameters:params];
}

-(NSInteger) flurryLogTimedEvent:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
BOOL timed = event[@"timed"];
return [Flurry logEvent:eventId withParameters:nil timed:timed];
}

-(NSInteger) flurryLogTimedEventWithParameters:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
BOOL timed = event[@"timed"];
NSDictionary* params = event[@"parameters"];
return [Flurry logEvent:eventId withParameters:params timed:timed];
}

-(NSInteger) flurryLogTimedEventId:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
NSString* timedId = event[@"timedId"];
return [Flurry logEvent:eventId withEventId:timedId];
}

-(NSInteger) flurryLogTimedEventIdWithParameters:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
NSString* timedId = event[@"timedId"];
NSDictionary* params = event[@"parameters"];
return [Flurry logEvent:eventId withEventId:timedId withParameters:params];
}

-(void) flurryEndTimedEvent:(NSDictionary*) event {
NSString* eventId = event[@"eventId"];
[Flurry endTimedEvent:eventId withParameters:nil];
}

-(void) flurryEndTimedEventWithParameters:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
NSMutableDictionary* params = event[@"parameters"];
[Flurry endTimedEvent:eventId withParameters: params];
}

-(void) flurryEndTimedEventId:(NSDictionary*) event {
NSString* eventId = event[@"eventId"];
NSString* timedId = event[@"timedId"];
[Flurry endTimedEvent:eventId withEventId:timedId withParameters:nil];
}

-(void) flurryEndTimedEventIdWithParameters:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
NSString* timedId = event[@"timedId"];
NSMutableDictionary* params = event[@"parameters"];
[Flurry endTimedEvent:eventId withEventId:timedId withParameters: params];
}

-(NSInteger) flurryLogPayment:(NSDictionary*)payment {
NSString* productName = payment[@"productName"];
NSString* productId = payment[@"productId"];
Expand All @@ -569,20 +618,6 @@ -(NSInteger) flurryLogPayment:(NSDictionary*)payment {
return transactionStatus;
}

-(void) flurryLogTimedEvent:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
BOOL timed = event[@"timed"];
[Flurry logEvent:eventId withParameters:nil timed:timed];
}

-(NSInteger) flurryLogTimedEventWithParameters:(NSDictionary*)event {
NSString* eventId = event[@"eventId"];
BOOL timed = event[@"timed"];
NSDictionary* params = event[@"parameters"];

return [Flurry logEvent:eventId withParameters:params timed:timed];
}

-(void) flurryLogError:(NSDictionary*)errorDict {
NSString* errorId = errorDict[@"errorId"];
NSString* message = errorDict[@"message"];
Expand Down
Loading

0 comments on commit c68ea21

Please sign in to comment.