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

Login window customisation, Do not allow signup? #237

Closed
gazzer82 opened this issue Mar 21, 2014 · 6 comments
Closed

Login window customisation, Do not allow signup? #237

gazzer82 opened this issue Mar 21, 2014 · 6 comments

Comments

@gazzer82
Copy link

I am using the latest dev build in my iOS app, and i would like to restrict the ability for users to sign up and only allow login, before i start hacking into the code, is there a way to do this that's built in?

I would also like to customise the colour of the login window text, again, is this possible using anything built in, or do i need to modify the code?

Was hoping i could do it using delete methods so i don't have to re-do the mods every time i update the framework.

Thanks

Gareth

@jleandroperez
Copy link
Contributor

Hello @gazzer82,

You can fully customize the screens by subclassing SPAuthenticationViewController.h, and mapping the authenticationViewControllerClass / authenticationWindowControllerClass properties to your own subclass (see: https://github.com/Simperium/simperium-ios/blob/develop/Simperium/Simperium.h#L189).

There, you should be able to override the behavior in any required way.

Please, let me know if i can further assist you with anything related!

@gazzer82
Copy link
Author

Hi @jleandroperez i will look into this, makes sense.

Where is the logic that decides whether to display the login or signup view to the user located?

Thanks

Gareth

@jleandroperez
Copy link
Contributor

@gazzer82 the entire sign-in vs sign-up logic is handled by means of the 'signingIn' property (Ref: https://github.com/Simperium/simperium-ios/blob/develop/Simperium/SPAuthenticationViewController.h#L27)

You could potentially hack the setter, so it's always stuck in 'Sign In Mode' (See: https://github.com/Simperium/simperium-ios/blob/develop/Simperium/SPAuthenticationViewController.m#L76).

Plus, hiding the 'Change' button, so there is no signup-toggle option (Ref.: https://github.com/Simperium/simperium-ios/blob/develop/Simperium/SPAuthenticationViewController.m#L169)

Those changes feel a bit hacky, but i'd say it's the super quickest way to nuke Signup.

@gazzer82
Copy link
Author

Hi @jleandroperez i have managed to "hack" the flow to enable this, but yes, i think some sort of delegate method to set these sort of things might be useful in the future?

@jleandroperez
Copy link
Contributor

@gazzer82 although the only way to customize the auth screens is subclassing (for now) we definitely plan to add several options, so this could be easily solved by flipping a couple flags.

Ref. Issue #162

Let's add this requirement there!

@jleandroperez
Copy link
Contributor

If you're still having any issues or doubts, please, feel free to reopen this.

Thanks!

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

2 participants