File tree Expand file tree Collapse file tree 12 files changed +37
-11
lines changed
src/main/kotlin/com/amplitude/amplitude_flutter Expand file tree Collapse file tree 12 files changed +37
-11
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.2.0
2
+ * Add ` setServerUrl ` API to customize server destination.
3
+
1
4
## 2.1.1
2
5
* Fix calling ` setUserId ` with null crashes on iOS.
3
6
Original file line number Diff line number Diff line change @@ -40,6 +40,6 @@ android {
40
40
}
41
41
dependencies {
42
42
implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
43
- implementation " com.amplitude:android-sdk:2.25.1 "
43
+ implementation " com.amplitude:android-sdk:2.27.0 "
44
44
implementation " com.squareup.okhttp3:okhttp:4.2.2"
45
45
}
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ class AmplitudeFlutterPlugin : MethodCallHandler {
79
79
80
80
result.success(" setUserId called.." )
81
81
}
82
+ " setServerUrl" -> {
83
+ val client = Amplitude .getInstance(instanceName)
84
+ client.setServerUrl(json.optString(" serverUrl" , null ))
85
+
86
+ result.success(" setServerUrl called.." )
87
+ }
82
88
83
89
// Event logging
84
90
" logEvent" -> {
Original file line number Diff line number Diff line change 1
1
# Uncomment this line to define a global platform for your project
2
- platform :ios , '10.0'
2
+ platform :ios , '10.0'
3
3
4
4
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5
5
ENV [ 'COCOAPODS_DISABLE_STATS' ] = 'true'
Original file line number Diff line number Diff line change 1
1
PODS:
2
- - Amplitude (5.1.0 )
2
+ - Amplitude (5.2.1 )
3
3
- amplitude_flutter (0.0.1):
4
- - Amplitude (= 5.1.0 )
4
+ - Amplitude (= 5.2.1 )
5
5
- Flutter
6
6
- Flutter (1.0.0)
7
7
@@ -20,10 +20,10 @@ EXTERNAL SOURCES:
20
20
:path: Flutter
21
21
22
22
SPEC CHECKSUMS:
23
- Amplitude: 1d3d18f82ba9852011aa7b9a741eac616d78fa82
24
- amplitude_flutter: 3341d2e7cf7321353140e2230531be45f5471bb2
23
+ Amplitude: 9774e93d48d9f41f271a4479e06369a30ab31db1
24
+ amplitude_flutter: 5b9cab3f48db637a37d67b93e5dc49fa9b206686
25
25
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
26
26
27
- PODFILE CHECKSUM: 781964779c4d3a08769886e28094ffd2a1e5bcb2
27
+ PODFILE CHECKSUM: f45d293502bdcca725aca7bc62af43ad173e1292
28
28
29
29
COCOAPODS: 1.9.1
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class _MyAppState extends State<MyApp> {
28
28
super .initState ();
29
29
30
30
analytics = Amplitude .getInstance (instanceName: "project" );
31
+ analytics.setServerUrl ("https://api2.amplitude.com" );
31
32
analytics.init (widget.apiKey);
32
33
analytics.enableCoppaControl ();
33
34
analytics.setUserId ("test_user" );
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ packages:
7
7
path: ".."
8
8
relative: true
9
9
source: path
10
- version: "2.1.1 "
10
+ version: "2.2.0 "
11
11
async:
12
12
dependency: transitive
13
13
description:
Original file line number Diff line number Diff line change @@ -70,6 +70,14 @@ import Amplitude
70
70
71
71
Amplitude . instance ( withName: instanceName) ? . setUserId ( userId, startNewSession: startNewSession)
72
72
result ( true )
73
+ case " setServerUrl " :
74
+ var serverUrl : String ? = nil
75
+ if !( args [ " serverUrl " ] is NSNull ) {
76
+ serverUrl = args [ " serverUrl " ] as! String ?
77
+ }
78
+
79
+ Amplitude . instance ( withName: instanceName) ? . setServerUrl ( serverUrl)
80
+ result ( true )
73
81
74
82
// Event logging
75
83
case " logEvent " :
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
s . source_files = 'Classes/**/*'
13
13
s . public_header_files = 'Classes/**/*.h'
14
14
s . dependency 'Flutter'
15
- s . dependency 'Amplitude' , '5.1.0 '
15
+ s . dependency 'Amplitude' , '5.2.1 '
16
16
17
17
s . ios . deployment_target = '10.0'
18
18
end
Original file line number Diff line number Diff line change @@ -88,6 +88,14 @@ class Amplitude extends _Amplitude {
88
88
return await _channel.invokeMethod ('setUserId' , jsonEncode (properties));
89
89
}
90
90
91
+ /// Customize the destination for server url.
92
+ Future <void > setServerUrl (String serverUrl) async {
93
+ Map <String , dynamic > properties = _baseProperties ();
94
+ properties['serverUrl' ] = serverUrl;
95
+
96
+ return await _channel.invokeMethod ('setServerUrl' , jsonEncode (properties));
97
+ }
98
+
91
99
/// Tracks an event. Events are saved locally.
92
100
///
93
101
/// Uploads are batched to occur every 30 events or every 30 seconds
Original file line number Diff line number Diff line change 1
1
class Constants {
2
2
static const packageName = 'amplitude-flutter' ;
3
- static const packageVersion = '2.1.1 ' ;
3
+ static const packageVersion = '2.2.0 ' ;
4
4
}
Original file line number Diff line number Diff line change 1
1
name : amplitude_flutter
2
2
description : Amplitude Flutter plugin
3
- version : 2.1.1
3
+ version : 2.2.0
4
4
homepage : https://www.amplitude.com
5
5
6
6
environment :
You can’t perform that action at this time.
0 commit comments