I want to open a twitter page using a button from a game made in unity. It should detect if the mobile twitter app is present on the device and if not open in web browser instead.
public void OpenTWTR()
{
#if UNITY_ANDROID
Application.OpenURL($"www.mobile.twitter.com/{TWTR_NAME}");
#elif UNITY_EDITOR
Application.OpenURL($"www.twitter.com/{TWTR_NAME}");
#endif
}
Is there a better, more reliable way to do it?
CodePudding user response:
Hope that will work for Android -
Application.OpenURL("twitter://user?screen_name=[user_name]");