diff --git a/UnityOneSignalExample/Assets/Plugins/Android/OneSignal/libs/OneSignalSDK.jar b/UnityOneSignalExample/Assets/Plugins/Android/OneSignal/libs/OneSignalSDK.jar index e1fe15f9d..1596b0795 100644 Binary files a/UnityOneSignalExample/Assets/Plugins/Android/OneSignal/libs/OneSignalSDK.jar and b/UnityOneSignalExample/Assets/Plugins/Android/OneSignal/libs/OneSignalSDK.jar differ diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignal.cs b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignal.cs index b35db63c6..23dc9842a 100644 --- a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignal.cs +++ b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignal.cs @@ -25,7 +25,7 @@ * THE SOFTWARE. */ -#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP8) +#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP8 || UNITY_WP_8_1) #define ONESIGNAL_PLATFORM #endif @@ -33,7 +33,7 @@ #define ANDROID_ONLY #endif -#if ONESIGNAL_PLATFORM && !UNITY_WP8 +#if ONESIGNAL_PLATFORM && !UNITY_WP8 && !UNITY_WP_8_1 #define SUPPORTS_LOGGING #endif @@ -95,11 +95,13 @@ public static void Init(string appId, string googleProjectNumber, NotificationRe #elif UNITY_IPHONE oneSignalPlatform = new OneSignalIOS(gameObjectName, appId, autoRegister, logLevel, visualLogLevel); #elif UNITY_WP8 - oneSignalPlatform = new OneSignalWP(appId); + oneSignalPlatform = new OneSignalWP80(appId); + #elif UNITY_WP_8_1 + oneSignalPlatform = new OneSignalWPWNS(appId); #endif notificationDelegate = inNotificationDelegate; - #if !UNITY_WP8 + #if !UNITY_WP8 && !UNITY_WP_8_1 GameObject go = new GameObject(gameObjectName); go.AddComponent(); DontDestroyOnLoad(go); diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP.cs b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP80.cs similarity index 85% rename from UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP.cs rename to UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP80.cs index a6054c182..51b331c62 100644 --- a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP.cs +++ b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP80.cs @@ -31,10 +31,10 @@ using System.Collections; using System.Collections.Generic; -class OneSignalWP : OneSignalPlatform { +class OneSignalWP80 : OneSignalPlatform { public OneSignalWP(string appId) { - OneSignalSDK.OneSignal.Init(appId, (message, inAdditionalData, isActive) => { + OneSignalSDK_WP80.OneSignal.Init(appId, (message, inAdditionalData, isActive) => { if (OneSignal.notificationDelegate != null) { Dictionary additionalData = null; if (inAdditionalData != null) @@ -45,33 +45,33 @@ public OneSignalWP(string appId) { } public void SendTag(string tagName, string tagValue) { - OneSignalSDK.OneSignal.SendTag(tagName, tagValue); + OneSignalSDK_WP80.OneSignal.SendTag(tagName, tagValue); } public void SendTags(IDictionary tags) { - OneSignalSDK.OneSignal.SendTags(tags.ToDictionary(pair => pair.Key, pair=>(object)pair.Value)); + OneSignalSDK_WP80.OneSignal.SendTags(tags.ToDictionary(pair => pair.Key, pair=>(object)pair.Value)); } public void SendPurchase(double amount) { - OneSignalSDK.OneSignal.SendPurchase(amount); + OneSignalSDK_WP80.OneSignal.SendPurchase(amount); } public void GetTags() { - OneSignalSDK.OneSignal.GetTags((tags) => { + OneSignalSDK_WP80.OneSignal.GetTags((tags) => { OneSignal.tagsReceivedDelegate(tags.ToDictionary(pair => pair.Key, pair=>(object)pair.Value)); }); } public void DeleteTag(string key) { - OneSignalSDK.OneSignal.DeleteTag(key); + OneSignalSDK_WP80.OneSignal.DeleteTag(key); } public void DeleteTags(IList key) { - OneSignalSDK.OneSignal.DeleteTags(key); + OneSignalSDK_WP80.OneSignal.DeleteTags(key); } public void IdsAvailable() { - OneSignalSDK.OneSignal.GetIdsAvailable((playerId, channelUri) => { + OneSignalSDK_WP80.OneSignal.GetIdsAvailable((playerId, channelUri) => { OneSignal.idsAvailableDelegate(playerId, channelUri); }); } diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP.cs.meta b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP80.cs.meta similarity index 76% rename from UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP.cs.meta rename to UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP80.cs.meta index 6395399ba..e7e86596f 100644 --- a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP.cs.meta +++ b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWP80.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 4b863806140e0d6429afad011926a8b6 -timeCreated: 1428107168 +guid: 29391db09f3de1e47a56f677495e9a28 +timeCreated: 1437624739 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs new file mode 100644 index 000000000..48f18bf22 --- /dev/null +++ b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs @@ -0,0 +1,97 @@ +/** + * Modified MIT License + * + * Copyright 2015 OneSignal + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 1. The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * 2. All copies of substantial portions of the Software may only be used in connection + * with services provided by OneSignal. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +using UnityEngine; +using System.Linq; +using System.Collections; +using System.Collections.Generic; + +#if UNITY_WP_8_1 && !UNITY_EDITOR + +public class OneSignalWPWNS : OneSignalPlatform { + + public OneSignalWPWNS(string appId) { + OneSignalSDK_WP_WNS.ExternalInitUnity.Init(appId, (message, inAdditionalData, isActive) => { + if (OneSignal.notificationDelegate != null) { + Dictionary additionalData = null; + if (inAdditionalData != null) + additionalData = inAdditionalData.ToDictionary(pair => pair.Key, pair=>(object)pair.Value); + OneSignal.notificationDelegate(message, additionalData, isActive); + } + }); + } + + public void SendTag(string tagName, string tagValue) { + OneSignalSDK_WP_WNS.OneSignal.SendTag(tagName, tagValue); + } + + public void SendTags(IDictionary tags) { + OneSignalSDK_WP_WNS.OneSignal.SendTags(tags.ToDictionary(pair => pair.Key, pair=>(object)pair.Value)); + } + + public void SendPurchase(double amount) { + OneSignalSDK_WP_WNS.OneSignal.SendPurchase(amount); + } + + public void GetTags() { + OneSignalSDK_WP_WNS.OneSignal.GetTags((tags) => { + OneSignal.tagsReceivedDelegate(tags.ToDictionary(pair => pair.Key, pair=>(object)pair.Value)); + }); + } + + public void DeleteTag(string key) { + OneSignalSDK_WP_WNS.OneSignal.DeleteTag(key); + } + + public void DeleteTags(IList key) { + OneSignalSDK_WP_WNS.OneSignal.DeleteTags(key); + } + + public void IdsAvailable() { + OneSignalSDK_WP_WNS.OneSignal.GetIdsAvailable((playerId, channelUri) => { + OneSignal.idsAvailableDelegate(playerId, channelUri); + }); + } + + // Not available the WP SDK. + public void EnableInAppAlertNotification(bool enable) { } + + // Not available in WP SDK. + public void SetSubscription(bool enable) {} + + // Not available in WP SDK. + public void PostNotification(Dictionary data) { } + + // Doesn't apply to Windows Phone: The Callback is setup in the constructor so this is never called. + public void FireNotificationReceivedEvent(string jsonString, OneSignal.NotificationReceived notificationReceived) {} + + public void OnApplicationPause(bool paused) { } // Doesn't apply to Windows Phone: The Native SDK auto handles this. + public void RegisterForPushNotifications() { } // Doesn't apply to Windows Phone: The Native SDK always registers. + + public void SetLogLevel(OneSignal.LOG_LEVEL logLevel, OneSignal.LOG_LEVEL visualLevel) {} // The Native SDK does not implement this. +} +#endif \ No newline at end of file diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs.meta b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs.meta new file mode 100644 index 000000000..39e6f79c5 --- /dev/null +++ b/UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dc146c40c7b1dbc4eabd91292285175a +timeCreated: 1437529477 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignal/VERSION b/UnityOneSignalExample/Assets/Plugins/OneSignal/VERSION index 70ad429ec..169f19b49 100644 --- a/UnityOneSignalExample/Assets/Plugins/OneSignal/VERSION +++ b/UnityOneSignalExample/Assets/Plugins/OneSignal/VERSION @@ -1 +1 @@ -1.10.2 \ No newline at end of file +1.11.0 \ No newline at end of file diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll b/UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll new file mode 100644 index 000000000..143aebb43 Binary files /dev/null and b/UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll differ diff --git a/UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll.meta b/UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll.meta new file mode 100644 index 000000000..96f718424 --- /dev/null +++ b/UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: 16b4e40c8a6ddfe459eb7ac6d4c25025 +timeCreated: 1437529136 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityOneSignalExample/Assets/Plugins/WSA.meta b/UnityOneSignalExample/Assets/Plugins/WSA.meta new file mode 100644 index 000000000..d0bad4f1f --- /dev/null +++ b/UnityOneSignalExample/Assets/Plugins/WSA.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b2e4308ad5dfe0a4686362aa15045c3d +folderAsset: yes +timeCreated: 1437524506 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll b/UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll new file mode 100644 index 000000000..382f1cad8 Binary files /dev/null and b/UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll differ diff --git a/UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll.meta b/UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll.meta new file mode 100644 index 000000000..c8414d4fa --- /dev/null +++ b/UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: a6b042ed17416684bb690127c0a13c73 +timeCreated: 1437531763 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: PhoneSDK81 + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityOneSignalExample/Assets/Plugins/WSA/OneSignalSDK_WP_WNS.dll b/UnityOneSignalExample/Assets/Plugins/WSA/OneSignalSDK_WP_WNS.dll new file mode 100644 index 000000000..8a10e0686 Binary files /dev/null and b/UnityOneSignalExample/Assets/Plugins/WSA/OneSignalSDK_WP_WNS.dll differ diff --git a/UnityOneSignalExample/Assets/Plugins/WSA/OneSignalSDK_WP_WNS.dll.meta b/UnityOneSignalExample/Assets/Plugins/WSA/OneSignalSDK_WP_WNS.dll.meta new file mode 100644 index 000000000..74759370d --- /dev/null +++ b/UnityOneSignalExample/Assets/Plugins/WSA/OneSignalSDK_WP_WNS.dll.meta @@ -0,0 +1,72 @@ +fileFormatVersion: 2 +guid: b98ebf660bb49f34db427f5dbb53695e +timeCreated: 1437528951 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: Assets/Plugins/OneSignalSDK_WP_WNS.dll + SDK: PhoneSDK81 + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityOneSignalExample/Assets/Plugins/iOS/libOneSignal.a b/UnityOneSignalExample/Assets/Plugins/iOS/libOneSignal.a index aaaa3e55d..3d5345421 100644 Binary files a/UnityOneSignalExample/Assets/Plugins/iOS/libOneSignal.a and b/UnityOneSignalExample/Assets/Plugins/iOS/libOneSignal.a differ diff --git a/UnityOneSignalExample/Library/ProjectSettings.asset b/UnityOneSignalExample/Library/ProjectSettings.asset index d585f905c..e5d6583e1 100644 --- a/UnityOneSignalExample/Library/ProjectSettings.asset +++ b/UnityOneSignalExample/Library/ProjectSettings.asset @@ -301,11 +301,11 @@ PlayerSettings: metroPackageLogo180: metroPackageLogo240: metroPackageVersion: - metroCertificatePath: + metroCertificatePath: Assets\WSATestCertificate.pfx metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: - metroCertificateNotAfter: 0000000000000000 + metroCertificateSubject: OneSignal + metroCertificateIssuer: OneSignal + metroCertificateNotAfter: 80f6110b15e3d101 metroApplicationDescription: UnityGameThriveExample metroStoreTileLogo80: metroStoreTileLogo: diff --git a/UnityOneSignalExample/ProjectSettings/ProjectSettings.asset b/UnityOneSignalExample/ProjectSettings/ProjectSettings.asset index d585f905c..e5d6583e1 100644 --- a/UnityOneSignalExample/ProjectSettings/ProjectSettings.asset +++ b/UnityOneSignalExample/ProjectSettings/ProjectSettings.asset @@ -301,11 +301,11 @@ PlayerSettings: metroPackageLogo180: metroPackageLogo240: metroPackageVersion: - metroCertificatePath: + metroCertificatePath: Assets\WSATestCertificate.pfx metroCertificatePassword: - metroCertificateSubject: - metroCertificateIssuer: - metroCertificateNotAfter: 0000000000000000 + metroCertificateSubject: OneSignal + metroCertificateIssuer: OneSignal + metroCertificateNotAfter: 80f6110b15e3d101 metroApplicationDescription: UnityGameThriveExample metroStoreTileLogo80: metroStoreTileLogo: diff --git a/UnityOneSignalSDK.unitypackage b/UnityOneSignalSDK.unitypackage index e8c9f938b..a428d00b0 100644 Binary files a/UnityOneSignalSDK.unitypackage and b/UnityOneSignalSDK.unitypackage differ