Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing Storyboards #27

Closed
Ranjith08 opened this issue Apr 10, 2017 · 8 comments
Closed

Editing Storyboards #27

Ranjith08 opened this issue Apr 10, 2017 · 8 comments

Comments

@Ranjith08
Copy link

I'm trying to remove social media login functions from the storyboards but they keep appearing on the simulator even after removing them. Tried deleting and running the project again no luck.

@simonsmiley64
Copy link
Contributor

Hi @Ranjith08,

Just checking you mean the XIB files and not storyboards? The Chat SDK only uses a storyboard screen for the profile view.

The social media buttons are designed to only be visible if there are detailed entered into the app plist. This means if you don't set up the social media account it will automatically not be visible.

You can see the code for this in the BLoginViewController.m:

    self.facebookButton.enabled = [[BNetworkManager sharedManager].a.auth accountTypeEnabled:bAccountTypeFacebook];
    self.twitterButton.enabled = [[BNetworkManager sharedManager].a.auth accountTypeEnabled:bAccountTypeTwitter];
    self.googleButton.enabled = [[BNetworkManager sharedManager].a.auth accountTypeEnabled:bAccountTypeGoogle];
    self.anonymousButton.enabled = [[BNetworkManager sharedManager].a.auth accountTypeEnabled:bAccountTypeAnonymous];

If you click down into this function you can see how it works:

    -(BOOL) accountTypeEnabled: (bAccountType) accountType

Each time we check whether there is the social media API key added to the plist. For anonymous this needs to be set to NO.

Hopefully this helps.

Let me know if you continue to have issue with this,

Simon

@Ranjith08
Copy link
Author

@simonsmiley64 Thanks for the reply, I have removed the code as i only wanted the Facebook button. However, the icons are still present in the XIB files while running the simulator. I tried changing the color of the LoginViewController to see if changes are being made. But no changes are being applied to XIB files.

@simonsmiley64
Copy link
Contributor

Hi @Ranjith08,

I have done a bit of testing and have managed to remove the social media buttons. There are two ways to do this:

  1. Hide the buttons:

In the BLoginViewController.m you need to comment out the below code and instead set the buttons to hidden:

    //self.twitterButton.enabled = [[BNetworkManager sharedManager].a.auth accountTypeEnabled:bAccountTypeTwitter];
    self.twitterButton.hidden = YES; 

This will hide the button effectively removing it.

  1. Remove the buttons

In the BLoginViewController.XIB you can delete the buttons. This would require you to make sure other code wasn't broken and is not a recommended solution.

Hopefully the first point solves your problem.

Simon

@Ranjith08
Copy link
Author

Hi @simonsmiley64 Thanks for the two solutions, I tried both and the first one works perfectly. However, moving the other buttons to update constraints or changing label names terminates the application when the login button is pressed. I'm trying to change the login view to look different and any changes made in the XIB files, crashes the application.

@simonsmiley64
Copy link
Contributor

Hi @Ranjith08,

This shouldn't be the case. The location and label on the login button has no affect on its functionality. For example in the below image I have changed all the labels and also modified the constraints of some of the social media buttons. This still works as expected:

screen shot 2017-04-12 at 14 32 13

I would recommend the following:

  • First, find out why the app is crashing. It might be worth either downloading a new version or removing any changes you have made.
  • Next, make sure the login and register buttons are working as expected.
  • Now, move a single button, resize it and ensure the constraints are correct.
  • Rinse and repeat for all the buttons

This functionality should be easy to modify. If you are having continued trouble we do offer priority support and have experience in modifying the login page of the Chat SDK:

login-pages

If you can let me know with more detail the changes you have made I might be able to find the issue more easily.

Simon

@Ranjith08
Copy link
Author

I made changes to the title ChatSDK removed the icon and removed terms and conditions. It crashes and now linking Facebook comes up with internal error. I tried repeating the steps on fresh clone of the project and it keeps happening.

@bensmiley
Copy link
Contributor

Can you lets us know the exact steps you're taking and post the error that's appearing? Generally speaking, it's better to move and hide the elements of the XIB file rather than removing them. Equally, you shouldn't remove any properties from the controller file because if the XIB has links to those outlets, the app will crash.

We can only provide limited support with this issue because it's an issue with customization rather than with the Chat SDK. If you want us to make the changes for you or if you want 1-to-1 support over Skype you should buy some support hours.

@simonsmiley64
Copy link
Contributor

Hi @Ranjith08,

I loaded up version, deleted everything but the Facebook button from the XIB and changed the title and it all compiled. The problem seems like it is caused by the Facebook login.

  1. Have you changed anything else (linked the project to your own Firebase account?) if you have you'll need to configure Facebook.
  2. Have you changed the BundleID?
  3. Have you deleted any code anywhere?

I would recommend going through the steps you made one by one and testing each step. For example delete the Twitter button and check the Facebook still works. Then change the title. This should let you know which change is breaking the code.

Hope this helps,

Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants