movies-abcd
is my Application ID from Realm/login
path. I also added a Content-Type: application/json
header.access_token
from the response to a new app variable AccessToken
.
Finally, we move on to the rest of the app with Dismiss initial view.custom-function
authentication and a Twilio service defined on the Realm platform.startLogin
), which we can define to use a "SYSTEM" auth and method POST.startLogin
webhook URL via the Create record (POST) method, with query parameter phone
(we could also modify the code above to expect phone
as part of the request body).prefixCode
app variable and the number input to a phoneNumber
app variable. Then, we combine both to a fullPhone
app variable by executing Set app variable with a formula: phone
parameter.isSmsVisible
page variable of the type true/false and set it to have a false
initial value. By binding our input field's Visible property to our page variable, it'll be initially hidden.startLogin
API (i.e. our Create record success output triggers), we will switch the variable to true
with Set page variable.phone
and authCode
in the request body, matching them with the values stored in the previous step. If a match is found, the function returns the user's _id
to the auth provider, thereby authenticating the user and e.g. returning a valid access token.phone
and authCode
instead of email and password.authCode
, (and empty the input by setting the authCode
variable to an empty value) looping the logic all the way back to the initial part where we send the SMS.buttonLabel
page variable with initial value "Send SMS", and change it to "Login" once the SMS auth is done. We then use If condition with formulapageVars.buttonLabel == "Login"
already evaluates to true
or false
.)isSmsVisible
variable and bind the button label to a formula:mongodb-atlas
instance, we can use any of the availble CRUD commands, including the aggregation framework. Then we can respond with this array of documents or a single document back to our application.MoviesAPI
and an incoming webhook on method GET
. Since our API is public for all our users I have used a SYSTEM authentication and toggled the "Response with Result" on.MovieSearchApp
on our movies list page. By default, the logic fetches new data every 5 seconds, executing the API call with whatever the input arguments currently are – you can see and modify this logic by opening the logic canvas for the data variable from the bottom of the screen.
We define a SearchTerm
page variable and bind it to the data variable's Search input and a search field on our page. Now, whatever the user inputs in the search field gets stored in the variable, and when the data variable refresh loop triggers again, a new API call gets made with the updated search term.title
, plot
, rating
etc). For some properties, I used a formula to mangle the data into the correct format.UpsertComment
, defined in MongoDB Realm.id
, movieId
and commentText
.