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

Commit

Permalink
Release AppMetrica Push Unity Plugin 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliaksei Nestsiarovich committed May 27, 2022
1 parent 3027b83 commit c1b7f2e
Show file tree
Hide file tree
Showing 29 changed files with 203 additions and 289 deletions.
Binary file modified AppMetricaPush.unitypackage
Binary file not shown.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# AppMetrica Push - Unity Plugin

## Changelog

### Version 1.0.0
* Updated native SDKs *(iOS 1.1.1, Android 2.1.1)*
* Supported [EDM4U](https://github.com/googlesamples/unity-jar-resolver) for dependency resolution

## License
License agreement on use of Yandex AppMetrica SDK is available at [EULA site][LICENSE].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

public class AppMetricaPush : MonoBehaviour
{
public const string VERSION = "1.0.0";

private static bool _isInitialized = false;

private static IYandexMetricaPush _instance = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<dependencies>
<androidPackages>
<androidPackage spec="com.yandex.android:mobmetricapushlib:2.1.1"/>
<androidPackage spec="com.yandex.android:appmetricapush-plugin:2.2.1"/>
<androidPackage spec="com.google.firebase:firebase-messaging:22.0.0"/>
<androidPackage spec="com.google.android.gms:play-services-base:17.5.0"/>
<androidPackage spec="androidx.legacy:legacy-support-v4:1.0.0"/>
</androidPackages>
<iosPods>
<iosPod name="YandexMobileMetricaPush" version="1.1.1" minTargetSdk="9.0"/>
</iosPods>
</dependencies>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using System.Collections;
#if UNITY_IPHONE || UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif

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

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

var target = project.TargetGuidByName ("Unity-iPhone");
#if UNITY_2019_3_OR_NEWER
var target = project.GetUnityFrameworkTargetGuid ();
#else
var target = project.TargetGuidByName ("Unity-iPhone");
#endif

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

File.WriteAllText (projectPath, project.WriteToString ());
}
#endif
}
}
Loading

0 comments on commit c1b7f2e

Please sign in to comment.