first run page on wp8? - c#

So I'm creating an app that uses Facebook and Twitter features so I want when the app is first installed to be able to run a page that allows them to setup facebook and twitter first. Like for example the Twitter setup page is TwitterSetup.xaml and FB setup is FacebookSetup.xaml. How do I code a first-run page?

When you start the App, you need to check if the User entered the data you need (Twitter or Facebook login for example). To do this you can use IsolatedStorageSettings or local storage (as posted by #manojlds here).
For example you add code in MainPage(), that loads Settings or Storage and checks if the user has already entered what you need, if not - then you navigate him to the right Page.

Related

Auto login to itslearning using C#

I want to auto login to a website (itslearning.com) and then display it in my Windows Forms Application with CefSharp.
It would be easy to do this with itslearning eLogin (https://developer.itslearning.com/Single_Sign-On_and_Authentication.html#284208891), but unfortunately my school doesn't support it.
Is there any other way to automatically login to my schools itslearning page?
May be save the login cookies? Or doing the same thing as the itslearning native app for mobile phones. The app uses OAuth2 for authentication. When you click on a link in the app (e.g. for the Dashobard) it opens the browser and you are automatically logged in.
I figured it out.
You can just use the itslearning Rest API:
www.itslearning.com/restapi/help

Pass cookie to WebBrowser in Windows Phone 8

I am currently developing an app that uses a public API. After performing the login procedure with that API, I get a cookie that I store in my app. I need to pass this cookie with every API call, that I request. So far so good.
Now unfortunately this API doesn't give me acces to all features of the service. What I want to do is giving the users of my app a button, which open a WebBrowser for that specific features. The problem is, that the user is, of course, not logged in in that WebBrowser.
What I found out on my PC is, that the login-cookie, that I get from the API, would actually work for the website itself as well. So what I want to do is: When the user clicks on the button, it opens the WebBrowser and passes the login cookie I already have to the WebBrowser, so the user is already logged in and can use the feature. Is there any solution for that problem? I couldn't an answer for that.
Cheers! :)
You can only set cookies from invoking javascript on the page when loading is completed.
Windows Phone WebBrowser set cookies

Facebook Authentication in Background - C# sdk

I am developing a windows phone app using facebook c# sdk. I created a login page to authenticate the user and it also working well. But my problem is, next time when the user open the app, it should be navigated to main page and do the authentication work in background. Is there anyway to do this??
I used navigatedto override method to "redirect the user into the mainpage". I dont know how to authenticate the user in background. Help plss..
save token (received from fb) in ur isolated storage & check if it invalid in ur HomePage and so accordingly navigate to Login (if invalid)

Signed_request lost in ASP.NET session, confusing my website

I have an ASP.NET MVC 3 website which is available both from a specific public url, and I'm also making be available as a Facebook App.
Inside my website logic, in some places I have to determine whether the current request is from the Facebook-app, or from the public website, because I want to display content based on this environment.
So, for eg. if the user is using my site as a facebook-app, then I want to display a picture, and if the user is using my site normally, then I don't wanna display a picture.
To determine whether I'm from a Facebook app, I check the "signed_request" in the HttpContext.Request, and store it in the HttpSession to be available for my other actions, not just for that action (url) which is defined for my Facebook app.
So when a child-action is executed, I can determine based on the Session, that the website is used as a FB-app or not.
The problem happens, when the Session times out, because then althought the logic is still running inside Facebook, my logic thinks it's not inside Facebook.
Any advice?
Can you periodically contact the server from the FB-App? Maybe you can "ping" from it if the user does not make any action for a while
If you don't want it, you can store important information from signed_request in cookie, that expires when browser is closed. Session is not reliable enough to store this content.
I think your approach may be wrong. What if user enters your application both on Facebook and from separate url? Facebook has Javascript API, that places cookies if user is connected to the site. If user is connected, you should display Facebook related content and it shouldn't matter if this is canvas app or separate page. Specially if it uses the same views. If views are not the same, only url, you should have separate urls for canvas app.
Last solution, but horrible is to check in Javascript if page is working in iframe and if it is and signed_request is not present, reload top.location.

Facebook C# SDK - invite friend to Web SIte

I have a web site and I want to give a opportunity to users to invite their facebook friends to this web site.
I have:
C# Facebook SDK installed to project
Facebook Dev Account with new app
Users at my site use site's auth control (not oAuth). They register on site and can connect their Facebook profile.
The question is next one: How to allow users to invite their friends to web site not using facebook oAuth (just sending user id) with Facebook C# SDK (or without if it's not possible in this way)
UPDATED
I want to do this in next way: user click the button "invite friends" (standart invitation screen of FB), check friend, click invite - finish action :)
Thanks a lot!
I think you should look at the Requests dialog here: http://developers.facebook.com/docs/reference/dialogs/requests/
Only drawback is, that when users accept the request, they'll be shown your Canvas URL - which means this page loads inside the Facebook UI - they're not redirected to you site entirely.
You could use this page to "sell" your website, so they navigate to your site.
Another approach is using the new Send button: http://developers.facebook.com/docs/reference/plugins/send/
This will send a message with a link to your site.
I dont think that is possible. Becuase to access user private data you need to authenticate yourself as well as user with facebook. Facebook provides OAuth for the same !

Categories

Resources