Skip to content

Commit a9d7c78

Browse files
committed
2.3.2 Release commit
* Fixed Unity Editor run time errors. * Updated to Android SDK 3.5.8. * Updated to Unity Jar resolver 1.2.29.0
1 parent 7d6884f commit a9d7c78

25 files changed

+55
-57
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1
1+
2.3.2

Unity4.7OneSignalExample/Assets/OneSignal/src/OneSignal.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
* THE SOFTWARE.
2626
*/
2727

28-
// TODO: Remove after testing
29-
#define ONESIGNAL_PLATFORM
30-
31-
3228
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP_8_1)
3329
#define ONESIGNAL_PLATFORM
3430
#endif
@@ -266,19 +262,18 @@ public void EndInit() {
266262
}
267263
internal static UnityBuilder builder = null;
268264

265+
private static OneSignalPlatform oneSignalPlatform = null;
266+
private const string gameObjectName = "OneSignalRuntimeObject_KEEP";
269267

270268
#if ONESIGNAL_PLATFORM
271269
#if SUPPORTS_LOGGING
272270
private static LOG_LEVEL logLevel = LOG_LEVEL.INFO, visualLogLevel = LOG_LEVEL.NONE;
273271
#endif
274272

275-
private static OneSignalPlatform oneSignalPlatform = null;
276-
277273
internal static OnPostNotificationSuccess postNotificationSuccessDelegate = null;
278274
internal static OnPostNotificationFailure postNotificationFailureDelegate = null;
279275

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

284279
// Init - Only required method you call to setup OneSignal to recieve push notifications.
@@ -307,7 +302,7 @@ private static void Init() {
307302
private static void initOneSignalPlatform() {
308303
if (oneSignalPlatform != null || builder == null)
309304
return;
310-
305+
#if ONESIGNAL_PLATFORM
311306
#if UNITY_ANDROID
312307
initAndroid();
313308
#elif UNITY_IPHONE
@@ -320,13 +315,14 @@ private static void initOneSignalPlatform() {
320315
GameObject go = new GameObject(gameObjectName);
321316
go.AddComponent<OneSignal>();
322317
DontDestroyOnLoad(go);
318+
#endif
323319
#endif
324320

325321
addPermissionObserver();
326322
addSubscriptionObserver();
327323
}
328324

329-
#if UNITY_ANDROID
325+
#if ONESIGNAL_PLATFORM && UNITY_ANDROID
330326
private static void initAndroid() {
331327
oneSignalPlatform = new OneSignalAndroid(gameObjectName, builder.googleProjectNumber, builder.appID, inFocusDisplayType, logLevel, visualLogLevel);
332328
}
@@ -495,11 +491,14 @@ public static void PromptLocation() {
495491
}
496492

497493
public static OSPermissionSubscriptionState GetPermissionSubscriptionState() {
498-
#if ONESIGNAL_PLATFORM
499-
return oneSignalPlatform.getPermissionSubscriptionState();
500-
#else
501-
return new OSPermissionSubscriptionState();
502-
#endif
494+
#if ONESIGNAL_PLATFORM
495+
return oneSignalPlatform.getPermissionSubscriptionState();
496+
#else
497+
var state = new OSPermissionSubscriptionState();
498+
state.permissionStatus = new OSPermissionState();
499+
state.subscriptionStatus = new OSSubscriptionState();
500+
return state;
501+
#endif
503502
}
504503

505504
/*** protected and private methods ****/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Unity4.7OneSignalSDK.unitypackage

8.3 KB
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1
1+
2.3.2

Unity5OneSignalExample/Assets/OneSignal/src/OneSignal.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
* THE SOFTWARE.
2626
*/
2727

28-
// TODO: Remove after testing
29-
#define ONESIGNAL_PLATFORM
30-
31-
3228
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP_8_1)
3329
#define ONESIGNAL_PLATFORM
3430
#endif
@@ -266,19 +262,18 @@ public void EndInit() {
266262
}
267263
internal static UnityBuilder builder = null;
268264

265+
private static OneSignalPlatform oneSignalPlatform = null;
266+
private const string gameObjectName = "OneSignalRuntimeObject_KEEP";
269267

270268
#if ONESIGNAL_PLATFORM
271269
#if SUPPORTS_LOGGING
272270
private static LOG_LEVEL logLevel = LOG_LEVEL.INFO, visualLogLevel = LOG_LEVEL.NONE;
273271
#endif
274272

275-
private static OneSignalPlatform oneSignalPlatform = null;
276-
277273
internal static OnPostNotificationSuccess postNotificationSuccessDelegate = null;
278274
internal static OnPostNotificationFailure postNotificationFailureDelegate = null;
279275

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

284279
// Init - Only required method you call to setup OneSignal to recieve push notifications.
@@ -307,7 +302,7 @@ private static void Init() {
307302
private static void initOneSignalPlatform() {
308303
if (oneSignalPlatform != null || builder == null)
309304
return;
310-
305+
#if ONESIGNAL_PLATFORM
311306
#if UNITY_ANDROID
312307
initAndroid();
313308
#elif UNITY_IPHONE
@@ -320,13 +315,14 @@ private static void initOneSignalPlatform() {
320315
GameObject go = new GameObject(gameObjectName);
321316
go.AddComponent<OneSignal>();
322317
DontDestroyOnLoad(go);
318+
#endif
323319
#endif
324320

325321
addPermissionObserver();
326322
addSubscriptionObserver();
327323
}
328324

329-
#if UNITY_ANDROID
325+
#if ONESIGNAL_PLATFORM && UNITY_ANDROID
330326
private static void initAndroid() {
331327
oneSignalPlatform = new OneSignalAndroid(gameObjectName, builder.googleProjectNumber, builder.appID, inFocusDisplayType, logLevel, visualLogLevel);
332328
}
@@ -495,11 +491,14 @@ public static void PromptLocation() {
495491
}
496492

497493
public static OSPermissionSubscriptionState GetPermissionSubscriptionState() {
498-
#if ONESIGNAL_PLATFORM
499-
return oneSignalPlatform.getPermissionSubscriptionState();
500-
#else
501-
return new OSPermissionSubscriptionState();
502-
#endif
494+
#if ONESIGNAL_PLATFORM
495+
return oneSignalPlatform.getPermissionSubscriptionState();
496+
#else
497+
var state = new OSPermissionSubscriptionState();
498+
state.permissionStatus = new OSPermissionState();
499+
state.subscriptionStatus = new OSSubscriptionState();
500+
return state;
501+
#endif
503502
}
504503

505504
/*** protected and private methods ****/

0 commit comments

Comments
 (0)