Skip to content

Commit 3cfc637

Browse files
Merge pull request #409 from OneSignal/release/3.0.0-beta.2
Release 3.0.0-beta.2
2 parents 33f96e3 + 5a9034d commit 3cfc637

File tree

17 files changed

+637
-610
lines changed

17 files changed

+637
-610
lines changed

OneSignalExample/Assets/OneSignal/Attribution/OneSignal.UnityPackage.Attribution.asmdef

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
"precompiledReferences": [],
1616
"autoReferenced": true,
1717
"defineConstraints": [],
18-
"versionDefines": [],
18+
"versionDefines": [
19+
{
20+
"name": "com.onesignal.unity.core",
21+
"expression": "3.0.0-beta.1",
22+
"define": "ONE_SIGNAL_INSTALLED"
23+
}
24+
],
1925
"noEngineReferences": false
2026
}

OneSignalExample/Assets/OneSignal/Attribution/VspAttribution.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ public static AnalyticsResult SendAttributionEvent(string actionName, string par
9393
return AnalyticsResult.AnalyticsDisabled;
9494
}
9595
}
96-
96+
#if ONE_SIGNAL_INSTALLED
9797
[RuntimeInitializeOnLoadMethod]
9898
public static void AttachToInit()
9999
=> OneSignal.OnInitialize += appId => SendAttributionEvent("Login", "OneSignal", appId);
100+
#endif
100101
}
101102
}

OneSignalExample/Assets/OneSignal/CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [3.0.0-beta.2]
10+
### Fixed
11+
- Correctly namedspaced the common MiniJSON utility to fix [#404](https://github.com/OneSignal/OneSignal-Unity-SDK/issues/404)
12+
- Ensured code distributed with unitypackage would not reference other packages if missing
13+
- Swapped out code that was only available in Unity 2020 for backwards compatible implementations
14+
15+
## [3.0.0-beta.1]
16+
- Complete overhaul to the public API of the SDK. While this release is in beta please see our included [example MonoBehaviour](Example/OneSignalExampleBehaviour.cs) for usage.
17+
- The included OneSignal Android SDK is now fully imported via EDM4U/gradle and will pull the latest version. Please see [OneSignal-Android-SDK Releases](https://github.com/OneSignal/OneSignal-Android-SDK/releases) for latest changes.
18+
- The included OneSignal iOS SDK is now fully imported via EDM4U/Cocoapods and will pull the latest version. Please see [OneSignal-iOS-SDK Releases](https://github.com/OneSignal/OneSignal-iOS-SDK/releases) for latest changes.
19+
20+
If you run into any problems, please don’t hesitate to [open an issue](https://github.com/OneSignal/OneSignal-Unity-SDK/issues/new)!
21+
822
## [2.14.5]
923
### Changed
1024
- Updated included Android SDK to [3.16.2](https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/3.16.2)
1125
- Fixes for background image not showing and text not rendering in the RTL direction when a RTL system language is set. [#1475](https://github.com/OneSignal/OneSignal-Android-SDK/pull/1475)
1226
- Fix IAM preview message returning NPE in a preview case, due to message id being null. [#1463](https://github.com/OneSignal/OneSignal-Android-SDK/pull/1463)
27+
1328
## [2.14.4]
1429
### Fixed
1530
- Removed use of C# 8.0 features to maintain compatibility
@@ -18,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1833
- Avoid continuing with null IAM message Ids [#1386](https://github.com/OneSignal/OneSignal-Android-SDK/pull/1386)
1934
- Updated included iOS SDK to version [2.16.7](https://github.com/OneSignal/OneSignal-iOS-SDK/tree/2.16.7/)
2035
- In App Messaging now respects device orientation locks for Unity Applications [#1000](https://github.com/OneSignal/OneSignal-iOS-SDK/pull/1000)
36+
2137
## [2.14.3]
2238
### Fixed
2339
- Added a delayed call when attempting to reshow the `OneSignalSetupWindow` after importing packages.
@@ -40,13 +56,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4056
## [2.14.0]
4157
### Added
4258
- A new Editor window under **Window > OneSignal** can be found which currently includes additional setup steps for installation.
43-
4459
### Changed
4560
- The OneSignal Unity SDK has now transitioned to [Unity Package Manager](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) support
4661
- If you are updating from a previous version of the OneSignal Unity SDK please follow the Unity Asset Store instructions in
4762
the [README](https://github.com/OneSignal/OneSignal-Unity-SDK/README.md#unity-asset-store) to ensure a smooth transition.
4863

49-
[Unreleased]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.5...HEAD
64+
[Unreleased]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/3.0.0-beta.2...HEAD
65+
[3.0.0-beta.2]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/3.0.0-beta.1...3.0.0-beta.2
66+
[3.0.0-beta.1]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.4...3.0.0-beta.1
5067
[2.14.5]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.4...2.14.5
5168
[2.14.4]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.3...2.14.4
5269
[2.14.3]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.2...2.14.3

OneSignalExample/Assets/OneSignal/Example/OneSignalExampleBehaviour.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if ONE_SIGNAL_INSTALLED
12
using System;
23
using System.Collections.Generic;
34
using UnityEngine;
@@ -438,4 +439,5 @@ private static T _nextEnum<T>(T src) where T : struct {
438439
}
439440
#endregion
440441
}
441-
}
442+
}
443+
#endif

OneSignalExample/Assets/OneSignal/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
# OneSignal Unity SDK
6-
A free push notification and in app messaging solution for mobile applications built through Unity.
6+
A free email, sms, push notification and in app messaging solution for mobile applications built through Unity.
77

88
[OneSignal](https://onesignal.com) provides a fully array of omni-channel messaging solutions across:
99

@@ -97,7 +97,7 @@ There are two methods of installation available for the OneSignal Unity SDK:
9797
### [Android](https://documentation.onesignal.com/docs/unity-sdk-setup#step-6---android-setup)
9898
9999
## Usage
100-
You can find a complete implementation in our included [example MonoBehaviour](Example/Scripts/OneSignalExampleBehaviour.cs). Additionally we have included a
100+
You can find a complete implementation in our included [example MonoBehaviour](Example/OneSignalExampleBehaviour.cs). Additionally we have included a
101101
[sample scene](Example/Scenes/OneSignalExampleScene.unity) which you can run to test out the SDK.
102102
103103
### Initialization
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.14.5
1+
3.0.0-beta.2

OneSignalExample/Assets/OneSignalPackager/Editor/OneSignalSetupReset.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public static void ResetAllSteps()
4848
manifest.RemoveScopeRegistry("https://registry.npmjs.org");
4949
manifest.ApplyChanges();
5050

51+
#if UNITY_2020_1_OR_NEWER
5152
UnityEditor.PackageManager.Client.Resolve();
53+
#endif
5254
}
5355
}

OneSignalExample/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"com.onesignal.unity.android": "file:../../com.onesignal.unity.android",
44
"com.onesignal.unity.core": "file:../../com.onesignal.unity.core",
55
"com.onesignal.unity.ios": "file:../../com.onesignal.unity.ios",
6-
"com.unity.collab-proxy": "1.13.5",
76
"com.unity.ide.rider": "2.0.7",
87
"com.unity.ide.visualstudio": "2.0.11",
98
"com.unity.ide.vscode": "1.2.4",

OneSignalExample/Packages/packages-lock.json

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"depth": 0,
66
"source": "local",
77
"dependencies": {
8-
"com.onesignal.unity.core": "2.14.5"
8+
"com.onesignal.unity.core": "3.0.0-beta.2"
99
}
1010
},
1111
"com.onesignal.unity.core": {
@@ -19,19 +19,9 @@
1919
"depth": 0,
2020
"source": "local",
2121
"dependencies": {
22-
"com.onesignal.unity.core": "2.14.5"
22+
"com.onesignal.unity.core": "3.0.0-beta.2"
2323
}
2424
},
25-
"com.unity.collab-proxy": {
26-
"version": "1.13.5",
27-
"depth": 0,
28-
"source": "registry",
29-
"dependencies": {
30-
"com.unity.nuget.newtonsoft-json": "2.0.0",
31-
"com.unity.services.core": "1.0.1"
32-
},
33-
"url": "https://packages.unity.com"
34-
},
3525
"com.unity.ext.nunit": {
3626
"version": "1.0.6",
3727
"depth": 1,
@@ -64,22 +54,6 @@
6454
"dependencies": {},
6555
"url": "https://packages.unity.com"
6656
},
67-
"com.unity.nuget.newtonsoft-json": {
68-
"version": "2.0.0",
69-
"depth": 1,
70-
"source": "registry",
71-
"dependencies": {},
72-
"url": "https://packages.unity.com"
73-
},
74-
"com.unity.services.core": {
75-
"version": "1.0.1",
76-
"depth": 1,
77-
"source": "registry",
78-
"dependencies": {
79-
"com.unity.modules.unitywebrequest": "1.0.0"
80-
},
81-
"url": "https://packages.unity.com"
82-
},
8357
"com.unity.sysroot": {
8458
"version": "0.1.19-preview",
8559
"depth": 1,

OneSignalExample/ProjectSettings/ProjectSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ PlayerSettings:
134134
16:10: 1
135135
16:9: 1
136136
Others: 1
137-
bundleVersion: 2.14.5
137+
bundleVersion: 3.0.0-beta.2
138138
preloadedAssets: []
139139
metroInputSource: 0
140140
wsaTransparentSwapchain: 0

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ There are two methods of installation available for the OneSignal Unity SDK:
8383
and click **Save**.
8484
3. Open the **Window > Package Manager** and switch to **My Registries** via the **Packages:** dropdown menu. You will see all of the OneSignal Unity SDK packages available
8585
on which you can then click **Install** for the platforms you would like to include. Dependencies will be added automatically.
86-
4. Once the packages have finished importing you will find a new menu under **Window > OneSignal**. Open it and you will find some final steps which need to be completed
86+
4. Once the packages have finished importing you will find a new menu under **Window > OneSignal**. Open it and you will find some final steps which need to be completed
8787
in order to finalize the installation.
8888
8989
> *Depending on your project configuration and if you are upgrading from a previous version, some of these steps may already be marked as "completed"*
@@ -97,16 +97,24 @@ There are two methods of installation available for the OneSignal Unity SDK:
9797
### [Android](https://documentation.onesignal.com/docs/unity-sdk-setup#step-6---android-setup)
9898
9999
## Usage
100-
You can find a complete implementation in our included [example MonoBehaviour](OneSignalExample/Assets/OneSignal/Example/Scripts/OneSignalExampleBehaviour.cs). Additionally we have included a
101-
[sample scene](OneSignalExample/Assets/OneSignal/Example/Scenes/OneSignalExampleScene.unity) which you can run to test out the SDK.
100+
You can find a complete implementation in our included [example MonoBehaviour](Example/OneSignalExampleBehaviour.cs). Additionally we have included a
101+
[sample scene](Example/Scenes/OneSignalExampleScene.unity) which you can run to test out the SDK.
102102
103103
### Initialization
104+
105+
#### Prefab
106+
Located in the `com.onesignal.unity.core` package we've include a simple prefab which initializes OneSignal. You can easily find it using the Asset search bar
107+
to find `OneSignalController.prefab` and making sure to select **All** or **In Packages** for your search option. Drag the prefab into your very first scene, fill
108+
in the **App Id**, and you are immediately ready to go!
109+
110+
#### Code
104111
To get started add the following code in an appropriate place such as the `Start` method of a `MonoBehaviour` early in your application's lifecycle.
105112
```C#
106113
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID from app.onesignal.com
107-
OneSignal.StartInit("YOUR_ONESIGNAL_APP_ID").EndInit();
114+
OneSignal.Default.Initialize("YOUR_ONESIGNAL_APP_ID");
108115
```
109-
You are now ready to start sending and receiving messages. For additional information please see [our complete OneSignal Unity SDK docs](https://documentation.onesignal.com/docs/unity-sdk-setup).
116+
117+
You are now ready to start sending and receiving notifications and in-app messages. For additional information please see [our complete OneSignal Unity SDK docs](https://documentation.onesignal.com/docs/unity-sdk-setup).
110118

111119
## API
112120
See OneSignal's [OneSignal Unity SDK API](https://documentation.onesignal.com/docs/unity-sdk) page for a list of all available methods.

com.onesignal.unity.android/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "com.onesignal.unity.android",
33
"displayName": "OneSignal Unity SDK - Android",
4-
"version": "2.14.5",
4+
"version": "3.0.0-beta.2",
55
"unity": "2018.4",
66
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
77
"dependencies": {
8-
"com.onesignal.unity.core": "2.14.5"
8+
"com.onesignal.unity.core": "3.0.0-beta.2"
99
},
1010
"keywords": [
1111
"push-notifications",

0 commit comments

Comments
 (0)