Hi,
I’m writing an android/iOS app that points to my discourse instance.
This is the scenario:
When the mobile app starts for the first time I create a user on my discourse instance by calling the API by setting active=true. the user should be already active (without needing to activate again it by email)
I store username and password in the mobile app after successfull creation.
When the app starts I want to automatically login the user to discourse and show him the home page with the login done.
I read your suggested post. I’m in use case 2: Mobile applications that poll Discourse sites on behalf of end users and handles push notifications.
But I don’t understand how to use this new feature in my app.
These are my requirements:
I put in the app a WebView that displays my discourse instance as is (I don’t want to write an app from scratch by using the API like the one I saw on GitHub);
The first time the app starts I create a new user linked to the user’s mobile phone ID. The user must be active i.e. no needs for confirmation email;
I store username and password (and any other info and keys) in the app memory (in the sandbox);
From now on every time the app starts the WebView must show my discourse instance already logged in using stored username and passwor, i.e. I don’t want to show the login panel to the user every time he runs the app.
Can you explain me how to use it in my app to satisfy my requirements?
BTW I know that API keys must not shipped in the app. There are several ways to avoid from that