OAuth user login

This is an example about how you can use topoos OAuth 2.0 identification in your app by using topoos iOS SDK.

Create a project in iOS, insert SDK_topoos and read the following guide.

Storyboard Design:

  • Create a navigation controller with a view with a button that we use to go to login topoos.

  • Create a new view of LoginTopoosController with WebView inside.

  • WVLogin variable must be associated WebView

  • Connect the button created with login activity using push. You need to define a handle to the created connection.

  • Example:


  • In the controller from which you started the login include <SDKtopoos/LoginTopoosController.h> between class import.
  • In this controller is necessary to define the method. PrepareForSegue where we define the client id of the apliciĆ³n. In the picture we see the complete code.
  • You must replace “OurAppClientID” by the Client Id of your application.
  • Example:
    #import "ViewController.h"
    #import "<SDKtopoos/LoginTopoosController.h>"
    @interface ViewControler ()
    @implementation ViewController
    - (void) viewDidLoad
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
    - (void) didReceiveMemoryWarning
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    - (void) prepareForSegue: (UIStoryboardSegue *)segue sender:(id)sender
        if ([[segue identifier] isEqualToString:@"ToLogin"])
            [LoginTopoosController class];
            LoginTopoosController *upcomingViewController = [segue destinationViewController];
            [upcomingViewController setClient_id:@"OurAppClientID"];