Skip to content

Commit

Permalink
Add useAppSetIdForDeviceId, update unitypackage and version number to…
Browse files Browse the repository at this point in the history
… 2.3.0 (#90)

* Add method

* Update .unitypackage and version numbers:
  • Loading branch information
dantetam authored Sep 22, 2021
1 parent 192af8e commit 530a0f0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
19 changes: 18 additions & 1 deletion Assets/Amplitude/Amplitude.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class Amplitude {
private static readonly string UnityLibraryName = "amplitude-unity";
private static readonly string UnityLibraryVersion = "2.2.2";
private static readonly string UnityLibraryVersion = "2.3.0";

private static Dictionary<string, Amplitude> instances;
private static readonly object instanceLock = new object();
Expand Down Expand Up @@ -838,6 +838,23 @@ public void useAdvertisingIdForDeviceId() {
#endif
}

/// <summary>
/// iOS:
/// This method has no equivalent in iOS. See comments in `useAdvertisingIdForDeviceId()`.
///
/// Android: If this method is called, the setting for Advertising ID will be used first for the user's device ID,
/// and then if unsuccessful, fall back to Android App Set ID: a user-resetable, per device/per install ID provided by Google.
///
/// **NOTE:** Must be called before `initializeApiKey`.
/// </summary>
public void useAppSetIdForDeviceId() {
#if UNITY_ANDROID
if (Application.platform == RuntimePlatform.Android) {
pluginClass.CallStatic("useAppSetIdForDeviceId", instanceName);
}
#endif
}

/// <summary>
/// Whether to automatically log start and end session events corresponding to the start and end of a user's session.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.amplitude.unityplugin",
"version": "2.2.2",
"version": "2.3.0",
"displayName": "Amplitude Unity SDK",
"description": "A plugin to simplify the integration of Amplitude iOS and Android SDKs into your Unity project. This repository also contains a sample project with the Unity plugin integrated.",
"unity": "2019.4",
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Versioned Releases

## 2.3.0
* Add `useAppSetIdForDeviceId` API.

## 2.2.2
* Update Android version to 2.32.0 to resolve Cursor related errors.

Expand Down
Binary file modified amplitude-unity.unitypackage
Binary file not shown.

0 comments on commit 530a0f0

Please sign in to comment.