public void BtnPostClicked()
    {
        if (!FB.IsLoggedIn)
        {
            return;
        }

        SoomlaProfile.UpdateStory(Provider.FACEBOOK, "This is a Treasure Chest test message!", "Huzzah!", "Caption", "Description", "", "http://www.alansjourney.com/wp-content/uploads/2015/02/Oh-Hell-Yeah.png");
    }
    public void BtnFriendsClicked()
    {
        if (!FB.IsLoggedIn)
        {
            return;
        }

        SoomlaProfile.GetContacts(Provider.FACEBOOK, true);
    }
示例#3
0
 public void playGameOver()
 {
     AudioManager.instance.GameOver();
     GPGManager.instance.ReportScoreToLeaderboard(GameManager.instance.levelShow);
     if (GameManager.instance.levelShow > 10)
     {
         SoomlaProfile.OpenAppRatingPage();
     }
 }
    public void BtnStatusClicked()
    {
        if (!FB.IsLoggedIn)
        {
            return;
        }

        SoomlaProfile.UpdateStatus(Provider.FACEBOOK, "This is a Treasure Chest test status!");
    }
示例#5
0
 public void InviteFacebook()
 {
     SoomlaProfile.Invite(
         Provider.FACEBOOK,                  // Provider
         "Let's use SOOMLA together!",       // Invitation message
         "SOOMLA Invitation",                // Dialog title
         "",                                 // Payload
         null                                // Reward
         );
 }
 public void LogInOrLogOutTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.Logout(Provider.TWITTER);
     }
     else
     {
         SoomlaProfile.Login(Provider.TWITTER);
     }
 }
示例#7
0
        /// <summary>
        /// Opens this <c>Gate</c> by "liking" the associated page.
        /// </summary>
        /// <returns>If the page was successfully "liked" returns <c>true</c>; otherwise
        /// <c>false</c>.</returns>
        protected override bool openInner()
        {
            if (CanOpen())
            {
                SoomlaProfile.Like(Provider, PageName);

                return(true);
            }

            return(false);
        }
    public void BtnLogoutClicked()
    {
        if (!FB.IsLoggedIn)
        {
            return;
        }

        SoomlaProfile.Logout(Provider.FACEBOOK);
        m_OnlinePanel.SetActive(false);
        m_OfflinePanel.SetActive(true);
    }
示例#9
0
 //intenta deslogear de facebook mediante soomla
 public void tryLogoutFB()
 {
     if (isloggedFB())
     {
         SoomlaProfile.Logout(Provider.FACEBOOK);
     }
     else
     {
         Debug.LogWarning("No esta logeado en FB");
     }
 }
示例#10
0
 // Provide form so user can login in to Facebook
 public void FBLogin()
 {
     if (!SoomlaProfile.IsLoggedIn(Provider.FACEBOOK))
     {
         SoomlaProfile.Login(Provider.FACEBOOK, "facebook");
     }
     else
     {
         // If the user is already logged in and presses the button then post to facebook (auto-login scenario)
         postToWall();
     }
 }
    // Use this for initialization
    void Start()
    {
        SoomlaProfile.Initialize();

        ProfileEvents.OnLoginStarted   += OnLoginStarted;
        ProfileEvents.OnLoginFinished  += OnLoginFinished;
        ProfileEvents.OnLoginFailed    += OnLoginFailed;
        ProfileEvents.OnLoginCancelled += OnLoginCancelled;

        ProfileEvents.OnLogoutFinished += onLogoutFinished;
        ProfileEvents.OnLogoutFailed   += onLogoutFailed;
    }
示例#12
0
 // Provide form so user can login in to Twitter
 public void twitterLogin()
 {
     if (!SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.Login(Provider.TWITTER, "twitter");
     }
     else
     {
         // If the user is already logged in and presses the button then post to twitter (auto-login scenario)
         postToTwitter();
     }
 }
示例#13
0
 public void SharePost()
 {
     SoomlaProfile.UpdateStoryWithConfirmation(
         Provider.FACEBOOK,
         "My first post from app",
         "Post",
         "Hi",
         "Test Post",
         @"http://www.activatear.com",
         @"http://www.activatear.com/activatearvideos/raptor.jpg",
         "",
         null
         );
 }
示例#14
0
    // Use this for initialization
    void Start()
    {
        //image_anim = image_ref.GetComponent<Animator>();
        //fadeColorAnimationClip = image_ref.GetComponent<Animation>();
        //fadeColorAnimationClip.Play ("FadeToColor");

        // Initialize the store assets
        SoomlaStore.Initialize(new SOAPStoreAssets());

        // Initialize soomla profile
        SoomlaProfile.Initialize();

        Invoke("LoadDelayed", 1.0f);
    }
示例#15
0
 public void UpdateTwitterStory()
 {
     Debug.Log("Share button clicked. Login status: " + SoomlaProfile.IsLoggedIn(Provider.TWITTER));
     if (!SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.Login(Provider.TWITTER);
         ProfileEvents.OnLoginFinished += (UserProfile userProfile, bool autologin, string payload) => {
             //Your code to execute here
             Debug.Log("onloginfinished Logged into " + userProfile.Provider + " username: "******"", null);
     CloseSharePopup();
 }
示例#16
0
        /// <summary>
        /// Opens this <c>Gate</c> by uploading the associated image.
        /// </summary>
        /// <returns>If the image was successfully uploaded returns <c>true</c>; otherwise
        /// <c>false</c>.</returns>
        protected override bool openInner()
        {
            if (CanOpen())
            {
                SoomlaProfile.UploadImage(Provider.FACEBOOK,
                                          Message,
                                          FileName,
                                          ImgTexture,
                                          this.ID);

                return(true);
            }

            return(false);
        }
示例#17
0
    // Post to Twitter
    public void postToTwitter()
    {
        SoomlaProfile.UpdateStory(
            Provider.TWITTER,
            "Scored 1000 points in Snake and Tails!",                                                                        // Message
            "Red Tape Studios",                                                                                              // Name
            "RTS FTW!",                                                                                                      // Caption
            "rts_snake_tails",                                                                                               // Desc
            "https://play.google.com/store/apps/details?id=com.RedTapeStudios.MatchMayhem_01&hl=en",                         // Link
            "https://lh3.googleusercontent.com/VZA4sJmj4Gw1SHzJQJredvGtQeDbUzMdyGykSA1MJW35yWN1-06ve6YuED_sbV1u2a4=h900-rw", // Image
            "twitter"
            );

        swap_to_twitter_posted_img();
    }
示例#18
0
        /// <summary>
        /// Opens this <c>Gate</c> by posting the associated story.
        /// </summary>
        /// <returns>If the story was successfully posted returns <c>true</c>; otherwise
        /// <c>false</c>.</returns>
        protected override bool openInner()
        {
            if (CanOpen())
            {
                SoomlaProfile.UpdateStory(Provider,
                                          Message,
                                          StoreName,
                                          Caption,
                                          Link,
                                          ImgUrl,
                                          this.ID);

                return(true);
            }

            return(false);
        }
示例#19
0
 public void ShareStatusTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.UpdateStatusWithConfirmation(
             Provider.TWITTER,                                // Provider
             "Check out this great challenging memory game",  // Message to post as status
             "",                                              // Payload
             null,                                            // Reward
             "Do you want to share this f****n awsom status?" // Message to show in the confirmation dialog
             );
     }
     else
     {
         TwitterLogin();
     }
 }
示例#20
0
    /// <summary>
    /// Initializes this instance.
    /// </summary>
    public void Initialize()
    {
        // Initialize only once
        if (m_isInitialized)
        {
            return;
        }

        // Subscribe to Profile events
        ProfileEvents.OnSoomlaProfileInitialized += OnSoomlaProfileInitialized;
        ProfileEvents.OnSocialActionStarted      += OnSocialActionStarted;
        ProfileEvents.OnSocialActionFinished     += OnSocialActionFinished;
        ProfileEvents.OnSocialActionCancelled    += OnSocialActionCancelled;
        ProfileEvents.OnSocialActionFailed       += OnSocialActionFailed;

        SoomlaProfile.Initialize();
    }
示例#21
0
        void Start()
        {
            StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;

            StoreEvents.OnUnexpectedStoreError += onUnexpectedStoreError;


            GrowHighway.Initialize();
            bool modelSync = true;
            bool stateSync = true;

            GrowSync.Initialize(modelSync, stateSync);
            GrowGifting.Initialize();
            SoomlaProfile.Initialize();
            GrowInsights.Initialize();
            SoomlaStore.Initialize(new IAPAssets());
            StartCoroutine("loadMainScene");
            Invoke("loadGameNotAsync", 4);
        }
示例#22
0
    /// <summary>
    /// Shares a screenshot on one of the available social platforms.
    /// </summary>
    /// <param name="screenshotWidth">Width of the screenshot.</param>
    /// <param name="screenshotHeight">Height of the screenshot.</param>
    /// <param name="screenshotCamera">The camera used to take the screenshot.</param>
    /// <param name="useOneCamera">if set to <c>true</c> take screenshot as seen by one camera.
    ///     Else, take screenshot as seen by player (views of all cameras combined).</param>
    /// <param name="shareMessage">The message to share along with the screenshot.</param>
    /// <param name="screenshotFilePath">The path to the prepared screenshot, if available.
    ///     Else, this is the path to save the screenshot to.</param>
    /// <param name="screenshotProvided">if set to <c>true</c> the screenshot is already provided
    ///     in the specified file path, and needs only to be shared.</param>
    /// <param name="deleteOnShare">if set to <c>true</c> delete the local copy of the screenshot
    ///     after it has been successfully shared.</param>
    private void MultiShareScreenshot(int screenshotWidth, int screenshotHeight,
                                      Camera screenshotCamera, bool useOneCamera,
                                      string shareMessage, string screenshotFilePath,
                                      bool screenshotProvided, bool deleteOnShare)
    {
        // If width is not specified, use screen width
        int width = (screenshotWidth > 0) ? screenshotWidth : Screen.width;
        // If height is not specified, use screen height
        int height = (screenshotHeight > 0) ? screenshotHeight : Screen.height;

        // If camera is not specified, use main camera
        Camera camera = (screenshotCamera != null) ? screenshotCamera : Camera.main;

        // If file path is not specified, save the screenshot to a generic location
        string filePath = !string.IsNullOrEmpty(screenshotFilePath) ? screenshotFilePath :
                          Application.persistentDataPath + "/CRCScreen_" + DateTime.Now.GetTimestamp() + ".png";

        // Take screenshot and save it to file
        if (!screenshotProvided || (screenshotProvided && string.IsNullOrEmpty(screenshotFilePath)))
        {
            if (useOneCamera)
            {
                // Screenshot as seen from one camera
                Texture2D screenshot = ScreenshotUtils.TakeScreenshotSave(width, height, camera, filePath);
                UpdateScreenshot(screenshot);
            }
            else
            {
                // Screenshot as seen by player
                Application.CaptureScreenshot(filePath);
            }
        }

        // Open the multishare window and pass in the screenshot path
        SoomlaProfile.MultiShare(shareMessage, filePath);

        // Delete local copy of screenshot
        // TODO: Wait until multishare finishes before deleting
        if (deleteOnShare && ScreenshotUtils.IsScreenshotReady(filePath))
        {
            //System.IO.File.Delete(filePath);
        }
    }
示例#23
0
 //intenta crear un feed/mensaje en el muro del usuario logeado en facebook, usando soomla
 public void makeFBFeed()
 {
     if (isloggedFB())
     {
         SoomlaProfile.UpdateStory(
             Provider.FACEBOOK,
             "Check out this great game: OMF",
             "OMF: SurfRescue!",
             "OMF is amazing!",
             "omf game from electroplasmatic games",
             "https://www.facebook.com/ohmyfrog.surfrescue",
             "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/p160x160/10665697_304545143067074_11542050484542634_n.jpg?oh=00b8a665b3f03bd5f4b2a00ab4c2bed2&oe=554BBF35&__gda__=1435501571_ea7f4a4e8eeeb811ceff4a73a31ce8e1",
             string.Empty,
             null);
     }
     else
     {
         Debug.LogWarning("No esta logeado en FB");
         tryLoginFB();
     }
 }
 public void ShareOnTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.UpdateStory(
             Provider.TWITTER,
             "All your base are belong to us",
             null,
             null,
             null,
             "WWW.link.com",
             null,
             null,
             null
             );
     }
     else if (SceneManager.GetActiveScene().name == "MainMenu")
     {
         MenuController.instance.NotificationMessage("Please connect in order to post");
     }
 }
 public void ShareOnTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.UpdateStory(
             Provider.TWITTER,
             "Im Playing This Awesome Game " + Random.Range(0, 100),
             null,
             null,
             null,
             null,
             "www.Link.com",
             null,
             null
             );
     }
     else
     {
         if (Application.loadedLevelName == "MainMenu")
         {
             MenuController.instance.NotificationMessage("Please Connect In Order To Post");
         }
     }
 }
示例#26
0
 public void RateMyApp()
 {
     SoomlaProfile.OpenAppRatingPage();
 }
 public void LogInToFacebook()
 {
     SoomlaProfile.Login(Provider.FACEBOOK);
 }
 // Use this for initialization
 void Start()
 {
     SoomlaProfile.Initialize();
 }
示例#29
0
 //comprueba si esta logeado en facebook mediante soomla
 public bool isloggedFB()
 {
     return(SoomlaProfile.IsLoggedIn(Provider.FACEBOOK));
 }
示例#30
0
 public void LoginFB()
 {
     SoomlaProfile.Login(Provider.FACEBOOK);
 }