API call method :

import { authorize } from 'react-native-app-auth'

const config = {
    redirectUrl: 'com.redditech://oauth2redirect/reddit',
    clientId: 'fcafYt6_OhrlQEN6NTTyUQ',
    clientSecret: '',
    scopes: ['identity', 'edit', 'subscribe', 'save', 'submit', 'read', 'modconfig', 'account', 'vote', 'flair', 'mysubreddits'],
    serviceConfiguration: {
        authorizationEndpoint: '',
        tokenEndpoint: '',
    customHeaders: {
        token: {
            Authorization: 'Basic ZmNhZll0Nl9PaHJsUUVONk5UVHlVUQ==',

const Auth = useCallback(
    async call => {
        try {
            const authState = await authorize(config);
        } catch(e) {

This returns the user token which we needs to get the user’s information, subscribed subreddits, settings…

Knowing the token we can now use reddit’s api to call the user information for exemple

const options = {
    method: 'GET',
    url: '',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        Authorization: "Bearer " + global.Token,

We can also use the API without needing the the token, we can for exemple get the top post on reddit like this

const options = {
        method: 'GET',
        url: '' + 'top' + '.json',

Now to get the output we need in json, after adding options we are going to do an axios call

axios.request(options).then(function (res) {
}).catch(function (error) {

We are now outputing in the console the content from our GET call from the API

Having this we can use a UseState to keep it and call it later

const [User, setUser] = useState(
    { all: null }

For the rest of the application we just use the different api call listed in the reddit documentation listed here :


In our application we only have a topbar with a Home, Profile & Search button. The rest of the navigation is used in the content of the application like if you click on the subreddit name on post you will be redirected to the subreddit.

We are using stacks for naigation from react-navigation

<Stack.Screen name="Search" component={Search} />
<Stack.Screen name="Settings" component={Settings} />
<Stack.Screen name="Connection" component={Connection} />
<Stack.Screen name="Subreddit" component={Subreddit} options={{
  headerTintColor: '#fff',
  headerTitleStyle: {
    fontWeight: 'bold',
  }, headerStyle: { backgroundColor: '#ffa31a' }
}} />

Here we have multiple Stacks (each representing one file), we can also see that some stacks have specific values added to them for the Front

To call those different Stacks in app we mostly use onPress like this

onPress={() => navigation.navigate('Search')}

A diagram to show how the stacks works



We used different libraries :

  • axios
    • Call API
  • react-native-app-auth
    • Connection to Reddit
  • react-navigation
    • Create Stack Navigator


Regarding the Front of our application we first got inspired by PornHub Colors and Logo. We decided to use their orange, our 3 colors are

Orange: #ffa31a
Black: #000000
White: #ffffff

and our logo:


For the UI we have as I said a TopBar with 3 buttons, on the Home page where we have the feed on the bottom left we have a button to choose how we want to filter our feed.


Our UX is straight forward and simple to understand and use :

  • Only 4 Button on the home page
    • Filters
    • Home
    • Search
    • Profile
  • Only one fuctionnality per page


We used different libraries :

  • react-native-elements
    • Buttons / Icons / FAB / Card
  • react-native-paper
    • Searchbar


View Github