diff --git a/AppMetricaPush.unitypackage b/AppMetricaPush.unitypackage index 11a2536..0b11899 100644 Binary files a/AppMetricaPush.unitypackage and b/AppMetricaPush.unitypackage differ diff --git a/README.md b/README.md index 5257fee..854ac4f 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/AppMetricaPush.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/AppMetricaPush.cs index e0e3e09..36ed956 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/AppMetricaPush.cs +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/AppMetricaPush.cs @@ -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; diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Editor/PostprocessBuildPlayerAppMetricaPush.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Editor/PostprocessBuildPlayerAppMetricaPush.cs new file mode 100644 index 0000000..1f584b2 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Editor/PostprocessBuildPlayerAppMetricaPush.cs @@ -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; + +/// +/// Postprocess build player for AppMetrica Push. +/// See https://bitbucket.org/Unity-Technologies/iosnativecodesamples/src/ae6a0a2c02363d35f954d244a6eec91c0e0bf194/NativeIntegration/Misc/UpdateXcodeProject/ +/// + +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 ()); + } + } +} diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/ExampleScene.unity b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/ExampleScene.unity index 32ea776..6d4cb5a 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/ExampleScene.unity +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/ExampleScene.unity @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/PushSampleSceneManager.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/PushSampleSceneManager.cs index 89a9db7..6b8da13 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/PushSampleSceneManager.cs +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/ExampleUI/PushSampleSceneManager.cs @@ -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; diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/IYandexAppMetricaPush.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/IYandexAppMetricaPush.cs index 7e25ae5..3eeb860 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/IYandexAppMetricaPush.cs +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/IYandexAppMetricaPush.cs @@ -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 diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/AndroidManifest.xml b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/AndroidManifest.xml index 2b89cbd..9819e35 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/AndroidManifest.xml +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/AndroidManifest.xml @@ -6,22 +6,13 @@ --> - + - - - - - - - - - @@ -40,36 +31,22 @@ - + - - - - - - - - + - - - + - - + + + - + - - - - - - - + diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/appmetrica-push-unity-plugin.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/appmetrica-push-unity-plugin.aar index 5aecd16..39e597f 100644 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/appmetrica-push-unity-plugin.aar and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/appmetrica-push-unity-plugin.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/mobmetricapushlib-0.5.0.jar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/mobmetricapushlib-0.5.0.jar deleted file mode 100644 index e87e03f..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/mobmetricapushlib-0.5.0.jar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/mobmetricapushlib-0.6.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/mobmetricapushlib-0.6.1.aar new file mode 100644 index 0000000..abe6a4a Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/mobmetricapushlib-0.6.1.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-base-10.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-base-10.2.1.aar new file mode 100644 index 0000000..6ec9f7d Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-base-10.2.1.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-base-9.6.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-base-9.6.1.aar deleted file mode 100644 index 43f5fd7..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-base-9.6.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-basement-10.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-basement-10.2.1.aar new file mode 100644 index 0000000..966c016 Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-basement-10.2.1.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-basement-9.6.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-basement-9.6.1.aar deleted file mode 100644 index 9af2072..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-basement-9.6.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-gcm-10.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-gcm-10.2.1.aar new file mode 100644 index 0000000..cc2c26b Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-gcm-10.2.1.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-gcm-9.6.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-gcm-9.6.1.aar deleted file mode 100644 index 4797c7d..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-gcm-9.6.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-iid-10.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-iid-10.2.1.aar new file mode 100644 index 0000000..15540ca Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-iid-10.2.1.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-iid-9.6.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-iid-9.6.1.aar deleted file mode 100644 index 9f66e50..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/play-services-iid-9.6.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-compat-24.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-compat-24.2.1.aar deleted file mode 100644 index d532be9..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-compat-24.2.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-compat-26.1.0.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-compat-26.1.0.aar new file mode 100644 index 0000000..bd37e17 Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-compat-26.1.0.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-ui-24.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-ui-24.2.1.aar deleted file mode 100644 index 5dd7e40..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-ui-24.2.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-ui-26.1.0.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-ui-26.1.0.aar new file mode 100644 index 0000000..34bfd64 Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-ui-26.1.0.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-utils-24.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-utils-24.2.1.aar deleted file mode 100644 index 746bfb1..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-utils-24.2.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-utils-26.1.0.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-utils-26.1.0.aar new file mode 100644 index 0000000..7187884 Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-core-utils-26.1.0.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-fragment-24.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-fragment-24.2.1.aar deleted file mode 100644 index 5d4e218..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-fragment-24.2.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-fragment-26.1.0.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-fragment-26.1.0.aar new file mode 100644 index 0000000..3a8d9c6 Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-fragment-26.1.0.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-media-compat-24.2.1.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-media-compat-24.2.1.aar deleted file mode 100644 index 2a0baf3..0000000 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-media-compat-24.2.1.aar and /dev/null differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-media-compat-26.1.0.aar b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-media-compat-26.1.0.aar new file mode 100644 index 0000000..352233e Binary files /dev/null and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/Android/support-media-compat-26.1.0.aar differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YMPBridge.m b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YMPBridge.m index 538732f..1efec31 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YMPBridge.m +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YMPBridge.m @@ -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 #import @@ -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 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 diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPUserNotificationCenterDelegate.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPUserNotificationCenterDelegate.h new file mode 100644 index 0000000..d38d936 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPUserNotificationCenterDelegate.h @@ -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 + +/** 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 + +@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 nextDelegate; + +@end + +#endif diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPVersion.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPVersion.h index c16106c..5f47197 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPVersion.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPVersion.h @@ -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/ @@ -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__ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPush.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPush.h index cb721c8..b55459c 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPush.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPush.h @@ -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/ @@ -11,17 +11,48 @@ #import +#if __has_include("YMPYandexMetricaPushEnvironment.h") + #import "YMPYandexMetricaPushEnvironment.h" + #import "YMPUserNotificationCenterDelegate.h" +#else + #import + #import +#endif + NS_ASSUME_NONNULL_BEGIN @interface YMPYandexMetricaPush : NSObject -/** Setting push notification device token. +#ifdef YMP_USER_NOTIFICATIONS_CENTER_AVAILABLE + +/** Returning YMPUserNotificationCenterDelegate that handles foreground push notifications on iOS 10+. + YMPUserNotificationCenterDelegate protocol is derived from UNUserNotificationCenterDelegate. + To handle foreground push notifications execute this line before application finished launching: + + [UNUserNotificationCenter currentNotificationCenter].delegate = [YMPYandexMetricaPush userNotificationCenterDelegate]; + + @return Delegate that implements UNUserNotificationCenterDelegate protocol. + */ ++ (id)userNotificationCenterDelegate; + +#endif + +/** Setting push notification device token with production environment. + If value is nil, previously set device token is revoked. + Should be called after AppMetrica initialization. + + @param data Device token data. + */ ++ (void)setDeviceTokenFromData:(nullable NSData *)data; + +/** Setting push notification device token with specific environment. If value is nil, previously set device token is revoked. Should be called after AppMetrica initialization. @param data Device token data. + @param pushEnvironment Application APNs environment. */ -+ (void)setDeviceTokenFromData:(NSData *)data; ++ (void)setDeviceTokenFromData:(nullable NSData *)data pushEnvironment:(YMPYandexMetricaPushEnvironment)pushEnvironment; /** Handling push notification from application launch options. Should be called after AppMetrica initialization. @@ -51,6 +82,16 @@ NS_ASSUME_NONNULL_BEGIN */ + (nullable NSString *)userDataForNotification:(NSDictionary *)userInfo; +/** Returning YES if push notification is related to AppMetrica. + + @param userInfo A dictionary that contains information related to the remote notification, + potentially including a badge number for the app icon, an alert sound, + an alert message to display to the user, a notification identifier + and custom data. + @return YES for SDK related notifications. + */ ++ (BOOL)isNotificationRelatedToSDK:(NSDictionary *)userInfo; + @end NS_ASSUME_NONNULL_END diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPushEnvironment.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPushEnvironment.h new file mode 100644 index 0000000..0429fe2 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YMPYandexMetricaPushEnvironment.h @@ -0,0 +1,23 @@ +/* + * YMPYandexMetricaPushEnvironment.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/ + */ + +#ifndef YMPYandexMetricaPushEnvironment_h +#define YMPYandexMetricaPushEnvironment_h + +typedef NS_ENUM(NSUInteger, YMPYandexMetricaPushEnvironment) { + // Environment for production certificates. + YMPYandexMetricaPushEnvironmentProduction, + + // Environment for production and development(sandbox) certificates. + YMPYandexMetricaPushEnvironmentDevelopment, +}; + +#endif /* YMPYandexMetricaPushEnvironment_h */ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YandexMobileMetricaPush.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YandexMobileMetricaPush.h index bdc56d5..f576153 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YandexMobileMetricaPush.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Headers/YandexMobileMetricaPush.h @@ -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/ @@ -11,9 +11,13 @@ #if __has_include("YMPYandexMetricaPush.h") #import "YMPYandexMetricaPush.h" + #import "YMPYandexMetricaPushEnvironment.h" + #import "YMPUserNotificationCenterDelegate.h" #import "YMPVersion.h" #else #import + #import + #import #import #endif diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPUserNotificationCenterDelegate.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPUserNotificationCenterDelegate.h new file mode 100644 index 0000000..d38d936 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPUserNotificationCenterDelegate.h @@ -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 + +/** 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 + +@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 nextDelegate; + +@end + +#endif diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPVersion.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPVersion.h index c16106c..5f47197 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPVersion.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPVersion.h @@ -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/ @@ -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__ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPush.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPush.h index cb721c8..b55459c 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPush.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPush.h @@ -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/ @@ -11,17 +11,48 @@ #import +#if __has_include("YMPYandexMetricaPushEnvironment.h") + #import "YMPYandexMetricaPushEnvironment.h" + #import "YMPUserNotificationCenterDelegate.h" +#else + #import + #import +#endif + NS_ASSUME_NONNULL_BEGIN @interface YMPYandexMetricaPush : NSObject -/** Setting push notification device token. +#ifdef YMP_USER_NOTIFICATIONS_CENTER_AVAILABLE + +/** Returning YMPUserNotificationCenterDelegate that handles foreground push notifications on iOS 10+. + YMPUserNotificationCenterDelegate protocol is derived from UNUserNotificationCenterDelegate. + To handle foreground push notifications execute this line before application finished launching: + + [UNUserNotificationCenter currentNotificationCenter].delegate = [YMPYandexMetricaPush userNotificationCenterDelegate]; + + @return Delegate that implements UNUserNotificationCenterDelegate protocol. + */ ++ (id)userNotificationCenterDelegate; + +#endif + +/** Setting push notification device token with production environment. + If value is nil, previously set device token is revoked. + Should be called after AppMetrica initialization. + + @param data Device token data. + */ ++ (void)setDeviceTokenFromData:(nullable NSData *)data; + +/** Setting push notification device token with specific environment. If value is nil, previously set device token is revoked. Should be called after AppMetrica initialization. @param data Device token data. + @param pushEnvironment Application APNs environment. */ -+ (void)setDeviceTokenFromData:(NSData *)data; ++ (void)setDeviceTokenFromData:(nullable NSData *)data pushEnvironment:(YMPYandexMetricaPushEnvironment)pushEnvironment; /** Handling push notification from application launch options. Should be called after AppMetrica initialization. @@ -51,6 +82,16 @@ NS_ASSUME_NONNULL_BEGIN */ + (nullable NSString *)userDataForNotification:(NSDictionary *)userInfo; +/** Returning YES if push notification is related to AppMetrica. + + @param userInfo A dictionary that contains information related to the remote notification, + potentially including a badge number for the app icon, an alert sound, + an alert message to display to the user, a notification identifier + and custom data. + @return YES for SDK related notifications. + */ ++ (BOOL)isNotificationRelatedToSDK:(NSDictionary *)userInfo; + @end NS_ASSUME_NONNULL_END diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPushEnvironment.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPushEnvironment.h new file mode 100644 index 0000000..0429fe2 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YMPYandexMetricaPushEnvironment.h @@ -0,0 +1,23 @@ +/* + * YMPYandexMetricaPushEnvironment.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/ + */ + +#ifndef YMPYandexMetricaPushEnvironment_h +#define YMPYandexMetricaPushEnvironment_h + +typedef NS_ENUM(NSUInteger, YMPYandexMetricaPushEnvironment) { + // Environment for production certificates. + YMPYandexMetricaPushEnvironmentProduction, + + // Environment for production and development(sandbox) certificates. + YMPYandexMetricaPushEnvironmentDevelopment, +}; + +#endif /* YMPYandexMetricaPushEnvironment_h */ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YandexMobileMetricaPush.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YandexMobileMetricaPush.h index bdc56d5..f576153 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YandexMobileMetricaPush.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/Headers/YandexMobileMetricaPush.h @@ -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/ @@ -11,9 +11,13 @@ #if __has_include("YMPYandexMetricaPush.h") #import "YMPYandexMetricaPush.h" + #import "YMPYandexMetricaPushEnvironment.h" + #import "YMPUserNotificationCenterDelegate.h" #import "YMPVersion.h" #else #import + #import + #import #import #endif diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/YandexMobileMetricaPush b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/YandexMobileMetricaPush index fcb6463..8284e79 100644 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/YandexMobileMetricaPush and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/A/YandexMobileMetricaPush differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPUserNotificationCenterDelegate.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPUserNotificationCenterDelegate.h new file mode 100644 index 0000000..d38d936 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPUserNotificationCenterDelegate.h @@ -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 + +/** 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 + +@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 nextDelegate; + +@end + +#endif diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPVersion.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPVersion.h index c16106c..5f47197 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPVersion.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPVersion.h @@ -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/ @@ -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__ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPush.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPush.h index cb721c8..b55459c 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPush.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPush.h @@ -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/ @@ -11,17 +11,48 @@ #import +#if __has_include("YMPYandexMetricaPushEnvironment.h") + #import "YMPYandexMetricaPushEnvironment.h" + #import "YMPUserNotificationCenterDelegate.h" +#else + #import + #import +#endif + NS_ASSUME_NONNULL_BEGIN @interface YMPYandexMetricaPush : NSObject -/** Setting push notification device token. +#ifdef YMP_USER_NOTIFICATIONS_CENTER_AVAILABLE + +/** Returning YMPUserNotificationCenterDelegate that handles foreground push notifications on iOS 10+. + YMPUserNotificationCenterDelegate protocol is derived from UNUserNotificationCenterDelegate. + To handle foreground push notifications execute this line before application finished launching: + + [UNUserNotificationCenter currentNotificationCenter].delegate = [YMPYandexMetricaPush userNotificationCenterDelegate]; + + @return Delegate that implements UNUserNotificationCenterDelegate protocol. + */ ++ (id)userNotificationCenterDelegate; + +#endif + +/** Setting push notification device token with production environment. + If value is nil, previously set device token is revoked. + Should be called after AppMetrica initialization. + + @param data Device token data. + */ ++ (void)setDeviceTokenFromData:(nullable NSData *)data; + +/** Setting push notification device token with specific environment. If value is nil, previously set device token is revoked. Should be called after AppMetrica initialization. @param data Device token data. + @param pushEnvironment Application APNs environment. */ -+ (void)setDeviceTokenFromData:(NSData *)data; ++ (void)setDeviceTokenFromData:(nullable NSData *)data pushEnvironment:(YMPYandexMetricaPushEnvironment)pushEnvironment; /** Handling push notification from application launch options. Should be called after AppMetrica initialization. @@ -51,6 +82,16 @@ NS_ASSUME_NONNULL_BEGIN */ + (nullable NSString *)userDataForNotification:(NSDictionary *)userInfo; +/** Returning YES if push notification is related to AppMetrica. + + @param userInfo A dictionary that contains information related to the remote notification, + potentially including a badge number for the app icon, an alert sound, + an alert message to display to the user, a notification identifier + and custom data. + @return YES for SDK related notifications. + */ ++ (BOOL)isNotificationRelatedToSDK:(NSDictionary *)userInfo; + @end NS_ASSUME_NONNULL_END diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPushEnvironment.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPushEnvironment.h new file mode 100644 index 0000000..0429fe2 --- /dev/null +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YMPYandexMetricaPushEnvironment.h @@ -0,0 +1,23 @@ +/* + * YMPYandexMetricaPushEnvironment.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/ + */ + +#ifndef YMPYandexMetricaPushEnvironment_h +#define YMPYandexMetricaPushEnvironment_h + +typedef NS_ENUM(NSUInteger, YMPYandexMetricaPushEnvironment) { + // Environment for production certificates. + YMPYandexMetricaPushEnvironmentProduction, + + // Environment for production and development(sandbox) certificates. + YMPYandexMetricaPushEnvironmentDevelopment, +}; + +#endif /* YMPYandexMetricaPushEnvironment_h */ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YandexMobileMetricaPush.h b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YandexMobileMetricaPush.h index bdc56d5..f576153 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YandexMobileMetricaPush.h +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/Headers/YandexMobileMetricaPush.h @@ -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/ @@ -11,9 +11,13 @@ #if __has_include("YMPYandexMetricaPush.h") #import "YMPYandexMetricaPush.h" + #import "YMPYandexMetricaPushEnvironment.h" + #import "YMPUserNotificationCenterDelegate.h" #import "YMPVersion.h" #else #import + #import + #import #import #endif diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/YandexMobileMetricaPush b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/YandexMobileMetricaPush index fcb6463..8284e79 100644 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/YandexMobileMetricaPush and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/Versions/Current/YandexMobileMetricaPush differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/YandexMobileMetricaPush b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/YandexMobileMetricaPush index fcb6463..8284e79 100644 Binary files a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/YandexMobileMetricaPush and b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/Plugins/iOS/YandexMobileMetricaPush.framework/YandexMobileMetricaPush differ diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushAndroid.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushAndroid.cs index efd66fc..bbe9203 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushAndroid.cs +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushAndroid.cs @@ -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; #if UNITY_ANDROID diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushDummy.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushDummy.cs index 5b27565..01527f3 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushDummy.cs +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushDummy.cs @@ -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; diff --git a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushIOS.cs b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushIOS.cs index 204c6ff..ec89cc5 100644 --- a/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushIOS.cs +++ b/YandexMetricaPushPluginSample/Assets/AppMetricaPush/YandexAppMetricaPushIOS.cs @@ -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; using System.Runtime.InteropServices; using System.Text; diff --git a/YandexMetricaPushPluginSample/Assets/Plugins/Android/AndroidManifest.xml b/YandexMetricaPushPluginSample/Assets/Plugins/Android/AndroidManifest.xml index d3aa3c4..f713ddd 100644 --- a/YandexMetricaPushPluginSample/Assets/Plugins/Android/AndroidManifest.xml +++ b/YandexMetricaPushPluginSample/Assets/Plugins/Android/AndroidManifest.xml @@ -1,22 +1,13 @@ - + - - - - - - - - - @@ -35,36 +26,22 @@ - + - - - - - - - - + - - - + - - + + + - + - - - - - - - +