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

Commit

Permalink
Merge pull request #3 from yandexmobile/release-0.1.1
Browse files Browse the repository at this point in the history
Release AppMetrica Push Unity Plugin 0.1.1
  • Loading branch information
NesterovichAlexey authored Nov 28, 2017
2 parents 9880075 + b42d235 commit 65fdd75
Show file tree
Hide file tree
Showing 52 changed files with 520 additions and 104 deletions.
Binary file modified AppMetricaPush.unitypackage
Binary file not shown.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,5 @@ License agreement on use of Yandex AppMetrica SDK is available at [EULA site][LI
## Documentation
Documentation could be found at [AppMetrica official site][DOCUMENTATION].

## Changelog

### Version 0.1.0

* Initial release with iOS and Android native SDK *(iOS 0.4.0, Android 0.5.0)*

[LICENSE]: http://legal.yandex.ru/metrica_termsofuse/ "Yandex AppMetrica agreement"
[LICENSE]: https://yandex.com/legal/appmetrica_sdk_agreement/ "Yandex AppMetrica agreement"
[DOCUMENTATION]: https://tech.yandex.ru/metrica-mobile-sdk/doc/mobile-sdk-dg/push/unity-initialize-docpage/ "Yandex AppMetrica Push Unity Plugin documentation"
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Version for Unity
* © 2017 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

using UnityEngine;
using System.Collections;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Version for Unity
* © 2017 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using System.Collections;

/// <summary>
/// Postprocess build player for AppMetrica Push.
/// See https://bitbucket.org/Unity-Technologies/iosnativecodesamples/src/ae6a0a2c02363d35f954d244a6eec91c0e0bf194/NativeIntegration/Misc/UpdateXcodeProject/
/// </summary>

public class PostprocessBuildPlayerAppMetricaPush
{
private static readonly string[] WeakFrameworks = {
"UserNotifications"
};

[PostProcessBuild]
public static void OnPostprocessBuild (BuildTarget buildTarget, string path)
{
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");

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

File.WriteAllText (projectPath, project.WriteToString ());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OcclusionCullingSettings:
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
Expand All @@ -25,6 +25,7 @@ RenderSettings:
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
Expand All @@ -37,11 +38,11 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311918, g: 0.3807398, b: 0.35872716, a: 1}
m_IndirectSpecularColor: {r: 0.37311947, g: 0.38074005, b: 0.35872722, a: 1}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
Expand All @@ -53,7 +54,7 @@ LightmapSettings:
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 4
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
Expand All @@ -66,13 +67,29 @@ LightmapSettings:
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_DirectLightInLightProbes: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
m_UseShadowmask: 0
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
Expand All @@ -89,7 +106,11 @@ NavMeshSettings:
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &852060421
Prefab:
Expand Down Expand Up @@ -130,6 +151,10 @@ Prefab:
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11457290, guid: 1edb7f7d5ea68467097decc77664b28d, type: 2}
propertyPath: APIKey
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 1edb7f7d5ea68467097decc77664b28d, type: 2}
m_IsPrefabParent: 0
Expand Down Expand Up @@ -285,10 +310,11 @@ Camera:
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &1581957563
Transform:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* Version for Unity
* © 2017 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

using UnityEngine;
using System.Collections;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
using UnityEngine;
/*
* Version for Unity
* © 2017 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

using UnityEngine;
using System.Collections;

public interface IYandexMetricaPush
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@
-->
<manifest android:versionCode="1" android:versionName="1.0" package="com.yandex.mobile.metrica.push.sample.unity" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="24"/>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>

<!-- AppMetrica Permissions -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<!-- AppMetrica Push Permissions -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.yandex.mobile.metrica.push.sample.unity.permission.C2D_MESSAGE"/>
<permission android:name="com.yandex.mobile.metrica.push.sample.unity.permission.C2D_MESSAGE" android:protectionLevel="signature"/>


<!-- Application -->
<application android:icon="@drawable/app_icon" android:label="@string/app_name">

Expand All @@ -40,36 +31,22 @@
<action android:name="com.yandex.metrica.IMetricaService"/>
<data android:scheme="metrica"/>
</intent-filter>
<meta-data android:name="metrica:api:level" android:value="52"/>
<meta-data android:name="metrica:api:level" android:value="63"/>
</service>
<receiver android:enabled="true" android:exported="true" android:name="com.yandex.metrica.MetricaEventHandler">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>

<!-- AppMetrica Push Services and Receivers -->
<receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<service android:enabled="true" android:exported="true" android:name="com.yandex.metrica.ConfigurationService" android:process=":Metrica" tools:ignore="ExportedService">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.yandex.mobile.metricapush.pluginunity"/>
<action android:name="com.yandex.metrica.configuration.ACTION_START"/>
</intent-filter>
</receiver>
<receiver android:exported="false" android:name="com.yandex.metrica.push.core.notification.MetricaPushBroadcastReceiver">
<meta-data android:name="metrica:configuration:api:level" android:value="1"/>
</service>
<receiver android:enabled="true" android:exported="true" android:name="com.yandex.metrica.MetricaEventHandler">
<intent-filter>
<action android:name="com.yandex.metrica.push.action.NOTIFICATION_ACTION"/>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service android:exported="false" android:name="com.yandex.metrica.push.gcm.MetricaInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.yandex.metrica.push.PushService"/>

<!-- Your GCM Project Number -->
<meta-data android:name="ymp_gcm_project_number" android:value="number:51179453772"/>
<meta-data android:name="ymp_gcm_project_number" android:value="number:gcm_number"/>

</application>

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Version for Unity
* © 2017 YANDEX
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://yandex.com/legal/appmetrica_sdk_agreement/
*/

#import <Foundation/Foundation.h>
#import <YandexMobileMetrica/YandexMobileMetrica.h>
Expand Down Expand Up @@ -28,15 +35,24 @@ - (BOOL)ymp_application:(UIApplication *)application didFinishLaunchingWithOptio
{
RECURSION_CHECK(return YES);

// Call the original method
BOOL result = [self ymp_application:application didFinishLaunchingWithOptions:launchOptions];

if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] != nil) {
// We should activate AppMetrica first to handle push notification
ymp_ensureAppMetricaActivated();
}

// Enable in-app push notifications handling in iOS 10
if ([UNUserNotificationCenter class] != nil) {
id<YMPUserNotificationCenterDelegate> delegate = [YMPYandexMetricaPush userNotificationCenterDelegate];
delegate.nextDelegate = [UNUserNotificationCenter currentNotificationCenter].delegate;
[UNUserNotificationCenter currentNotificationCenter].delegate = delegate;
}

[YMPYandexMetricaPush handleApplicationDidFinishLaunchingWithOptions:launchOptions];

// Call the original method
return [self ymp_application:application didFinishLaunchingWithOptions:launchOptions];
return result;
}

- (void)ymp_application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* YMPUserNotificationCenterDelegate.h
*
* This file is a part of the AppMetrica
*
* Version for iOS © 2017 YANDEX
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at https://yandex.com/legal/metrica_termsofuse/
*/

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
#define YMP_USER_NOTIFICATIONS_CENTER_AVAILABLE
#endif

#ifdef YMP_USER_NOTIFICATIONS_CENTER_AVAILABLE

#import <UserNotifications/UserNotifications.h>

/** Delegate for handling foreground push notifications on iOS 10+.
To handle foreground push notifications execute this line before application finished launching:
[UNUserNotificationCenter currentNotificationCenter].delegate = [YMPYandexMetricaPush userNotificationCenterDelegate];
*/
@protocol YMPUserNotificationCenterDelegate <UNUserNotificationCenterDelegate>

@required

/** Notification presentation options to be passed into completion handler of
userNotificationCenter:willPresentNotification:withCompletionHandler:
This delegate calls handler only if nextDelegate property is not set
or if an object in nextDelegate doesn't respond to the selector above.
*/
@property (nonatomic, assign) UNNotificationPresentationOptions presentationOptions;

/** Delegate to which calls of this protocol will be proxied.
*/
@property (nonatomic, weak, nullable) id<UNUserNotificationCenterDelegate> nextDelegate;

@end

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* This file is a part of the AppMetrica
*
* Version for iOS © 2016 YANDEX
* Version for iOS © 2017 YANDEX
*
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
Expand All @@ -13,9 +13,9 @@
#define __YMP_VERSION_H__

#define YMP_VERSION_MAJOR 0
#define YMP_VERSION_MINOR 4
#define YMP_VERSION_MINOR 5
#define YMP_VERSION_PATCH 0

#define YMP_BUILD_NUMBER 51
#define YMP_BUILD_NUMBER 75

#endif // __YMP_VERSION_H__
Loading

0 comments on commit 65fdd75

Please sign in to comment.