-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added support for Windows Phone 8.1 projects. * Fixed Android issue where postNotification was not formatting UTF-8 notifications correctly. * Fixed iOS bug where notifications would clear when opening / resuming the app. - Notifications will still be cleared in this way when a badge is set. - This is due to an iOS limitation where clearing the badge count has a side effect of clearing all notifications from the app. - iOS 6 & 7 - When a notification is opened all other notifications from the app will still be cleared. - This logic remains otherwise notifications can be tapped on multiple times. * Fixed bug where if content-available was set the notification would be marked opened when received and again when it was opened.
- Loading branch information
Showing
18 changed files
with
360 additions
and
24 deletions.
There are no files selected for viewing
Binary file modified
BIN
+14 Bytes
(100%)
UnityOneSignalExample/Assets/Plugins/Android/OneSignal/libs/OneSignalSDK.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ets/Plugins/OneSignal/OneSignalWP.cs.meta → ...s/Plugins/OneSignal/OneSignalWP80.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string, object> 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<string, string> 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<string> 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<string, object> 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 |
12 changes: 12 additions & 0 deletions
12
UnityOneSignalExample/Assets/Plugins/OneSignal/OneSignalWPWNS.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.10.2 | ||
1.11.0 |
Binary file not shown.
72 changes: 72 additions & 0 deletions
72
UnityOneSignalExample/Assets/Plugins/OneSignalSDK_WP_WNS.dll.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
72 changes: 72 additions & 0 deletions
72
UnityOneSignalExample/Assets/Plugins/WSA/Newtonsoft.Json.dll.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.