Пример #1
0
    public void ShareScoreToFacebook(MODE gameMode, float score)
    {
        if (OnFacebookLogin != null)
        {
            OnFacebookLogin();
        }

        gameScore = score;
        string newDesc = FB_LINK_NAME;

        if (gameMode == MODE.TIME)
        {
            newDesc = TIME_DESCRIPTION.Replace("xxx", gameScore.ToString());
        }
        else if (gameMode == MODE.ENDLESS)
        {
            newDesc = ENDLESS_DESCRIPTION.Replace("xxx", gameScore.ToString());
        }

        if (score < 0)
        {
            newDesc = FAILED_DESCRIPTION;
        }

        gameShareText = newDesc;
        fbDescription = newDesc;

                #if UNITY_EDITOR
        Debug.Log(newDesc);
                #endif

//		Application.OpenURL("https://www.facebook.com/dialog/feed?"+
//		                    "app_id="+ConfigManager.FACEBOOK_APP_ID+
//		                    "&link="+FB_LINK+
//		                    "&picture="+FB_IMAGE_LINK+
//		                    "&name="+SpaceHere("Bubble Poppp")+
//		                    "&caption="+SpaceHere(newDesc)+
//		                    "&description="+SpaceHere(FB_DESCRIPTION)+
//		                    "&redirect_uri=https://facebook.com/");

        if (!fbHandler.isSessionValid())
        {
            fbLoginToPost = true;
            fbHandler.Login();
        }
        else
        {
//			fbHandler.ShowShareDialog(FB_LINK,
//			                          "Bubble Poppp",
//			                          FB_IMAGE_LINK,
//			                          newDesc,
//			                          FB_DESCRIPTION);

            fbHandler.ShowShareDialog(FB_LINK,
                                      newDesc,
                                      FB_IMAGE_LINK,
                                      FB_CAPTION,
                                      FB_DESCRIPTION);
        }
    }
Пример #2
0
        private void OnTouchSignInFacebookButton(object sender, TouchEventArgs e)
        {
            if (FB.IsInitialized)
            {
                FacebookController.Login();
                MenuManager.GetInstance().RemoveCurrentMenu();
            }
            else
            {
                //FacebookController.Init();

                //if (FB.IsInitialized)
                //{
                //    FacebookController.Login();
                //}
                //else
                //{
                //    UINotification.StartNotificationNoInternet = true;
                //}

                UINotification.StartNotificationNoInternet = true;
            }
        }