Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 31    Views: 246

SSBigie
I hate code!
Profile
Posts: 8
Reg: Nov 23, 2011
Southside
80
06/08/12 03:32 PM (13 years ago)

Installing Socialize?

Does anyone know how/if Socialize works in either the iOS or Android versions of BT apps? If so, how can I add Socialize into my app? First time developer here and really interested in a response! Thanks for any help!
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/08/12 09:48 PM (13 years ago)
Hi SSBigie, believe me i was about to post the same question today on bt. But i saw you already posted it here. I have been trying to implement socialize in my android app BT v1.5 and 2.0 since last couple of days. But am facing lot of difficulties as well. I have seen a bt app on google play which has implemented socialize with success. That app is bt v 1.4 and name of that app is "Shipit" having some courier service information. So i think there is some way or other to implement socialize to bt apps. So i will keep trying to work on it for few more days and inform you if i get any success.
 
manutd
Aspiring developer
Profile
Posts: 33
Reg: Apr 21, 2011
California
2,280
like
06/08/12 10:59 PM (13 years ago)
I just tried it and it turned out to be very simple than i expected it to be. Follow the instructions at http://socialize.github.com/socialize-sdk-ios/getting_started.html#installing-the-sdk For BT customization....Do the following as part of Step 4 in the above guide 1. Add the following code to the appDelegate.m file in BT code. //import the socialize header #import <Socialize/Socialize.h> #pragma mark - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { // set the socialize api key and secret, register your app here: http://www.getsocialize.com/apps/ [Socialize storeConsumerKey:@"SOCIALIZE_CONSUMER_KEY"]; [Socialize storeConsumerSecret:@"SOCIALIZE_CONSUMER_SECRET"]; //your application specific code return YES; } 2. Enter the SOCIALIZE_CONSUMER_KEY and SECRET key above from the socialize account where you would have created your app. 3. Go to BT_viewController.h and add the following code which is enclosed in #ifndef SOCIALIZE. I have included the existing code below just to make it clear where we need to add the new code. #ifndef SOCIALIZE #import <Socialize/Socialize.h> #endif @interface BT_viewController : UIViewController <UIAlertViewDelegate, ADBannerViewDelegate>{ BT_item *screenData; UIView *progressView; /* iAd Views */ UIView *adView; id adBannerView; BOOL adBannerViewIsVisible; BOOL hasStatusBar; BOOL hasNavBar; BOOL hasToolBar; #ifndef SOCIALIZE SocializeActionBar *actionBar; #endif } @property (nonatomic) BOOL hasToolBar; #ifndef SOCIALIZE @property (nonatomic, retain) SocializeActionBar *actionBar; #endif 4. Go to BT_viewController.c file and do the following @synthesize hasStatusBar, hasNavBar, hasToolBar; #ifndef SOCIALIZE @synthesize actionBar; #endif //initWithScreenData -(id)initWithScreenData:(BT_item *)theScreenData{ if((self = [super init])){ [BT_debugger showIt:self:@"INIT"]; //set screen data [self setScreenData:theScreenData]; } #ifndef SOCIALIZE if (self.actionBar == nil) { self.actionBar = [SocializeActionBar actionBarWithKey:@"http://www.example.com/object/1234" name:@"Something" presentModalInController:self]; [self.view addSubview:self.actionBar.view]; } #endif return self; } Compile the code and thats it....You should see the socialize Action bar at the bottom of every view of your app..... Hope this helps....
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/08/12 11:17 PM (13 years ago)
@manutd thanks for the instructions. But mate, i am seeking help for android. I will go to the github page and see the code and try to implement it and tell you the results.
 
Mike the App Guy
Lost but trying
Profile
Posts: 435
Reg: Sep 19, 2011
Birmingham, Ala...
5,900
like
06/09/12 07:20 AM (13 years ago)
Android video by Socialize right here: http://blog.getsocialize.com/implementing-the-socialize-sdk Looks really easy, except that last little part where he makes some changes inside Eclipse. I'll be trying to put it in a simple menu list screen, so I'll adjust to put it there, and just hope I can figure out all those changes he made in the video around 7 minutes.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/09/12 11:49 AM (13 years ago)
@Daniel LaRusso yes the tut is really very easy but have you tried to implement it on bt apps? Its not that easy installing it on bt.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/11/12 10:19 AM (13 years ago)
@Sevens, no problem with that at all. Take your time coz i am not in any hurry. I am answering in numbered bullet fashion according to your questions so that even other will get some insight on it. 1. Are you using IOS or Android? Ans. I am using Android BT 1.5 and 2.0. 2. Have you placed the lines of code in each individual view? Ans. I did not get what you exactly mean by saying "each individual view". I am posting the code i have put in my BT_activity_base.java file here so that you could see and know where i have put that code. I have imported these imports import com.socialize.Socialize; import com.socialize.entity.Entity; and put the code just below the line no. 154 which runs as follows: //content view for "base" activity is emtpy (it must be set before sub-classes can set another content view) setContentView(R.layout.act_base); So my code looks like this in full from the onCreate method. //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); AndroidSDKProvider.initSDK(this); //remember this activity... thisActivity = this; //create handler reportToCloudWorkerThread... reportToCloudHandler = new Handler(); //create handler to configure backgrounds... backgroundImageWorkerHandler = new Handler(); /* * set the screenData for this screen BEFORE setting the content view... * If this Activity was started with passed-in payload then we started it from * BT_activity_root when a tab was created. In this we use that tabs * home-screen data and not the rootApp.currentScreenData. This is because the * rootApp.currentScreenData property has not been set yet. */ Intent startedFromIntent = getIntent(); int tabIndex = startedFromIntent.getIntExtra("tabIndex", -1); if(tabIndex > -1){ //get this tabs home-screen data if(tabIndex == 0) this.screenData = motorvehiclelawinindia_appDelegate.rootApp.getTab0ScreenData(); if(tabIndex == 1) this.screenData = motorvehiclelawinindia_appDelegate.rootApp.getTab1ScreenData(); if(tabIndex == 2) this.screenData = motorvehiclelawinindia_appDelegate.rootApp.getTab2ScreenData(); if(tabIndex == 3) this.screenData = motorvehiclelawinindia_appDelegate.rootApp.getTab3ScreenData(); if(tabIndex == 4) this.screenData = motorvehiclelawinindia_appDelegate.rootApp.getTab4ScreenData(); }else{ //set the screen data.. this.screenData = motorvehiclelawinindia_appDelegate.rootApp.getCurrentScreenData(); //because we are not in the root of a tab we can adjust the status bar dynamically... requestWindowFeature(Window.FEATURE_NO_TITLE); String statusBarStyle = BT_strings.getStyleValueForScreen(this.screenData, "statusBarStyle", ""); if(statusBarStyle.equalsIgnoreCase("hidden")){ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); }else{ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } } //content view for "base" activity is emtpy (it must be set before sub-classes can set another content view) setContentView(R.layout.act_base); // Your entity key. May be passed as a Bundle parameter to your activity String entityKey = "http://www.getsocialize.com"; // Create an entity object including a name // The Entity object is Serializable, so you could also store the whole object in the Intent Entity entity = Entity.newInstance(entityKey, "Socialize"); // Wrap your existing view with the action bar. // your_layout refers to the resource ID of your current layout. View actionBarWrapped = Socialize.getSocializeUI().showActionBar(this, R.layout.act_base, entity); // Now set the view for your activity to be the wrapped view. setContentView(actionBarWrapped); I have also created a configuration file in the assets path of your project called socialize.properties file and entered my Socialize consumer key and secret in it. 3. Have you signed up for accounts with facebook, twitter? Ans. I have signed up for api with facebook but i failed to obtain the key hash from the steps they have provided. Its really tough thing to do. But that is not my immediate concern. At present i am fine with the other options on socialize action bar. 4. There is redundancy in the way my app uses the sharing abilities. I chose to allow sharing thru buzz touch plugins and thru socialize. The reason is that if there is an issue with socialize, I can still have sharing while repairing. Ans. I have not used any bt plugins other than those are available in the bt control panel. Actually i can say that i have applied the socialize sdk in my app with certain amount of success. The activity bar shows up in my app perfectly but the problem i am having is that my home screen does not scroll to the list below. and the html doc screens nav bar gets scrolled up when i scroll the page down. other than that i have no other problem. I will post the apk file on drop box so that you can have a better look at my app and know what the issue exactly is. Thanks again for your support.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/11/12 10:36 AM (13 years ago)
Ok here goes the apk file i have posted in my dropbox. https://dl.dropbox.com/u/61663890/Motor%20Vehicle%20Laws.apk
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 01:08 PM (13 years ago)
OK. When I get to my laptop I will look at this. It was mentioned to me that I had to place the method in each BT_screen.java that I wanted socialize to operate in.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/18/12 06:12 AM (13 years ago)
Hello friends, The new version of socialize sdk is out and i downloaded the same and implemented it on my app. now the action bar works really like charm. All i had to do was fix the issue of scrolling by adding three lines of code in BT_activity_vase.java file which runs as under. // Add more options ActionBarOptions options = new ActionBarOptions(); options.setAddScrollView(false); // Disable scroll view
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
06/28/12 09:53 AM (13 years ago)
@Manutd, Would you be able to provide us with some screen shots of where you inserted the above IOS Socialize codes. Getting a bit confused on where to insert. Thanks Anthony
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/28/12 09:57 AM (13 years ago)
Hi Sandeep, Do you have menu lists in the app working with the non scrolling socialize toolbar? Socialize won't work for any screen with a menu list for me.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/28/12 10:01 AM (13 years ago)
@Sevens I have a tabbed layout which contains menu list on the home screen. What problem do you face exactly? If i am correct it might be that the menu might be not scrolling. Am i correct?
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/28/12 10:03 AM (13 years ago)
Yup. Menu is not scrolling.
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/28/12 10:04 AM (13 years ago)
Where did u place action bar options?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/28/12 10:06 AM (13 years ago)
Thats what i thought. Actually there is one trick to stop this problem. The action bar starts scrolling when we press on menu list so we think that the menu list is not scrolling. The trick is to set the actionbar not to scroll. Putting code of just two line solves this problem. Just wait a few minutes till i post that code.
 
Mike the App Guy
Lost but trying
Profile
Posts: 435
Reg: Sep 19, 2011
Birmingham, Ala...
5,900
like
06/28/12 10:10 AM (13 years ago)
@manutd thank you, will be trying this in Xcode today
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/28/12 10:12 AM (13 years ago)
@Sevens- Now this is the code which we normally put in our BT_act_base.java file:- // Your entity key. May be passed as a Bundle parameter to your activity String entityKey = "http://www.getsocialize.com"; // Create an entity object including a name // The Entity object is Serializable, so you could also store the whole object in the Intent Entity entity = Entity.newInstance(entityKey, "Socialize"); // Wrap your existing view with the action bar. // your_layout refers to the resource ID of your current layout. View actionBarWrapped = ActionBarUtils.showActionBar(this, R.layout.act_base, entity, options); // Now set the view for your activity to be the wrapped view. setContentView(actionBarWrapped); Now we have to add this code in order to stop the action bar from scrolling:- // Add more options ActionBarOptions options = new ActionBarOptions(); options.setAddScrollView(false); // Disable scroll view After putting this code the whole code should look like this:- // Your entity key. May be passed as a Bundle parameter to your activity String entityKey = "http://www.getsocialize.com"; // Create an entity object including a name // The Entity object is Serializable, so you could also store the whole object in the Intent Entity entity = Entity.newInstance(entityKey, "Socialize"); // Add more options ActionBarOptions options = new ActionBarOptions(); options.setAddScrollView(false); // Disable scroll view // Wrap your existing view with the action bar. // your_layout refers to the resource ID of your current layout. View actionBarWrapped = ActionBarUtils.showActionBar(this, R.layout.act_base, entity, options); // Now set the view for your activity to be the wrapped view. setContentView(actionBarWrapped); I think this should help you in solving this problem.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/28/12 10:19 AM (13 years ago)
@Sevens- I have put the action bar in BT_act_base.java file so that it appears on all screens in my app. You can check my app on play store if you want. Here is the link for it. https://play.google.com/store/apps/details?id=com.motorvehiclelawinindia&feature=more_from_developer#?t=W251bGwsMSwxLDEwMiwiY29tLm1vdG9ydmVoaWNsZWxhd2luaW5kaWEiXQ..
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/28/12 10:28 AM (13 years ago)
Great. Attempting now. Have you created any entities to allow for GCM.... or C2DM?
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/28/12 10:31 AM (13 years ago)
@Sevens- No i havent created any entities yet mostly due to lack of knowledge and scarcity of time. I would be grateful if you throw some light on how to set an entity for notifications using the GCM.
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/28/12 10:33 AM (13 years ago)
It would be the blind leading the blind. I'm getting help from the employees at socialize but I wouldn't be able to explain yet. When they help me I'll relay the info.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
06/28/12 10:35 AM (13 years ago)
Lol. Its okay, i can wait. That would be really helpful.
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
06/28/12 11:11 AM (13 years ago)
Has anyone implemented this into an IOS application yet?
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/28/12 11:14 AM (13 years ago)
Android Lover here. A few IOS examples are on www.getsocialize.com
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
07/02/12 12:12 PM (13 years ago)
GUYS WE DID IT. We got the attention of the CEO of Socialize! He is in this post. I know its redundant to have 2 posts about Socialize but I had to make a new name to grab his attention. Post your questions here. http://www.buzztouch.com/forum/thread.php?tid=636C21D83FA0566EE3B72BD Very Respectfully, Sevens
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
07/07/12 05:07 AM (13 years ago)
Any iOS users get the Smart Alerts working?
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
07/15/12 05:04 AM (13 years ago)
@ Daniel LaRusso/ manutd Thanks for the tutorial. somehow I got an error when I add the following code to the appDelegate.m file in BT code. #pragma mark - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { // set the socialize api key and secret, register your app here: http://www.getsocialize.com/apps/ [Socialize storeConsumerKey:@"SOCIALIZE_CONSUMER_KEY"]; [Socialize storeConsumerSecret:@"SOCIALIZE_CONSUMER_SECRET"]; Xcode shown error: missing context for method declaration [3] Any idea? Cheers
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
07/15/12 05:34 AM (13 years ago)
@ Daniel LaRusso/ manutd Thanks for the tutorial. somehow I got an error when I add the following code to the appDelegate.m file in BT code. #pragma mark - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { // set the socialize api key and secret, register your app here: http://www.getsocialize.com/apps/ [Socialize storeConsumerKey:@"SOCIALIZE_CONSUMER_KEY"]; [Socialize storeConsumerSecret:@"SOCIALIZE_CONSUMER_SECRET"]; Xcode shown error: missing context for method declaration [3] Any idea? Cheers
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
07/15/12 05:48 PM (13 years ago)
Cyrus. Getting same thing. Running 9 errors. This is a mess trying to implement this code.
 
aquila198
buzztouch Evangelist
Profile
Posts: 473
Reg: Jul 22, 2011
location unknow...
10,330
like
08/08/12 08:25 AM (13 years ago)
Is it possible that my apps do not contain: BT_viewController.c file? I'm unable to locate this & move on to step 4. >>4. Go to BT_viewController.c file and do the following Any ideas? I checked out other past apps and wasn't able to find the '.c' file anywhere. Thanks~
 
aquila198
buzztouch Evangelist
Profile
Posts: 473
Reg: Jul 22, 2011
location unknow...
10,330
like
08/08/12 08:36 AM (13 years ago)
(double refresh post)
 

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.