You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using OneSignalSDK;
|
|
|
|
using OneSignalSDK.Debug.Models;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class OSNInitializer : MonoBehaviour
|
|
|
|
{
|
|
|
|
// Start is called before the first frame update
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
Invoke(nameof(InitializeOSN),2f);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeOSN()
|
|
|
|
{
|
|
|
|
string ons_id = "";
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
ons_id = GameConstants.OSN_Android;
|
|
|
|
#elif UNITY_IOS
|
|
|
|
ons_id = GameConstants.OSN_iOS;
|
|
|
|
#endif
|
|
|
|
Debug.Log($"Initializing with appId <b>{ons_id}</b>");
|
|
|
|
OneSignal.Debug.LogLevel = LogLevel.Debug;
|
|
|
|
OneSignal.Initialize(ons_id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|