Я пытаюсь опубликовать свое первое приложение для iOS и столкнулся с проблемой, когда AppTrackingTransparency отображается конкретно на Ipad.
Используется iOS 16
Проверено на Iphone 12.11.13, работает нормально, появляется уведомление AppTracking.
На любом iPad надпись «Разрешить/Не разрешать» никогда не отображается, а отображается только фон.
Есть ли разница между тем, как Apple обрабатывает запрос на Ipad/Iphone? Любая информация/помощь была бы полезна. Это единственное, что стоит между мной и публикацией моего приложения!
Код:
using Unity.Advertisement.IosSupport.Components;
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
`namespace Unity.Advertisement.IosSupport.Samples
{
///
/// This component will trigger the context screen to appear when the scene starts,
/// if the user hasn't already responded to the iOS tracking dialog.
///
public class ContextScreenManager : MonoBehaviour
{
///
/// The prefab that will be instantiated by this component.
/// The prefab has to have an ContextScreenView component on its root GameObject.
///
public ContextScreenView contextScreenPrefab;
void Start()
{
// check with iOS to see if the user has accepted or declined tracking
var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
if (status == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
{
var contextScreen = Instantiate(contextScreenPrefab).GetComponent();
// after the Continue button is pressed, and the tracking request
// has been sent, automatically destroy the popup to conserve memory
contextScreen.sentTrackingAuthorizationRequest += () => Destroy(contextScreen.gameObject);
}
StartCoroutine(LoadNextScene());
}
private IEnumerator LoadNextScene()
{
Debug.Log("load next scene called");
var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
while (status == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
{
Debug.Log("not determined");
status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
yield return null;
}
if(status == ATTrackingStatusBinding.AuthorizationTrackingStatus.DENIED || status == ATTrackingStatusBinding.AuthorizationTrackingStatus.RESTRICTED || status == ATTrackingStatusBinding.AuthorizationTrackingStatus.RESTRICTED)
{
Debug.Log("consent is no");
PlayerPrefs.SetString("adConsent", "N");
}
else
{
Debug.Log("consent is yes");
PlayerPrefs.SetString("adConsent", "Y");
}
SceneManager.LoadScene(1);
yield return null;
}
}
}
using System;
using UnityEngine;
namespace Unity.Advertisement.IosSupport.Components
{
///
/// This component controls an iOS App Tracking Transparency context screen.
/// You should only have one of these in your app.
///
public sealed class ContextScreenView : MonoBehaviour
{
///
/// This event will be invoked after the ContinueButton is clicked
/// and after the tracking authorization request has been sent.
/// It's a good idea to subscribe to this event so you can destroy
/// this GameObject to free up memory after it's no longer needed.
/// Once the tracking authorization request has been sent, there's no
/// need for this popup again until the app is uninstalled and reinstalled.
///
public event Action sentTrackingAuthorizationRequest;
public void RequestAuthorizationTracking()
{
Debug.Log("Unity iOS Support: Requesting iOS App Tracking Transparency native dialog. For Global Leaderboards & Revives this has to be accepted.");
ATTrackingStatusBinding.RequestAuthorizationTracking();
sentTrackingAuthorizationRequest?.Invoke();
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/759 ... t-not-ipad
Unity AppTrackingTRansparency отображается на Iphone, но НЕ на Ipad ⇐ C#
Место общения программистов C#
-
Anonymous
1732032099
Anonymous
Я пытаюсь опубликовать свое первое приложение для iOS и столкнулся с проблемой, когда AppTrackingTransparency отображается конкретно на Ipad.
Используется iOS 16
Проверено на Iphone 12.11.13, работает нормально, появляется уведомление AppTracking.
На любом iPad надпись «Разрешить/Не разрешать» никогда не отображается, а отображается только фон.
Есть ли разница между тем, как Apple обрабатывает запрос на Ipad/Iphone? Любая информация/помощь была бы полезна. Это единственное, что стоит между мной и публикацией моего приложения!
Код:
using Unity.Advertisement.IosSupport.Components;
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
`namespace Unity.Advertisement.IosSupport.Samples
{
///
/// This component will trigger the context screen to appear when the scene starts,
/// if the user hasn't already responded to the iOS tracking dialog.
///
public class ContextScreenManager : MonoBehaviour
{
///
/// The prefab that will be instantiated by this component.
/// The prefab has to have an ContextScreenView component on its root GameObject.
///
public ContextScreenView contextScreenPrefab;
void Start()
{
// check with iOS to see if the user has accepted or declined tracking
var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
if (status == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
{
var contextScreen = Instantiate(contextScreenPrefab).GetComponent();
// after the Continue button is pressed, and the tracking request
// has been sent, automatically destroy the popup to conserve memory
contextScreen.sentTrackingAuthorizationRequest += () => Destroy(contextScreen.gameObject);
}
StartCoroutine(LoadNextScene());
}
private IEnumerator LoadNextScene()
{
Debug.Log("load next scene called");
var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
while (status == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
{
Debug.Log("not determined");
status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
yield return null;
}
if(status == ATTrackingStatusBinding.AuthorizationTrackingStatus.DENIED || status == ATTrackingStatusBinding.AuthorizationTrackingStatus.RESTRICTED || status == ATTrackingStatusBinding.AuthorizationTrackingStatus.RESTRICTED)
{
Debug.Log("consent is no");
PlayerPrefs.SetString("adConsent", "N");
}
else
{
Debug.Log("consent is yes");
PlayerPrefs.SetString("adConsent", "Y");
}
SceneManager.LoadScene(1);
yield return null;
}
}
}
using System;
using UnityEngine;
namespace Unity.Advertisement.IosSupport.Components
{
///
/// This component controls an iOS App Tracking Transparency context screen.
/// You should only have one of these in your app.
///
public sealed class ContextScreenView : MonoBehaviour
{
///
/// This event will be invoked after the ContinueButton is clicked
/// and after the tracking authorization request has been sent.
/// It's a good idea to subscribe to this event so you can destroy
/// this GameObject to free up memory after it's no longer needed.
/// Once the tracking authorization request has been sent, there's no
/// need for this popup again until the app is uninstalled and reinstalled.
///
public event Action sentTrackingAuthorizationRequest;
public void RequestAuthorizationTracking()
{
Debug.Log("Unity iOS Support: Requesting iOS App Tracking Transparency native dialog. For Global Leaderboards & Revives this has to be accepted.");
ATTrackingStatusBinding.RequestAuthorizationTracking();
sentTrackingAuthorizationRequest?.Invoke();
}
}
}
Подробнее здесь: [url]https://stackoverflow.com/questions/75935132/unity-apptrackingtransparency-showing-on-iphone-but-not-ipad[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия