Exemplo n.º 1
0
    public void Init()
    {
        if (!OneSignalInit)
        {
            switch (Application.bundleIdentifier)
            {
            case "com.monsmile.projecth.ios.dev":
            case "com.monsmile.herocry.ios.dev":
                OneSignal.Init("b4c915a0-4494-4d6e-8ade-efce0a40ad01", string.Empty, HandleNotification);
                break;

            case "com.monsmile.projecth.ios":
                OneSignal.Init("517412e4-b97d-4b24-9681-9f4dfc26fa00", string.Empty, HandleNotification);
                break;

            case "com.monsmile.projecth.android.dev":
                OneSignal.Init("b4c915a0-4494-4d6e-8ade-efce0a40ad01", "357018248098", HandleNotification, true);
                OneSignal.EnableNotificationsWhenActive(false);
                break;

            case "com.monsmile.projecth.android.test":
                OneSignal.Init("517412e4-b97d-4b24-9681-9f4dfc26fa00", "725610003103", HandleNotification);
                OneSignal.EnableNotificationsWhenActive(false);
                break;
            }
            OneSignalInit = true;
        }
        ResetBadgeNumber();

        OneSignal.SetSubscription(true);
        OneSignal.GetIdsAvailable(SetPushInfo);
    }