Home > Back-end >  How to open the twitter from android app?
How to open the twitter from android app?

Time:10-24

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]");
  • Related