Skip to content

Commit 1d79eba

Browse files
authored
Merge pull request #50 from flagship-io/sdkFixVersion
add keys context
2 parents e202ac4 + 79ce158 commit 1d79eba

File tree

13 files changed

+49
-13
lines changed

13 files changed

+49
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
# 4.0.2 - 24/06/2025
3+
4+
### Fix
5+
Add information in visitor context: fs_users , fs_client , fs_version.
6+
27
# 4.0.1 - 18/04/2025
38

49
### Fixed

example/android/gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
org.gradle.jvmargs=-Xmx1536M
21
android.useAndroidX=true
32
android.enableJetifier=true
3+
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
4+
kotlin.daemon.jvm.options=-Xmx2048m

example/lib/Providers/fs_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class FSData extends ChangeNotifier {
6363
}
6464

6565
class UserData extends ChangeNotifier {
66-
String _visitorId = "flutter_user253";
66+
String _visitorId = "flutter_user196";
6767
Map<String, Object> context = {
6868
"testing_tracking_manager": true,
6969
"isQA": true,

example/lib/widgets/configuration.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:io';
22
import 'package:flagship/cache/interface_cache.dart';
33
import 'package:flagship/flagship.dart';
4+
import 'package:flagship/flagshipContext/flagship_context.dart';
45
import 'package:flagship/flagship_config.dart';
56
import 'package:flagship/hits/event.dart';
67
import 'package:flagship/hits/item.dart';

lib/flagshipContext/flagship_context.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,15 @@ enum FlagshipContext {
5959
APP_VERSION_CODE, // = "sdk_versionCode"
6060

6161
/// Version FlagShip
62+
@Deprecated('Use .FS_VERSION')
6263
FLAGSHIP_VERSION, // = "sdk_fsVersion"
6364

65+
FS_VERSION, // = "fs_Version"
66+
6467
/// Name of the interface
6568
INTERFACE_NAME, // = "sdk_interfaceName"
69+
70+
FS_CLIENT, // fs_client
6671
}
6772

6873
// Get the key for the relative context
@@ -129,6 +134,12 @@ String rawValue(FlagshipContext type) {
129134
case FlagshipContext.INTERFACE_NAME:
130135
ret = "sdk_interfaceName";
131136
break;
137+
case FlagshipContext.FS_VERSION:
138+
ret = "fs_version";
139+
break;
140+
case FlagshipContext.FS_CLIENT:
141+
ret = "fs_client";
142+
break;
132143
}
133144
return ret;
134145
}

lib/flagshipContext/flagship_context_manager.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ class FlagshipContextManager {
3030
case FlagshipContext.OS_VERSION_CODE:
3131
return FSDevice.getSystemVersion();
3232
case FlagshipContext.FLAGSHIP_VERSION:
33+
case FlagshipContext.FS_VERSION:
3334
return FlagshipVersion;
3435
// Set by the client
36+
case FlagshipContext.FS_CLIENT:
37+
return "flutter";
3538
case FlagshipContext.LOCATION_CITY:
3639
case FlagshipContext.LOCATION_REGION:
3740
case FlagshipContext.LOCATION_COUNTRY:
@@ -70,6 +73,8 @@ class FlagshipContextManager {
7073
case FlagshipContext.FLAGSHIP_VERSION:
7174
case FlagshipContext.INTERFACE_NAME:
7275
case FlagshipContext.IP:
76+
case FlagshipContext.FS_VERSION:
77+
case FlagshipContext.FS_CLIENT:
7378
return (value is String);
7479
// double
7580
case FlagshipContext.LOCATION_LAT:

lib/flagship_version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/// This file is automatically updated
2-
const FlagshipVersion = "4.0.1";
2+
const FlagshipVersion = "4.0.2";

lib/hits/hit.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class BaseHit extends Hit {
7575
/// Session number
7676
if (sessionNumber != null) result["sn"] = sessionNumber ?? 0;
7777

78+
/// Location
79+
if (location != null) result["dl"] = location ?? "";
80+
7881
/// Add qt entries
7982
/// Time difference between when the hit was created and when it was sent
8083
if (this.createdAt != null) {

lib/hits/page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Page extends BaseHit {
99
@override
1010
Map<String, Object> get bodyTrack {
1111
var customBody = new Map<String, Object>();
12-
customBody.addAll({"t": typeOfEvent, "dl": super.location ?? ""});
12+
customBody.addAll({"t": typeOfEvent});
1313
// Add commun body
1414
customBody.addAll(super.communBodyTrack);
1515
return customBody;

lib/hits/screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Screen extends BaseHit {
99
@override
1010
Map<String, Object> get bodyTrack {
1111
var customBody = new Map<String, Object>();
12-
customBody.addAll({"t": typeOfEvent, "dl": super.location ?? ""});
12+
customBody.addAll({"t": typeOfEvent});
1313
// Add commun body
1414
customBody.addAll(super.communBodyTrack);
1515
return customBody;

0 commit comments

Comments
 (0)