Skip to content

Commit

Permalink
Merge pull request #409 from OneSignal/release/3.0.0-beta.2
Browse files Browse the repository at this point in the history
Release 3.0.0-beta.2
  • Loading branch information
adamschlesinger authored Nov 24, 2021
2 parents 33f96e3 + 5a9034d commit 3cfc637
Show file tree
Hide file tree
Showing 17 changed files with 637 additions and 610 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"versionDefines": [
{
"name": "com.onesignal.unity.core",
"expression": "3.0.0-beta.1",
"define": "ONE_SIGNAL_INSTALLED"
}
],
"noEngineReferences": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ public static AnalyticsResult SendAttributionEvent(string actionName, string par
return AnalyticsResult.AnalyticsDisabled;
}
}

#if ONE_SIGNAL_INSTALLED
[RuntimeInitializeOnLoadMethod]
public static void AttachToInit()
=> OneSignal.OnInitialize += appId => SendAttributionEvent("Login", "OneSignal", appId);
#endif
}
}
21 changes: 19 additions & 2 deletions OneSignalExample/Assets/OneSignal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.0.0-beta.2]
### Fixed
- Correctly namedspaced the common MiniJSON utility to fix [#404](https://github.com/OneSignal/OneSignal-Unity-SDK/issues/404)
- Ensured code distributed with unitypackage would not reference other packages if missing
- Swapped out code that was only available in Unity 2020 for backwards compatible implementations

## [3.0.0-beta.1]
- 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.
- 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.
- 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.

If you run into any problems, please don’t hesitate to [open an issue](https://github.com/OneSignal/OneSignal-Unity-SDK/issues/new)!

## [2.14.5]
### Changed
- Updated included Android SDK to [3.16.2](https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/3.16.2)
- 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)
- 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)

## [2.14.4]
### Fixed
- Removed use of C# 8.0 features to maintain compatibility
Expand All @@ -18,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Avoid continuing with null IAM message Ids [#1386](https://github.com/OneSignal/OneSignal-Android-SDK/pull/1386)
- Updated included iOS SDK to version [2.16.7](https://github.com/OneSignal/OneSignal-iOS-SDK/tree/2.16.7/)
- In App Messaging now respects device orientation locks for Unity Applications [#1000](https://github.com/OneSignal/OneSignal-iOS-SDK/pull/1000)

## [2.14.3]
### Fixed
- Added a delayed call when attempting to reshow the `OneSignalSetupWindow` after importing packages.
Expand All @@ -40,13 +56,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [2.14.0]
### Added
- A new Editor window under **Window > OneSignal** can be found which currently includes additional setup steps for installation.

### Changed
- The OneSignal Unity SDK has now transitioned to [Unity Package Manager](https://docs.unity3d.com/Packages/[email protected]/manual/index.html) support
- If you are updating from a previous version of the OneSignal Unity SDK please follow the Unity Asset Store instructions in
the [README](https://github.com/OneSignal/OneSignal-Unity-SDK/README.md#unity-asset-store) to ensure a smooth transition.

[Unreleased]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.5...HEAD
[Unreleased]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/3.0.0-beta.2...HEAD
[3.0.0-beta.2]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/3.0.0-beta.1...3.0.0-beta.2
[3.0.0-beta.1]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.4...3.0.0-beta.1
[2.14.5]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.4...2.14.5
[2.14.4]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.3...2.14.4
[2.14.3]: https://github.com/OneSignal/OneSignal-Unity-SDK/compare/2.14.2...2.14.3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if ONE_SIGNAL_INSTALLED
using System;
using System.Collections.Generic;
using UnityEngine;
Expand Down Expand Up @@ -438,4 +439,5 @@ private static T _nextEnum<T>(T src) where T : struct {
}
#endregion
}
}
}
#endif
4 changes: 2 additions & 2 deletions OneSignalExample/Assets/OneSignal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

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

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

Expand Down Expand Up @@ -97,7 +97,7 @@ There are two methods of installation available for the OneSignal Unity SDK:
### [Android](https://documentation.onesignal.com/docs/unity-sdk-setup#step-6---android-setup)
## Usage
You can find a complete implementation in our included [example MonoBehaviour](Example/Scripts/OneSignalExampleBehaviour.cs). Additionally we have included a
You can find a complete implementation in our included [example MonoBehaviour](Example/OneSignalExampleBehaviour.cs). Additionally we have included a
[sample scene](Example/Scenes/OneSignalExampleScene.unity) which you can run to test out the SDK.
### Initialization
Expand Down
2 changes: 1 addition & 1 deletion OneSignalExample/Assets/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.5
3.0.0-beta.2
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public static void ResetAllSteps()
manifest.RemoveScopeRegistry("https://registry.npmjs.org");
manifest.ApplyChanges();

#if UNITY_2020_1_OR_NEWER
UnityEditor.PackageManager.Client.Resolve();
#endif
}
}
1 change: 0 additions & 1 deletion OneSignalExample/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"com.onesignal.unity.android": "file:../../com.onesignal.unity.android",
"com.onesignal.unity.core": "file:../../com.onesignal.unity.core",
"com.onesignal.unity.ios": "file:../../com.onesignal.unity.ios",
"com.unity.collab-proxy": "1.13.5",
"com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.11",
"com.unity.ide.vscode": "1.2.4",
Expand Down
30 changes: 2 additions & 28 deletions OneSignalExample/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.onesignal.unity.core": "2.14.5"
"com.onesignal.unity.core": "3.0.0-beta.2"
}
},
"com.onesignal.unity.core": {
Expand All @@ -19,19 +19,9 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.onesignal.unity.core": "2.14.5"
"com.onesignal.unity.core": "3.0.0-beta.2"
}
},
"com.unity.collab-proxy": {
"version": "1.13.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
Expand Down Expand Up @@ -64,22 +54,6 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "0.1.19-preview",
"depth": 1,
Expand Down
2 changes: 1 addition & 1 deletion OneSignalExample/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 2.14.5
bundleVersion: 3.0.0-beta.2
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ There are two methods of installation available for the OneSignal Unity SDK:
and click **Save**.
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
on which you can then click **Install** for the platforms you would like to include. Dependencies will be added automatically.
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
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
in order to finalize the installation.
> *Depending on your project configuration and if you are upgrading from a previous version, some of these steps may already be marked as "completed"*
Expand All @@ -97,16 +97,24 @@ There are two methods of installation available for the OneSignal Unity SDK:
### [Android](https://documentation.onesignal.com/docs/unity-sdk-setup#step-6---android-setup)
## Usage
You can find a complete implementation in our included [example MonoBehaviour](OneSignalExample/Assets/OneSignal/Example/Scripts/OneSignalExampleBehaviour.cs). Additionally we have included a
[sample scene](OneSignalExample/Assets/OneSignal/Example/Scenes/OneSignalExampleScene.unity) which you can run to test out the SDK.
You can find a complete implementation in our included [example MonoBehaviour](Example/OneSignalExampleBehaviour.cs). Additionally we have included a
[sample scene](Example/Scenes/OneSignalExampleScene.unity) which you can run to test out the SDK.
### Initialization
#### Prefab
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
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
in the **App Id**, and you are immediately ready to go!
#### Code
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.
```C#
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID from app.onesignal.com
OneSignal.StartInit("YOUR_ONESIGNAL_APP_ID").EndInit();
OneSignal.Default.Initialize("YOUR_ONESIGNAL_APP_ID");
```
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).

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).

## API
See OneSignal's [OneSignal Unity SDK API](https://documentation.onesignal.com/docs/unity-sdk) page for a list of all available methods.
Expand Down
4 changes: 2 additions & 2 deletions com.onesignal.unity.android/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.onesignal.unity.android",
"displayName": "OneSignal Unity SDK - Android",
"version": "2.14.5",
"version": "3.0.0-beta.2",
"unity": "2018.4",
"description": "OneSignal is the market leader in customer engagement, powering mobile push, web push, email, and in-app messages.",
"dependencies": {
"com.onesignal.unity.core": "2.14.5"
"com.onesignal.unity.core": "3.0.0-beta.2"
},
"keywords": [
"push-notifications",
Expand Down
Loading

0 comments on commit 3cfc637

Please sign in to comment.