Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit c1b7f2e

Browse files
author
Aliaksei Nestsiarovich
committed
Release AppMetrica Push Unity Plugin 1.0.0
1 parent 3027b83 commit c1b7f2e

29 files changed

+203
-289
lines changed

AppMetricaPush.unitypackage

-2.23 MB
Binary file not shown.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# AppMetrica Push - Unity Plugin
22

3+
## Changelog
4+
5+
### Version 1.0.0
6+
* Updated native SDKs *(iOS 1.1.1, Android 2.1.1)*
7+
* Supported [EDM4U](https://github.com/googlesamples/unity-jar-resolver) for dependency resolution
8+
39
## License
410
License agreement on use of Yandex AppMetrica SDK is available at [EULA site][LICENSE].
511

YandexMetricaPushPluginSample/Assets/AppMetricaPush/AppMetricaPush.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
public class AppMetricaPush : MonoBehaviour
1313
{
14+
public const string VERSION = "1.0.0";
15+
1416
private static bool _isInitialized = false;
1517

1618
private static IYandexMetricaPush _instance = null;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<dependencies>
3+
<androidPackages>
4+
<androidPackage spec="com.yandex.android:mobmetricapushlib:2.1.1"/>
5+
<androidPackage spec="com.yandex.android:appmetricapush-plugin:2.2.1"/>
6+
<androidPackage spec="com.google.firebase:firebase-messaging:22.0.0"/>
7+
<androidPackage spec="com.google.android.gms:play-services-base:17.5.0"/>
8+
<androidPackage spec="androidx.legacy:legacy-support-v4:1.0.0"/>
9+
</androidPackages>
10+
<iosPods>
11+
<iosPod name="YandexMobileMetricaPush" version="1.1.1" minTargetSdk="9.0"/>
12+
</iosPods>
13+
</dependencies>

YandexMetricaPushPluginSample/Assets/AppMetricaPush/Editor/PostprocessBuildPlayerAppMetricaPush.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
using UnityEngine;
1010
using UnityEditor;
1111
using UnityEditor.Callbacks;
12-
using UnityEditor.iOS.Xcode;
1312
using System.IO;
1413
using System.Collections;
14+
#if UNITY_IPHONE || UNITY_IOS
15+
using UnityEditor.iOS.Xcode;
16+
#endif
1517

1618
/// <summary>
1719
/// Postprocess build player for AppMetrica Push.
@@ -27,19 +29,25 @@ public class PostprocessBuildPlayerAppMetricaPush
2729
[PostProcessBuild]
2830
public static void OnPostprocessBuild (BuildTarget buildTarget, string path)
2931
{
32+
#if UNITY_IPHONE || UNITY_IOS
3033
if (buildTarget == BuildTarget.iOS) {
3134
var projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
3235

3336
var project = new PBXProject ();
3437
project.ReadFromString (File.ReadAllText (projectPath));
3538

36-
var target = project.TargetGuidByName ("Unity-iPhone");
39+
#if UNITY_2019_3_OR_NEWER
40+
var target = project.GetUnityFrameworkTargetGuid ();
41+
#else
42+
var target = project.TargetGuidByName ("Unity-iPhone");
43+
#endif
3744

3845
foreach (var frameworkName in WeakFrameworks) {
3946
project.AddFrameworkToProject (target, frameworkName + ".framework", true);
4047
}
4148

4249
File.WriteAllText (projectPath, project.WriteToString ());
4350
}
51+
#endif
4452
}
4553
}

0 commit comments

Comments
 (0)