Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to the latests native SDKs #179

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
- name: Analyze
run: flutter analyze --no-fatal-infos

# - name: Test
# run: flutter test
- name: Test
run: flutter test

- name: Semantic Release --dry-run
if: ${{ github.event.inputs.dryRun == 'true'}}
Expand Down
10 changes: 8 additions & 2 deletions lib/amplitude.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class Amplitude {
MethodChannel _channel = const MethodChannel("amplitude_flutter");

/// Returns an Amplitude instance
///
/// Call `init()` to initialize underlying SDKs on native platforms
/// ```
/// var amplitude = Amplitude(Configuration(apiKey: "apiKey"));
/// await amplitude.init();
justin-fiedler marked this conversation as resolved.
Show resolved Hide resolved
/// ```
Amplitude(this.configuration);

/// Initializes an Amplitude instance
Expand Down Expand Up @@ -184,14 +190,14 @@ class Amplitude {
Map<String, String?> properties = {};
properties["setDeviceId"] = deviceId;

await await _channel.invokeMethod("setDeviceId", properties);
return await _channel.invokeMethod("setDeviceId", properties);
}

/// Resets userId to "null" and deviceId to a random UUID.
///
/// Note different devices on different platforms should have different device Ids.
Future<void> reset() async {
await await _channel.invokeMethod("reset");
return await _channel.invokeMethod("reset");
}

/// Flush events in storage.
Expand Down
14 changes: 8 additions & 6 deletions lib/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import 'constants.dart';
import 'tracking_options.dart';
import 'default_tracking.dart';

/// Configuration for Amplitude instance.
///
/// Before initializing Amplitude instance, create a Configuration instance
/// with your desired configuration and pass it to the Amplitude instance.
/// Note the Configuration is immutable (cannot be changed) after being passed to Amplitude.init()
/// `optOut` can be changed later by calling `setOptOut()`.
class Configuration {
String apiKey;
int flushQueueSize;
Expand Down Expand Up @@ -40,6 +34,14 @@ class Configuration {
bool useAppSetIdForDeviceId;
/// Web specific
String? appVersion;

/// Configuration for Amplitude instance.
///
/// Before initializing Amplitude instance, create a Configuration instance
/// with your desired configuration and pass it to the Amplitude instance.
///
/// Note the Configuration is immutable (cannot be changed) after being passed to Amplitude
/// `optOut` can be changed later by calling `setOptOut()`.
Configuration({
required this.apiKey,
this.flushQueueSize = Constants.flushQueueSize,
Expand Down
3 changes: 2 additions & 1 deletion release.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
"branches": [
"main"
"main",
{ "name": "beta", "prerelease": true },
yuhao900914 marked this conversation as resolved.
Show resolved Hide resolved
],
"tagFormat": ["v${version}"],
"plugins": [
Expand Down
Loading