I’m working on a Unity project using UAAL-library to integrate game into ios and android native apps. I have a simple code that opens url leading to game’s website. On android, this works perfectly, but on ios the url opens correctly only the first time, the next time click on the button does nothing. What could be the problem here?
The url looks like: “https://apps.apple.com/us/app//id1111111111”
My code:
public class UrlOpenButton : MonoBehaviour
{
[SerializeField] private Button _button;
[SerializeField] private string _url;
private void OnEnable()
{
_button.onClick.AddListener(OnButtonClick);
}
private void OnDisable()
{
_button.onClick.RemoveListener(OnButtonClick);
}
private void OnButtonClick()
{
Application.OpenURL(_url);
}
}
Unity version is: 2022.3.17f1
I assumed that the problem might be in the game’s focus or in the features of the subscription/unsubscription on iOS, but adding re-subscription in the OnApplicationPause and OnApplicationFocus methods did not help
RudeGalaxy1010 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.