[Twitter Connector] Twitter connector on Mobile App does not work

[Twitter Connector] Twitter connector on Mobile App does not work

  
Forge Component
(3)
Published on 20 Jan by OutSystems R&D
3 votes
Published on 20 Jan by OutSystems R&D

Dear reader.


I am trying to use this connector for my mobile app, but it's showing this message: 401 Authorization Required. I used this connector in a Web App and it works! I wanna know how to fix this bug.


In the Web App it uses session, but in a mobile app we dont have those.


Thanks from Colombia.

Hi José,

In the Mobile apps world, the best approach would be to use a native Plugin or a client side integration. This Connector is a server side integration.

I don't think there is a client side integration for Twitter yet, so in the meantime if you would like to use this connector in a Mobile app you could leverage the InAppBrowser Plugin to do the authentication flow in your app. This should allow you to call the API methods using the public server actions - you shouldn't need to access any of the session variables in your Mobile app.

Note that I haven't tested this method with the Twitter Connector, but we have successfully used this approach with other server side Connectors.

Does this help? Let me know if you have additional questions.

Cheers,

Daniel

Hello!

I am trying to "adapt" the Twitter Connector available in a similar way to Daniel's answer.

I have this native plugin that does the login/logout and then I call the REST API methods with the tokens obtained.

However, I want to sign the request in a normal web action as I need the user Id in order to get the tokens from server-side DB.

As it stands right now, it seems that I can only use the "SignRequest" action inside the "OnBeforeRequestAdvanced" method, which does not accept any input parameter. When using the "SignRequest" on a normal web action, I get the "Object reference not set to an instance of an object" error.

Is there any way that I can make the "SignRequest" action work like I want to?

Hi Joana,

I'm not sure I understood your setup completely.

However, the issue of not being able to pass a user id into the ObBeforeRequest you can solve by using the UserId in the session data (GetUserId()).

Let me know if there's anything other than this blocking you and we can dig a bit deeper.

Cheers,

Daniel