Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 120

awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
09/24/12 11:55 PM (13 years ago)

Socialize last step for facebook authentication?

hey guys, i'm kinda lost with the last step for the facebook authentication feature. "And lastly, you must be sure to call [Socialize handleOpenURL:url] from your UIApplicationDelegate’s application:openURL:sourceApplication: method. Socialize will take care of handing off the openURL request to the underlying Facebook iOS SDK. This completes the authentication flow." Where do you insert this code - [Socialize handleOpenURL:url]? I've made everything work smooth so far except for that last step! :(
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
09/24/12 11:56 PM (13 years ago)
NEVERMIND! FIGURED IT OUT! LOL
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
09/25/12 04:39 AM (13 years ago)
Where exactly did you put this code? in the appdelegate file? where??
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
09/25/12 04:44 AM (13 years ago)
Where exactly did you put this code? in the appdelegate file? where??
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
09/25/12 12:04 PM (13 years ago)
Hello mutzy. here's what i did: 1. declared the method "- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;" in the appdelegate.h file 2. inserted the whole code "- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [Socialize handleOpenURL:url]; }" in the appdelegate.m just before the dealloc method (at the bottom) hope that helps!
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
11/19/12 07:38 AM (13 years ago)
Hello all, I have a question regarding the integration of Socialize and the calling of Facebook within the app. (Apologies for hijacking the thread, thought it made more sense to post here than start anew). I have Socialize working lovely (calling in the HTML screens only within the app). Followed all the dev guides from Socialize and the many threads on BT. I have the Twitter function working, my problem is with FB. When I click to share, the app opens the FB login in a browser, rather than in app (like Twitter). Worse, no data fills the screen. It's completely blank. I've followed all the steps exactly apart from this.. (and I'm sure this is where the problem lies). The Socialize instructions request... "And lastly, you must be sure to call [Socialize handleOpenURL:url] from your UIApplicationDelegate’s application:openURL:sourceApplication: method. Socialize will take care of handing off the openURL request to the underlying Facebook iOS SDK. This completes the authentication flow." Then there is a screen shot of the following code: "#import <Socialize/Socialize.h> - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [Socialize handleOpenURL:url]; }" I've declared and pasted the code as described by @awesomematt, but the same issue arises. Any help is much appreciated.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
11/19/12 10:37 AM (13 years ago)
Sounds like you did the first step in their guide (see link below)... http://socialize.github.com/socialize-sdk-ios/facebook.html ... but did you the other part where you had the facebook url to your xcode project? here's the pic from their guide: http://socialize.github.com/socialize-sdk-ios/images/facebook_urltypes.png
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
11/19/12 12:36 PM (13 years ago)
Hey guys. First of all, just wanted to thank Awesomematt for the detailed instruction. The code placing is word-perfect. Mutzy, I followed their instructions "to the letter". In my infinite wisdom, I read the url field to mean "put fb followed by the app id generated in the socialize dashboard" not, as is the correct way, fb followed by the app id generated by facebook itself. Got it now, thanks alone to the excellent BT community.
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
11/20/12 02:51 AM (13 years ago)
Morning, I'm quite obsessed by making Socialize do what I want! I thought I'd post here first rather than start a new thread... Does anyone know how to change the share text when the user posts to FB and Twitter? I'd rather it said something custom than the standard and I'd like to make it app specific. After I've done this, I'm going to take on Push. And Push scares me.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
11/20/12 06:11 AM (13 years ago)
Jimmy, I don't know how to do this but saw this on the socialize forum: http://support.getsocialize.com/socialize/topics/how_to_customize_share_text If that doesn't help I suggest posting something on their forum. Good luck!
 
FromtheNE
Aspiring developer
Profile
Posts: 47
Reg: Sep 02, 2012
MA
3,220
like
11/23/12 09:26 PM (13 years ago)
Great info here. I have integrated the socialize action bar following this and other tutorials and posts (thanks mutzy) and I now cannot find a way to create a facebook app id to include in Xcode. Not sure if the developer facebook site changed but now there is no option to "create app" or register an app. Any time I click on "apps" from the facebook developer page it takes me right to the page I created for my iOS app (surf shreds). Can anyone please help? I know this should be simple but is giving me fits. thanks
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
11/24/12 05:27 AM (13 years ago)
I just went to the FB developer page and clicked on the apps link and it brought me to a page with my FB app. But look at the top right of the screen and you should see your name and picture and rIght below that are two buttons... one to edit your app and one to create a new app. Just click create a new app.
 
FromtheNE
Aspiring developer
Profile
Posts: 47
Reg: Sep 02, 2012
MA
3,220
like
11/24/12 05:39 AM (13 years ago)
Thanks...I figured out the issue was that I was logged into the facebook profile only for the "page" I created for my app in facebook, as opposed to a facebook "user" (I didn't have an individual account). When I first registered I created the page for a business option but not as individual. thanks!
 
FromtheNE
Aspiring developer
Profile
Posts: 47
Reg: Sep 02, 2012
MA
3,220
like
11/25/12 05:35 AM (13 years ago)
One more question - in declaring the method in the appdelegate.h file as described in #1 above, does it matter where this code goes? I placed at the end of the .h and having some issues but I think it is due to something else. The app runs great in the simulator but crashes at start on my device every time. Crash log shows "exc_crash (sigabrt)" so I'm trying to clean everything and start a new build. If it continues I will post in the main forum as I can't seem to be able to fix. Any help is appreciated - thanks
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
11/25/12 05:54 AM (13 years ago)
Hey @FromtheNE It's called in the .m delegate file (or, it is mine and it works on the device). I placed it at the end of the code, just before dealloc wording. Looks like this.... "..... return mask; } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [Socialize handleOpenURL:url]; } //dealloc......" etc. Good luck!
 
FromtheNE
Aspiring developer
Profile
Posts: 47
Reg: Sep 02, 2012
MA
3,220
like
11/25/12 06:17 AM (13 years ago)
Thanks for the response - I think I got that for the .m file. In awesomatt's post above (5th post in thread) he also mentions as #1 declaring the method with code in the appdelegate.h file. Did you also do this as well? thanks
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
11/25/12 06:30 AM (13 years ago)
Ah yes, my mistake. I only wanted to integrate the socliaze bar on my htmldoc screens (so there's no code in my delegate.h file). I did have to call something in my .h file of the plugin's file though. I'm no expert on this (in any way shape or form!) so, I've copied the code from my plugin's .h file (which is working) and the delegate .h file (for comparison purposes). The document is here:https://docs.google.com/open?id=0B7z8VO2FDWLGbVJjVlNpZkNtdjA Hopefully, you'll figure it out from there as to where to put the code and instigate the bar across the whole of the app. Let me know how you get on.
 
FromtheNE
Aspiring developer
Profile
Posts: 47
Reg: Sep 02, 2012
MA
3,220
like
11/25/12 06:37 AM (13 years ago)
That clarifies - perfect. I had the same in my plugin and delegate .h files. Still having the crash issue but I think it's unrelated to this b/c socialize is working great in the simulator.
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
11/25/12 06:47 AM (13 years ago)
Bummer. Alas, that's my knowledge bank exhausted I'm afraid.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.