Skip to content

Commit

Permalink
2.3.2 Release commit
Browse files Browse the repository at this point in the history
* Fixed Unity Editor run time errors.
* Updated to Android SDK 3.5.8.
* Updated to Unity Jar resolver 1.2.29.0
  • Loading branch information
jkasten2 committed Jun 17, 2017
1 parent 7d6884f commit a9d7c78
Show file tree
Hide file tree
Showing 25 changed files with 55 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Unity4.7OneSignalExample/Assets/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1
2.3.2
27 changes: 13 additions & 14 deletions Unity4.7OneSignalExample/Assets/OneSignal/src/OneSignal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
* THE SOFTWARE.
*/

// TODO: Remove after testing
#define ONESIGNAL_PLATFORM


#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP_8_1)
#define ONESIGNAL_PLATFORM
#endif
Expand Down Expand Up @@ -266,19 +262,18 @@ public void EndInit() {
}
internal static UnityBuilder builder = null;

private static OneSignalPlatform oneSignalPlatform = null;
private const string gameObjectName = "OneSignalRuntimeObject_KEEP";

#if ONESIGNAL_PLATFORM
#if SUPPORTS_LOGGING
private static LOG_LEVEL logLevel = LOG_LEVEL.INFO, visualLogLevel = LOG_LEVEL.NONE;
#endif

private static OneSignalPlatform oneSignalPlatform = null;

internal static OnPostNotificationSuccess postNotificationSuccessDelegate = null;
internal static OnPostNotificationFailure postNotificationFailureDelegate = null;

// Name of the GameObject that gets automaticly created in your game scene.
private const string gameObjectName = "OneSignalRuntimeObject_KEEP";
#endif

// Init - Only required method you call to setup OneSignal to recieve push notifications.
Expand Down Expand Up @@ -307,7 +302,7 @@ private static void Init() {
private static void initOneSignalPlatform() {
if (oneSignalPlatform != null || builder == null)
return;
#if ONESIGNAL_PLATFORM
#if UNITY_ANDROID
initAndroid();
#elif UNITY_IPHONE
Expand All @@ -320,13 +315,14 @@ private static void initOneSignalPlatform() {
GameObject go = new GameObject(gameObjectName);
go.AddComponent<OneSignal>();
DontDestroyOnLoad(go);
#endif
#endif

addPermissionObserver();
addSubscriptionObserver();
}

#if UNITY_ANDROID
#if ONESIGNAL_PLATFORM && UNITY_ANDROID
private static void initAndroid() {
oneSignalPlatform = new OneSignalAndroid(gameObjectName, builder.googleProjectNumber, builder.appID, inFocusDisplayType, logLevel, visualLogLevel);
}
Expand Down Expand Up @@ -495,11 +491,14 @@ public static void PromptLocation() {
}

public static OSPermissionSubscriptionState GetPermissionSubscriptionState() {
#if ONESIGNAL_PLATFORM
return oneSignalPlatform.getPermissionSubscriptionState();
#else
return new OSPermissionSubscriptionState();
#endif
#if ONESIGNAL_PLATFORM
return oneSignalPlatform.getPermissionSubscriptionState();
#else
var state = new OSPermissionSubscriptionState();
state.permissionStatus = new OSPermissionState();
state.subscriptionStatus = new OSSubscriptionState();
return state;
#endif
}

/*** protected and private methods ****/
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Unity4.7OneSignalSDK.unitypackage
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Unity5OneSignalExample/Assets/OneSignal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1
2.3.2
27 changes: 13 additions & 14 deletions Unity5OneSignalExample/Assets/OneSignal/src/OneSignal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
* THE SOFTWARE.
*/

// TODO: Remove after testing
#define ONESIGNAL_PLATFORM


#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP_8_1)
#define ONESIGNAL_PLATFORM
#endif
Expand Down Expand Up @@ -266,19 +262,18 @@ public void EndInit() {
}
internal static UnityBuilder builder = null;

private static OneSignalPlatform oneSignalPlatform = null;
private const string gameObjectName = "OneSignalRuntimeObject_KEEP";

#if ONESIGNAL_PLATFORM
#if SUPPORTS_LOGGING
private static LOG_LEVEL logLevel = LOG_LEVEL.INFO, visualLogLevel = LOG_LEVEL.NONE;
#endif

private static OneSignalPlatform oneSignalPlatform = null;

internal static OnPostNotificationSuccess postNotificationSuccessDelegate = null;
internal static OnPostNotificationFailure postNotificationFailureDelegate = null;

// Name of the GameObject that gets automaticly created in your game scene.
private const string gameObjectName = "OneSignalRuntimeObject_KEEP";
#endif

// Init - Only required method you call to setup OneSignal to recieve push notifications.
Expand Down Expand Up @@ -307,7 +302,7 @@ private static void Init() {
private static void initOneSignalPlatform() {
if (oneSignalPlatform != null || builder == null)
return;
#if ONESIGNAL_PLATFORM
#if UNITY_ANDROID
initAndroid();
#elif UNITY_IPHONE
Expand All @@ -320,13 +315,14 @@ private static void initOneSignalPlatform() {
GameObject go = new GameObject(gameObjectName);
go.AddComponent<OneSignal>();
DontDestroyOnLoad(go);
#endif
#endif

addPermissionObserver();
addSubscriptionObserver();
}

#if UNITY_ANDROID
#if ONESIGNAL_PLATFORM && UNITY_ANDROID
private static void initAndroid() {
oneSignalPlatform = new OneSignalAndroid(gameObjectName, builder.googleProjectNumber, builder.appID, inFocusDisplayType, logLevel, visualLogLevel);
}
Expand Down Expand Up @@ -495,11 +491,14 @@ public static void PromptLocation() {
}

public static OSPermissionSubscriptionState GetPermissionSubscriptionState() {
#if ONESIGNAL_PLATFORM
return oneSignalPlatform.getPermissionSubscriptionState();
#else
return new OSPermissionSubscriptionState();
#endif
#if ONESIGNAL_PLATFORM
return oneSignalPlatform.getPermissionSubscriptionState();
#else
var state = new OSPermissionSubscriptionState();
state.permissionStatus = new OSPermissionState();
state.subscriptionStatus = new OSSubscriptionState();
return state;
#endif
}

/*** protected and private methods ****/
Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Unity5OneSignalExample/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
m_EditorVersion: 5.6.0f3
m_EditorVersion: 5.6.1f1
Binary file modified Unity5OneSignalSDK.unitypackage
Binary file not shown.

0 comments on commit a9d7c78

Please sign in to comment.