protected void Page_Load(object sender, EventArgs e)
    {
        string TokenValue       = Request["token"];                                         //Get token returned from Engage
        string ApiKey           = "fcda9b168be8888bdc9c9288aab4e1572fe86ff7";               //Unique Engage API Key
        string EngageAppURL     = "https://login.disturbedasylum.com/openid/v2/signin?token_url=";  //The Engage Application URL that you get from the Sign in Setup
        string EngageTokenURL   = "http%3A%2F%2Flocalhost%2Fengagedotnet%2Fdefault.aspx";   //The URL Encoded token URL that you get from the Sign in Setup
        bool ShowContactsFlag   = true;                                                    //To show the contacts for this user based on the network that they logged in with
        string ContactProviders = "Facebook,Google,LinkedIn";                               //This is the list of providers that you can get contacts from

        EngageSignInLink.HRef = EngageAppURL + EngageTokenURL;                              //Full signin link to start the sign in process

        EngageService = new EngageService(ApiKey);

        //For this starter, the Default.aspx page is the initiating page AND the token URL
        //So, we must check to see if there's a token that's being posted or not
        if (TokenValue != null)
        {
            EngageService = new EngageService(ApiKey);
            
            //Get the user profile based on the returned token.            
            //EngageUser User = GetUserData(TokenValue);
            //Show the user data
            //if(User != null)
             //   ShowUserData(User);

            
            //Get Contacts for the user based on page setup
            if (ShowContactsFlag)
            {
                //If the provider in the list of providers matches the provider that the user logged in with then
                //get the contacts for that provider
                string[] providerList = ContactProviders.Split(',');
                foreach(string specificProvider in providerList)
                {
                    if (User.Provider == specificProvider)
                    {
                        ShowContacts(GetUserContacts(User));
                        break;
                    }

                }
                
                
                
               
            }

        }

        ShowContacts(GetUserContacts("https://www.google.com/profiles/107150545288686948275"));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string TokenValue       = Request["token"];                                                //Get token returned from Engage
        string ApiKey           = "fcda9b168be8888bdc9c9288aab4e1572fe86ff7";                      //Unique Engage API Key
        string EngageAppURL     = "https://login.disturbedasylum.com/openid/v2/signin?token_url="; //The Engage Application URL that you get from the Sign in Setup
        string EngageTokenURL   = "http%3A%2F%2Flocalhost%2Fengagedotnet%2Fdefault.aspx";          //The URL Encoded token URL that you get from the Sign in Setup
        bool   ShowContactsFlag = true;                                                            //To show the contacts for this user based on the network that they logged in with
        string ContactProviders = "Facebook,Google,LinkedIn";                                      //This is the list of providers that you can get contacts from

        EngageSignInLink.HRef = EngageAppURL + EngageTokenURL;                                     //Full signin link to start the sign in process

        EngageService = new EngageService(ApiKey);

        //For this starter, the Default.aspx page is the initiating page AND the token URL
        //So, we must check to see if there's a token that's being posted or not
        if (TokenValue != null)
        {
            EngageService = new EngageService(ApiKey);

            //Get the user profile based on the returned token.
            //EngageUser User = GetUserData(TokenValue);
            //Show the user data
            //if(User != null)
            //   ShowUserData(User);


            //Get Contacts for the user based on page setup
            if (ShowContactsFlag)
            {
                //If the provider in the list of providers matches the provider that the user logged in with then
                //get the contacts for that provider
                string[] providerList = ContactProviders.Split(',');
                foreach (string specificProvider in providerList)
                {
                    if (User.Provider == specificProvider)
                    {
                        ShowContacts(GetUserContacts(User));
                        break;
                    }
                }
            }
        }

        ShowContacts(GetUserContacts("https://www.google.com/profiles/107150545288686948275"));
    }
 public void TestSetup()
 {
     mockApiWrapper = MockRepository.GenerateMock<IEngageApiWrapper>();
     EngageService = new EngageService(mockApiWrapper);
 }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string TokenValue       = Request["token"];                                         //Get token returned from Engage
        string ApiKey           = "8c04fd573bd8d27d5ec72eda1d04c5f82909c6c6";               //Unique Engage API Key
        string EngageAppURL     = "https://jbtest.rpxnow.com/openid/v2/signin?token_url=";  //The Engage Application URL that you get from the Sign in Setup
        string EngageTokenURL   = "http%3A%2F%2Flocalhost%2Fengagedotnet%2Fdefault.aspx";   //The URL Encoded token URL that you get from the Sign in Setup
        bool ShowContactsFlag   = true;                                                    //To show the contacts for this user based on the network that they logged in with
        bool SendStatusUpdate   = false;                                                    //To show an API level social publish using default "canned" data
        string ContactProviders = "Facebook,Google,LinkedIn";                               //This is the list of providers that you can get contacts from

        EngageSignInLink.HRef = EngageAppURL + EngageTokenURL;                              //Full signin link to start the sign in process
        
        //For this starter, the Default.aspx page is the initiating page AND the token URL
        //So, we must check to see if there's a token that's being posted or not
        if (TokenValue != null)
        {
            LocalEngageService = new EngageService(ApiKey);

           

            
            //Get the user profile based on the returned token.            
            EngageUser User = GetUserData(TokenValue);
            //Show the user data
            if(User != null)
                ShowUserData(User);

            #region Social Publishing API
            //Make an API level wall update.  Use with Facebook as best example!
            //NOTE: This uses a pre-formatted JSON object pulled from documentation on rpxnow.com/docs#api_activity.  Clearly you would want to format
            //this according to REAL data.
            /*
                {
                    "user_generated_content": "I thought you would appreciate my review.",
                    "title": "A Critique of Atomic Pizza",
                    "action_links": [
                    {
                        "href": "http:\/\/example.com\/review\/write",
                        "text": "Write a review"
                    }
                    ],
                    "action": "wrote a review of Atomic Pizza",
                    "url": "http:\/\/example.com\/reviews\/12345\/",
                    "media": [
                    {
                        "href": "http:\/\/bit.ly\/3fkBwe",
                        "src": "http:\/\/bit.ly\/1nmIX9",
                        "type": "image"
                    }
                    ],
                    "description": "Atomic Pizza has a great atmosphere and great prices.",
                    "properties": {
                    "Location": {
                        "href": "http:\/\/bit.ly\/3fkBwe",
                        "text": "North Portland"
                    },
                    "Rating": "5 Stars"
                    }
                }
            */
            #endregion

            if (SendStatusUpdate)
            {
                string StatusMessage = "{\"user_generated_content\": \"I thought you would appreciate my review.\",\"title\": \"A Critique of Atomic Pizza\",\"action_links\": [{\"href\": \"http:\\/\\/example.com\\/review\\/write\",\"text\": \"Write a review\"}],\"action\": \"wrote a review of Atomic Pizza\",\"url\": \"http:\\/\\/example.com\\/reviews\\/12345\\/\",\"media\": [{\"href\": \"http:\\/\\/bit.ly\\/3fkBwe\",\"src\": \"http:\\/\\/bit.ly\\/1nmIX9\",\"type\": \"image\"}],\"description\": \"Atomic Pizza has a great atmosphere and great prices.\",\"properties\": {\"Location\": {\"href\": \"http:\\/\\/bit.ly\\/3fkBwe\",\"text\": \"North Portland\"},\"Rating\": \"5 Stars\"}}";
                LocalEngageService.SetActivity(User.Identifier, StatusMessage);
            }
            
            
            //Get Contacts for the user based on page setup
            if (ShowContactsFlag)
            {
                //If the provider in the list of providers matches the provider that the user logged in with then
                //get the contacts for that provider
                string[] providerList = ContactProviders.Split(',');
                foreach(string specificProvider in providerList)
                {
                    if (User.Provider == specificProvider)
                    {
                        ShowContacts(GetUserContacts(User));
                        break;
                    }

                }     
            }
        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string TokenValue       = Request["token"];                                        //Get token returned from Engage
        string ApiKey           = "8c04fd573bd8d27d5ec72eda1d04c5f82909c6c6";              //Unique Engage API Key
        string EngageAppURL     = "https://jbtest.rpxnow.com/openid/v2/signin?token_url="; //The Engage Application URL that you get from the Sign in Setup
        string EngageTokenURL   = "http%3A%2F%2Flocalhost%2Fengagedotnet%2Fdefault.aspx";  //The URL Encoded token URL that you get from the Sign in Setup
        bool   ShowContactsFlag = true;                                                    //To show the contacts for this user based on the network that they logged in with
        bool   SendStatusUpdate = false;                                                   //To show an API level social publish using default "canned" data
        string ContactProviders = "Facebook,Google,LinkedIn";                              //This is the list of providers that you can get contacts from

        EngageSignInLink.HRef = EngageAppURL + EngageTokenURL;                             //Full signin link to start the sign in process

        //For this starter, the Default.aspx page is the initiating page AND the token URL
        //So, we must check to see if there's a token that's being posted or not
        if (TokenValue != null)
        {
            LocalEngageService = new EngageService(ApiKey);



            //Get the user profile based on the returned token.
            EngageUser User = GetUserData(TokenValue);
            //Show the user data
            if (User != null)
            {
                ShowUserData(User);
            }

            #region Social Publishing API
            //Make an API level wall update.  Use with Facebook as best example!
            //NOTE: This uses a pre-formatted JSON object pulled from documentation on rpxnow.com/docs#api_activity.  Clearly you would want to format
            //this according to REAL data.

            /*
             *  {
             *      "user_generated_content": "I thought you would appreciate my review.",
             *      "title": "A Critique of Atomic Pizza",
             *      "action_links": [
             *      {
             *          "href": "http:\/\/example.com\/review\/write",
             *          "text": "Write a review"
             *      }
             *      ],
             *      "action": "wrote a review of Atomic Pizza",
             *      "url": "http:\/\/example.com\/reviews\/12345\/",
             *      "media": [
             *      {
             *          "href": "http:\/\/bit.ly\/3fkBwe",
             *          "src": "http:\/\/bit.ly\/1nmIX9",
             *          "type": "image"
             *      }
             *      ],
             *      "description": "Atomic Pizza has a great atmosphere and great prices.",
             *      "properties": {
             *      "Location": {
             *          "href": "http:\/\/bit.ly\/3fkBwe",
             *          "text": "North Portland"
             *      },
             *      "Rating": "5 Stars"
             *      }
             *  }
             */
            #endregion

            if (SendStatusUpdate)
            {
                string StatusMessage = "{\"user_generated_content\": \"I thought you would appreciate my review.\",\"title\": \"A Critique of Atomic Pizza\",\"action_links\": [{\"href\": \"http:\\/\\/example.com\\/review\\/write\",\"text\": \"Write a review\"}],\"action\": \"wrote a review of Atomic Pizza\",\"url\": \"http:\\/\\/example.com\\/reviews\\/12345\\/\",\"media\": [{\"href\": \"http:\\/\\/bit.ly\\/3fkBwe\",\"src\": \"http:\\/\\/bit.ly\\/1nmIX9\",\"type\": \"image\"}],\"description\": \"Atomic Pizza has a great atmosphere and great prices.\",\"properties\": {\"Location\": {\"href\": \"http:\\/\\/bit.ly\\/3fkBwe\",\"text\": \"North Portland\"},\"Rating\": \"5 Stars\"}}";
                LocalEngageService.SetActivity(User.Identifier, StatusMessage);
            }


            //Get Contacts for the user based on page setup
            if (ShowContactsFlag)
            {
                //If the provider in the list of providers matches the provider that the user logged in with then
                //get the contacts for that provider
                string[] providerList = ContactProviders.Split(',');
                foreach (string specificProvider in providerList)
                {
                    if (User.Provider == specificProvider)
                    {
                        ShowContacts(GetUserContacts(User));
                        break;
                    }
                }
            }
        }
    }