11/**
22 * Modified MIT License
33 *
4- * Copyright 2016 OneSignal
4+ * Copyright 2021 OneSignal
55 *
66 * Permission is hereby granted, free of charge, to any person obtaining a copy
77 * of this software and associated documentation files (the "Software"), to deal
@@ -42,7 +42,7 @@ public class GameControllerExample : MonoBehaviour {
4242 void Start ( ) {
4343 extraMessage = null ;
4444
45- // Enable line below to debug issues with setuping OneSignal. (logLevel, visualLogLevel)
45+ // Enable line below to debug issues with OneSignal. (logLevel, visualLogLevel)
4646 OneSignal . SetLogLevel ( OneSignal . LOG_LEVEL . VERBOSE , OneSignal . LOG_LEVEL . NONE ) ;
4747
4848 // If you set to true, the user will have to provide consent
@@ -53,14 +53,14 @@ void Start() {
5353 // The only required method you need to call to setup OneSignal to receive push notifications.
5454 // Call before using any other methods on OneSignal (except setLogLevel or SetRequiredUserPrivacyConsent)
5555 // Should only be called once when your app is loaded.
56- // OneSignal.Init(OneSignal_AppId);
5756 OneSignal . StartInit ( "99015f5e-87b1-462e-a75b-f99bf7c2822e" )
5857 . HandleNotificationReceived ( HandleNotificationReceived )
5958 . HandleNotificationOpened ( HandleNotificationOpened )
6059 . HandleInAppMessageClicked ( HandlerInAppMessageClicked )
6160 . EndInit ( ) ;
6261
6362 OneSignal . inFocusDisplayType = OneSignal . OSInFocusDisplayOption . Notification ;
63+
6464 OneSignal . permissionObserver += OneSignal_permissionObserver ;
6565 OneSignal . subscriptionObserver += OneSignal_subscriptionObserver ;
6666 OneSignal . emailSubscriptionObserver += OneSignal_emailSubscriptionObserver ;
@@ -126,7 +126,7 @@ private void OneSignalInAppMessageTriggerExamples() {
126126 // Delete a list of triggers
127127 OneSignal . RemoveTriggersForKeys ( new List < string > ( ) { "key1" , "key2" } ) ;
128128
129- // Temporarily puase In-App messages; If true is passed in.
129+ // Temporarily pause In-App messages; If true is passed in.
130130 // Great to ensure you never interrupt your user while they are in the middle of a match in your game.
131131 OneSignal . PauseInAppMessages ( false ) ;
132132 }
@@ -172,7 +172,7 @@ private void OneSignal_emailSubscriptionObserver(OSEmailSubscriptionStateChanges
172172 Debug . Log ( "EMAIL stateChanges.to.status: " + stateChanges . to . emailUserId + ", " + stateChanges . to . emailAddress ) ;
173173 }
174174
175- // Called when your app is in focus and a notificaiton is recieved .
175+ // Called when your app is in focus and a notification is received .
176176 // The name of the method can be anything as long as the signature matches.
177177 // Method must be static or this object should be marked as DontDestroyOnLoad
178178 private static void HandleNotificationReceived ( OSNotification notification ) {
@@ -277,7 +277,7 @@ void OnGUI() {
277277 extraMessage = "Waiting to get a OneSignal userId. Uncomment OneSignal.SetLogLevel in the Start method if it hangs here to debug the issue." ;
278278 OneSignal . IdsAvailable ( ( userId , pushToken ) => {
279279 if ( pushToken != null ) {
280- // See http ://documentation.onesignal.com/docs/notifications- create-notification for a full list of options.
280+ // See https ://documentation.onesignal.com/reference/ create-notification for a full list of options.
281281 // You can not use included_segments or any fields that require your OneSignal 'REST API Key' in your app for security reasons.
282282 // If you need to use your OneSignal 'REST API Key' you will need your own server where you can make this call.
283283
@@ -291,7 +291,7 @@ void OnGUI() {
291291 extraMessage = "Posting test notification now." ;
292292
293293 OneSignal . PostNotification ( notification , ( responseSuccess ) => {
294- extraMessage = "Notification posted successful! Delayed by about 30 secounds to give you time to press the home button to see a notification vs an in-app alert.\n " + Json . Serialize ( responseSuccess ) ;
294+ extraMessage = "Notification posted successful! Delayed by about 30 seconds to give you time to press the home button to see a notification vs an in-app alert.\n " + Json . Serialize ( responseSuccess ) ;
295295 } , ( responseFailure ) => {
296296 extraMessage = "Notification failed to post:\n " + Json . Serialize ( responseFailure ) ;
297297 } ) ;
0 commit comments