How to integerate Facebook chat in iPhone using xmpp framework - facebook

I am trying to integrate Facebook chat in iPhone, when I searched related stuff I found xmpp framework. I download it and run but it is not showing anything. Is there any tutorial available for this? can anyone help me to how to integerate facebook chat in iPhone?
Inam

Check this out: http://code.google.com/p/xmppframework/wiki/FacebookChatHowTo
Now the project has moved to git hub, the same page can ben found on http://github.com/robbiehanson/XMPPFramework/wiki/FacebookChatHowTo

https://github.com/robbiehanson/XMPPFramework
how to compile is on this link.
https://github.com/robbiehanson/XMPPFramework/wiki/GettingStarted_iOS
which is also on the same git page.
download xmppframework and unzip it.In the unzip folder contains xcode folder open it and again it contains iphoneXMPP folder ans open it click on xcode proj and run it.
login page will be displayed before that open appdelegate.m file there is delegate method:
(void)xmppStream:(XMPPStream *)sender willSecureWithSettings:(NSMutableDictionary *)settings
{
}
Replace server domain from "talk.google.com" to "chat.facebook.com" and virtualDomain from "gmail.com" to "facebook.com"
You must login with your facebook username and password.Remember username is differ from regular username,
for example
my regular username is:" venkat.varra#gmail.com" but if i provide this wouldnot login intead of this i will provide username as: "venkat.reddy.73157203#chat.facebook.com"
password is asusual.
Toget your username like this go to facebook account and click your display name then observe address bar of the browser.
I tried this way and i get my facebook friends.You try this.

Facebook seems to have deprecated XMPP Chat API. Should no longer work After April 30th, 2015.
More here : https://developers.facebook.com/docs/chat#platauth

Related

Facebook Login - Magento extension

We have a Magento extension - EZLOGIN LITE for Facebook login.
Set everything up, but when you click 'F log in' still getting this: "Dear Customer! Allow this application to complete the login process".
Here is link: http://www.blubond.com/store/customer/account/login/
But 'F log in' is temporary removed because of this.
Anyone know what is it about?
Thank you.
Thanks for commenting back.
For me the development server's facebook login also not working fine.
Showing like this :
For which domain you have downloaded the extension, That will work for that domain only I think, So you download the extension again by giving the production server(http://www.blubond.com/) link from http://store.velanapps.com/products/magento/free-facebook-login-extension.
While creating facebook app also you have to give site url.
So create one more facebook app by giving the production server link(http://www.blubond.com/)
as given in this guide : http://velanapps.com/Ezlogin-Installation-Manual.pdf
Try by doing this. If then also it didn't work, I will help you out.
Cheers :-)

Facebook App : This must be derived from Canvas URL, Secure Canvas URL

Hi I wan't to create a facebook app to use it for the auth in my new site locally installed(my machine),but from yesterday I don't succeed to install it and use it, all time I have this very strange error when I wan't write a domain in the "App Domains" :
This must be derived from Canvas URL, Secure Canvas URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains
the domain of my application is http://localhost/project/app_dev.php/ it dosn't work I change it by a real url such as : http://www.exemple.com/,but I had the same error,and just I notice that I see this error when I create an app with new look of facebook (yesterday)...
In my case the problem was I hadn't completed the "+ Add Platform > Website" section. Once I did that the contents of App Domains became valid and the error went away.
I had this same problem yesterday, the stackoverflow answers that helped me the most were
Make local development work with Facebook/Google APIs and Canvas URL / Secure Canvas URL error message ( Also checkout How to handle OmniAuth callbacks in multiple environments?)
The Facebook developer UI has changed a bit. I'm writing this answer to consolidate all the info that helped me.
1. Make local.host Point to Your Computer
First thing you need to do is (as answered in the first link), facebook won't take localhost as a valid callback site, because it confuses localhost with a top level domain (com org etc.) in other words there is not dot . in your domain name. So change your /etc/hosts to add the entry
127.0.0.1 local.host
Now youcan access your app at http://local.host/... (this will take effect as soon as you save /etc/hosts file, no need to restart anything)
2. Add local.host as the Site URL on the facebook Dev Console
The second thing you need to do is add local.host as the site url on the facebook page
Now don't use your production app. Add a dummy app on your https://developers.facebook.com account Because your production app will have to set the site URL to your production URL and not local.host
Configure the dummy app as shown in the screenshot. But that website section(shown in the screenshot) won't be visible on the Basic settings page from the beginning.
First you will have to click + Add Platform button at the bottom, and select Website.
Notice I added http://local.host:3000/. That's where my ruby server runs in dev mode.
Also, be sure to use App Id and App Secret for the dummy app when running your webapp in dev mode.
HTH.
My problem was that logging in with facebook wasn't working for my app.
It turned out that I just needed to fill in the "Valid OAuth redirect URIs" field on the "Advanced" tab.
e.g. http://example.com/auth/google/callback
I'd a similar problem, Facebook have changed now on left pane file login (After selecting you app from top left corner) -> Valid OAuth redirect URIs
If you work on desktop app like WPF or winforms and use a WebBrowser Control to log in with the Facebook SDK.
You have to set to yes the Embedded Browser OAuth Login in Advance Tab of your facebook apps setting.
hope I help
Chose "Add platform" at the bottom and give your localhost url. "http://localhost:port/".
After this step. Facebook allows you to add localhost:port as your domain url.
After these 2 steps you can test "login with facebook" without any trouble.

How to add facebook-ios-sdk in app for login and fetch user data

I want to integrate the facebook login dialog in my app. For that i have checked the facebook developer page to integrate it.
1 - Downloaded facebook sdk package and installed it
2 - added facebook.framework and FBUserSettingsViewResources.bundle in my app
3 - and use its SessionLoginSample
Its running and user can do login using facebook but its open in safary instead of that i want to open it in dialog box.
Answer in here says that do change in facebook.m file but my project does not have it. for that i have downloaded facebook-ios-sdk project from the GITHub and in that project from src folder i have copied all file in my project. Its non arc so added flag fno-objc-arc.
But facebook.m file does not contain that code which answer suggested to change. And also i have implemented graph GraphApiSample but it display error in FBLoginView.
So plz help on this topic any code or tutorial will be highly appreciable.
If you want to open the login page within your app you have to use the FBGraphAPI .
If you want to force the web dialog, you need to specify the login behavior.
If you look in FBSession, there are many methods to open a Session, many of which will take an FBSessionLoginBehavior parameter. If you pass in FBSessionLoginBehaviorForcingWebView for the login behavior, it will force the web view dialog.

Get itunes link for app before submitting

I read in another post that you can submit the app without the binary but I based on what I have seen this is no longer possible. It seems you cannot submit without the binary and the binary is submitted through the application loader. Is there any other known way to get the itunes/app store link to my app before I submit the binary?
The manual way:
Your should copy your "Apple ID" from iTunes connect and use this link:
http://itunes.apple.com/us/app/APPNAME/idXXXXXXXXX
Would open the US store ("APPNAME" is that app name and XXXXXXXXX is the "Apple ID". You can use more general method (Recommended):
http://itunes.apple.com/app/idXXXXXXXXX
and replace "XXXXXXXXX" with your "Apple ID" (from iTunes connect - after creating the app there).
Pay attention that those would open safari if you won't preprocess them, You could also use itms:// to open iTunes directly.
The easiest way to do this now is through iTunes Connect. Once you create an app there is a link to 'View in App Store'. Even if you haven't uploaded a binary yet you can click this link to get your App Store link.
The other answers work too but this generates your url for you. This is the URL it creates with my info removed (replace app-name and the numbers after /id with your own):
https://itunes.apple.com/us/app/app-name/id12345678?ls=1&mt=8
Once you create application in iTunes for submission under App Information tab click in View on App Store you will get app link.
Option 2: (In new update this is no longer available) you can create as below
https://itunes.apple.com/in/app/your-appname/id123456?mt=8
Note : Just replace app name and numbers after /id with your app-id in above link
Use this url example and just change your Apple ID at the end! Replace only the numbers!
https://itunes.apple.com/app/id111111111
You can find the value of your Appple ID by login into your App Store Connect and navigating to 'My Apps' under the 'App Information' -> 'General Information' -> 'Apple ID'
This url format works always and it is particularly helpful if you need the link before you publish your app
The standard URL is:
http://itunes.com/apps/yourlowercaseappname
As of today and for reference, I would say the best option is #"http://itunes.apple.com/app/%#/id%#?mt=8", inserting:
your application lowercase name,
your application ID.
In fact, this is essentially the link you can get for your application on your app's page in iTunes Connect (iTunes Connect > Manage Your Apps > Your App > View in App Store). Minus some parameters (which seems - between other unidentified things - to link to a precise country).
I thinks it's better than the itms://... one because this one redirects you to the iTunes Store on your device, which is not the App Store. You're then redirected, etc. The http://... link seems to be directly hooked to the App Store app.
I ended up using - itms://itunes.apple.com/app/id?mt=8
This seems to be what I was looking for.
Remember http://itunes.apple.com/app/id[Apple_ID] is gone. It will work for the old links and it should work fine for new ones too maybe, but to be safe use the new https://apps.apple.com/app/id[Apple_ID]
You can get application link before uploading your binary file on iTunes Connect.
You just need to upload your meta data using iTunes Connect. And after submitting these data you will get Apple ID. And by this ID you can get the URL for your application.
e.g. http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=appID
where appID="Your application ID when you submit the meta data"
Please check this. It is working here. And If you still have any problem then please let me know. I will help you out to solve the problem.
According to Apple's iTunes Connect documentation the View on App Store link is only available if at least one version of the app has had it's status set to Ready for Sale.
Having said that you can still see what the actual link will be, you just will not be able to load the page.
Best way to get app link is
login to itunes connect
Go to My Apps -> create app record if
you don't have any.
select your app -> go to App Information
section
At bottom of the page check additional information
section, there is a link called "View on App Store". Click on the
link and you will get exact URL for your app.Copy-Paste and Enjoy.
Apple has a documentation for creating easy-to-read app links. If your app name is specified, creating your links with this way is much more clear.
It seems the app id is now the Apple ID in the itunesconnect page. Go to App Information and scroll down until you see Apple ID. That is your app id.
http://itunes.apple.com/app/id[Apple_ID]
Go to https://itunesconnect.apple.com,
if not yet created, create a new App.
Open it and in the first screen (AppStore -> App information -> General) there is a field called "Apple ID" with the id number.
Copy and use it. Is this one.
If AdWords does not allow a link to iTunes, this will solve it...
If you use the link generated at the bottom of iTunesConnect, and you are selling internationally, you will find /us/ or /gb/ or /de/ etc that indicates the language of the relevant store. Adwords will not approve a link with the language indicated.
Why?
Because Adwords does not accept redirects and unmatched URLs. If the link is to the USA store, but the Adword test originates in Germany, then a redirect is detected. Of course, this behavior is correct because no matter what the link says the user will go to her local app store.
Solution: Edit the link from iTunes Connect. Strip out unneeded info. Simply match the display and final URL, disregarding any message about length in the display URL warning text.
URL copied from iTunes:
https://itunes.apple.com/us/app/this-is-my-app-name/id1111111111?ls=1&mt=8
Edited URL suitable for AdWords
DISPLAY URL
itunes.apple.com/app/id111111111
FINAL URL
http://itunes.apple.com/app/id111111111
notes:
- appstore.com is a redirect
- itunes.apple.com by itself is a redirect. Only in full as above does it go directly to your app page.
- When one URL - no matter how valid - redirects, then the result is mismatched URLs.
/gb
1- Go > https://appstoreconnect.apple.com/
2- My Apps > Select Your App
3- App Store > App Information > View On App Store
The best simple link is
http://itunes.apple.com/app/idXXXXXXXXX.
You can get id from your App Information in http://itunesconnect.apple.com.

How to Test Facebook Connect Locally

I use ASP .NET and Facebook Connect APIs. but when I run the app and press Connect button it's return to the Website not to the test local server which is (http://localhost:xxxx/test.aspx)
So how I can test Facebook locally (i.e How I can change the callback url) ?
It's simple enough when you find out.
Open /etc/hosts (unix) or C:\WINDOWS\system32\drivers\etc\hosts.
If your domain is foo.com, then add this line:
127.0.0.1 local.foo.com
When you are testing, open local.foo.com in your browser and it should work.
Edit your app at www.facebook.com/developers/ and set the "Site URL" to "http://localhost/myapppath".
When done - change it back.
Facebook has added test versions feature.
First, add a test version of your application: Create Test App
Then, change the Site URL to "http://localhost" under Website, and press Save Changes
That's all, but be careful: App ID and App Secret keys are different for the application and its test versions!
I suggest creating a test app (for dev environment only) on https://developers.facebook.com/apps and set: Website with Facebook Login property to your localhost:[port] settings.
this option will work fine with no need to change hosts.
remember to change the appId back to your production app once you go live.
Edit - in the latest fb version you'll find it under the settings tab.
You don't have to do anything difficult!
Facebook → Settings → Basic: write "localhost" in the "App
Domains" field then click on "+Add Platform" choose "Web Site".
After that, in the "Site Url" field write your localhost url (e.g.: http://localhost:1337/something).
This will allow you to test your facebook plugins locally.
Facebook seemingly randomly disables the ability to set localhost as a domain on your facebook app. I found the easiest work around was to tunnel my localhost to the web. This can be done for free using http://progrium.com/localtunnel/ or with a custom url (easier since you don't have to change url everytime in facebook) https://showoff.io
I couldn't use the other solutions... What worked for me was installing LocalTunnel.net (https://github.com/danielrmz/localtunnel-net-client), and then using the resulting url on Facebook.
Looks like FB just changed the app dev page again and added a feature called "Server IP Whitelist".
Go to your app and Select Settings -> Advanced Tab
Get your public IP (google will tell you if you google "Whats My IP")
Add your public IP to the Server IP Whitelist and click Save Changes at the bottom
go to canvas page..
view it in browser.. copy the address bar text.
now go to your facebook app
go to edit settings
in website, in site url paste that address
in facebook integration , again paste the that address in canvas url
and also the same code wherever you require canvas url or redirect url..
hope it will help..
LAST TESTED 2021/06/07
Just a few notes to complement the excellent answer of #Erdal_G with my successful experience:
Apparently, HTTPS is needed even in the local environment (I used the library https-localhost).
[I don't know if this is mandatory] create a test app from the main app (https://developers.facebook.com/docs/development/build-and-test/test-apps/)
Set the redirect OAuth URI to https://localhost:<MY_PORT>/auth/ and update also all other URIs in .../instagram-basic-display/basic-display/ settings accordingly.
Finally, don't forget to use the client-id (aka app-id) and app-secret of the test app in the requests, which are different than the parent app
Create 2 apps and
In /initializers/env_variables.rb
if Rails.env == 'development'
ENV['FB_APP_ID'] = "HERE"
ENV["FB_SECRET"] = "HERE"
else
ENV['FB_APP_ID'] = "HERE"
ENV["FB_SECRET"] = "HERE"
end