Stellaxius Knowledge Center
  • Home
  • About Us
    • Our Team
    • Our Responsibility
      • Equality
    • Certifications
  • Services
    • Salesforce Consulting and Implementation
    • Salesforce Assessment
    • Software Development and Systems Integration
    • Process and Business Analysis
    • Program and Project Management
    • MuleSoft Integration
    • Data & Analytics
  • Success Stories
  • Careers
  • Blog
Contact us
Blog Home
Blog Categories:
  • Salesforce
    • CPQ
    • Net Zero Cloud
    • Release Notes
    • Sales Cloud
    • Salesforce Certifications
    • Service Cloud
  • Analytics &
    AI
    • Data Analysis
    • Einstein
  • Business Analysis &
    Implementation
  • Integration &
    Mulesoft
  • Marketing
    • Account Engagement
      (Pardot)
    • Marketing Automation
  • People &
    Culture
    • Human resources
    • Social Responsibility
  • Development
No Result
View All Result
Blog Home
Blog Categories:
  • Salesforce
    • CPQ
    • Net Zero Cloud
    • Release Notes
    • Sales Cloud
    • Salesforce Certifications
    • Service Cloud
  • Analytics &
    AI
    • Data Analysis
    • Einstein
  • Business Analysis &
    Implementation
  • Integration &
    Mulesoft
  • Marketing
    • Account Engagement
      (Pardot)
    • Marketing Automation
  • People &
    Culture
    • Human resources
    • Social Responsibility
  • Development
No Result
View All Result
Stellaxius Knowledge Center
Home Development

Unleash the Power of Salesforce Mobile with React-Native

In this article, I will introduce you to React-Native technology and explain how Salesforce benefits from it! I will also cover several technologies related to Salesforce Mobile and React-Native, such as: Forcereact, NodeJS, IOS, and Android.

Orlando AgostinhobyOrlando Agostinho
24th September 2019 - Updated on 13th March 2023
in Development, Salesforce
0
A A
0
Unleash the Power of Salesforce Mobile with React-Native
18
SHARES
1.8k
VIEWS
Share on LinkedInShare on XShare on FacebookShare on Whatsapp

What is React-Native?

As you know, it’s possible to create native apps in Android and iOS, using native programming languages to write your code. Alternatively, it is also possible to create hybrid apps that run in both Android and iOS, written in JavaScript, CSS, and HTML. Hybrid apps run in a web view container that provides the translation bridge to native code. This approach implies some performance penalties and doesn’t always have the true look and feel of native apps.

In 2013, Facebook introduced React (a.k.a ReactJS), an open-source development framework which was followed by React-Native in 2015. ReactJS is essentially a JavaScript library used for creating web-based UIs. And, React-Native is a framework that uses the ReactJS library to build native components for mobile apps. Moreover, React-Native is cross-platform, supporting both Android and iOS.

Interestingly, although you write React-Native components in special flavors of JavaScript, CSS, and markup, the underlying objects are native device objects that access the operating system directly. As a result, the performance and look and feel of React-Native components rise “similar” to the native standards. Pretty awesome, huh?

One more important thing for using React-Native is that you don’t have to compile your apps to test changes. Once you’ve got the app running on a real or virtual device, you just edit and save the code, and then refresh your emulator or simulator to see your changes.

How does Salesforce use React-Native to build custom Mobile Apps?

Salesforce has made available in its Mobile SDK, the command-line tools that help to build and run the React-Native application that connects with your Salesforce’s Org.

Although the underlying Facebook framework remains in pre-release mode, Mobile SDK treats React-Native as a full SDK citizen. The Mobile SDK has the following components such as authentication, SmartStore, and SmartSync Data Framework to create full-fledged Mobile SDK apps.

The command-line available to create the React-Native app is “Forcereact”.

Forcereact: command-line tool

To use Forcereact you need first to set up the Mobile SDK Developer Tools.

Also, although React-Native coding is done in JavaScript, you still need to install native platform development tools: Android Studio, Xcode, or both. To create React-Native apps for Mobile SDK, you use the Forcereact npm utility.

Last but not least, keep in mind that to connect to the Salesforce service, every mobile app requires a Salesforce connected app. In fact, a connected app authorizes your app to communicate with Salesforce and to securely access Salesforce APIs. So, after you create and save your connected app, notice its details:

  • Copy the Callback URL and Consumer Key values. You use these values to set up authentication in your app.
  • Mobile SDK apps do not use the consumer secret, so you can ignore this value.

Demo Mobile App: Salesforce and React-Native

To understand the value and capacity of Salesforce mobile SDK with React-Native, let’s build one application! In this example, I will use an app related to the expenses of my company, Stellaxius.

Firstly, we want to use the natural capacities of Salesforce, such as natural login of SF and some sharing-permission functionalities inside of the mobile app. Additionally, we wish to use some native capacities of the smartphone, such as acceding the camera, to take, for instance, proof-photos of our invoices.

Some Screens of the React-Native Mobile App

1. Native Login of SFNative Login of SF

2. List of Expenses – The same as in Salesforce Web UIThe same as in Salesforce Web UI

3. List of Expenses – The same as in Salesforce Web UIThe same as in Salesforce Web UI

4. Edit of Expense – The bottom Take Photo will launch the screen of the Camera and from there you can adjust the zoom of CameraThe bottom Take Photo will launch the screen of the camera and from there you can adjust the zoom of Camera

5. The screen of the Camera – The Zoom Button and Flash are available in this screen. The user can adjust the zoom and flash to take the photo with the desired precision.The user can adjust the zoom and flash to take the photo with the desired precision.

Demo Mobile App: The Architecture

The following image shows up the structure of our application.The Architecture

Here the folder “Components” includes the majority of the items of the mobile application. The rest of it, it’s basically the normal structure of application when you use the tool Forcereact to create the React-Native application for Salesforce.

The main file of application is located in the main folder. The file name is App.js

import React, {Component} from ‘react’;
import {StyleSheet, Text, View} from ‘react-native’;
import { createStackNavigator, createBottomTabNavigator, createMaterialTopTabNavigator } from ‘react -navigation’
import Icon from ‘react-native-vector-icons/FontAwesome’
import ExpenseEdit from ‘components/ExpenseEdit’;
import ExpenseList from ‘components/ExpenseList’;
import ExpenseInfo from ‘components/ExpenseInfo’;
import AddExpense from ‘components/AddExpense’;
import Camera from ‘components/STCamera’;
import About from ‘components/About’;
const List = createStackNavigator({
Home: { screen:ExpenseList },
Info: { screen:ExpenseInfo },
Edit: { screen:ExpenseEdit }
}, {
navigationOptions: {
headerStyle: {
backgroundColor:’#0066CC’,
color:’#FFF’
},
headerTintColor:’#FFF’,
headerTitleStyle: {
color:’#FFF’
}
}
})
const Tabs = createBottomTabNavigator({
List: { screen:List },
About: { screen:About }
}, {
navigationOptions: ({ navigation }) => {
return {
tabBarIcon: ({ tintColor }) => {
constroute=navigation.state.routeName
constname= {
‘List’:’list’,
‘About’:’info-circle’
}[route]
return<Iconname={name}color={tintColor}size={22}/>
},
tabBarOptions: {
activeBackgroundColor:’#E6F0FA’,
margin:10
}
}
}
})
const ModalNav = createStackNavigator({
Tabs: { screen:Tabs },
AddExpense: { screen:AddExpense },
Camera: { screen:Camera }
}, {
mode:’modal’,
headerMode:’none’,
navigationOptions: {
}
})
export class App extends Component {
render() {
return (
<ModalNav/>
);
}
}
const styles = StyleSheet.create({
container: {
flex:1,
justifyContent:’center’,
alignItems:’center’,
backgroundColor:’#F5FCFF’,
},
welcome: {
fontSize:20,
textAlign:’center’,
margin:10,
},
instructions: {
textAlign:’center’,
color:’#333333′,
marginBottom:5,
},
})

Explanation:

As you can see, the file is written in Javascript aligned with React-Native and React. Thus, we can program our application with Javascript connecting to Salesforce using authentication, SmartStore, and SmartSync Data Framework/ Salesforce mobile SDK. We can also couple it with native capabilities of the smartphone, for example, the camera.

All of this, brings great value to your company! Salesforce has given us the capacity to connect to our Salesforce Org and extended to the mobile world without the discrimination of being a mobile hybrid application.

And yes, we do need to consider that our clients have the necessity of expanding their business to other areas. So, for that, it is very important to reuse what we have in our Org and translate it into the mobile landscape as quickly as possible, leveraging key resources – time and people.

We hope this article has been useful and interesting for you! Subscribe to our Knowledge Center where you will find all about the #1 CRM in the world! If you wish me to cover a specific topic or even if you have any suggestion or question, just drop a comment! Now, are you ready to expand your Org’s to the mobile landscape with Salesforce tools? 🙂


SUBSCRIBE KNOWLEDGE CENTER

Subscribe for free to our Knowledge Center to get the latest articles straight to your inbox!

Share1Tweet5Share7Send
Previous Post

Einstein High Velocity Sales: The Future of Sales Cloud

Next Post

How to capture the conversion page URL with Pardot?

Orlando Agostinho

Orlando Agostinho

Salesforce Certified. Technical Architect.
I am a seasoned software engineer with 17+ years of corporate leadership and application development experience in the business sector. At Stellaxius I'm a Salesforce certified professional, focused on Salesforce technical architecture and agile software development.
I love what I do! I'm a Salesforce enthusiast focused on giving the best value to our clients.

Related Articles

Release Notes

Top 4 Salesforce Spring ’25 Features for Sales Cloud

1st April 2025
24
Release Notes

Salesforce Spring ’25 Release Notes Highlights

26th March 2025
39
Salesforce

Benefits of Multi-Channel Communication with Omnichannel

16th January 2025 - Updated on 19th February 2025
62
Next Post
How to capture the conversion page link in Pardot?

How to capture the conversion page URL with Pardot?

Salesforce

Salesforce: A Force beyond Sales

Stellaxius

At Stellaxius, we are focused on turning our customers into superheroes by offering you simple-to-use consulting services and implementing sustainable solutions that transform people through technology and knowledge. We believe success comes with strong human relations to help transform businesses, improve people’s lives and have an impact on our community.

Categories

  • Analytics & AI
  • Business Analysis & Implementation
  • Integration & MuleSoft
  • Marketing
  • People & Culture
  • Salesforce
  • Development

Subscribe to our Blog

  • Careers
  • Privacy Policy
  • Contact Us

© 2025 Stellaxius Knowledge Center. All rights reserved.

No Result
View All Result
  • Login
  • Sign Up
  • Salesforce
    • CPQ
    • Net Zero Cloud
    • Release Notes
    • Sales Cloud
    • Salesforce Certifications
    • Service Cloud
  • Analytics &
    AI
    • Data Analysis
    • Einstein
  • Business Analysis &
    Implementation
  • Integration &
    Mulesoft
  • Marketing
    • Account Engagement
      (Pardot)
    • Marketing Automation
  • People &
    Culture
    • Human resources
    • Social Responsibility
  • Development

© 2025 Stellaxius Knowledge Center. All rights reserved.

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

*By registering into our website, you agree to the Terms & Conditions and Privacy Policy.
All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Skip to content
Open toolbar Accessibility Tools

Accessibility Tools

  • Increase TextIncrease Text
  • Decrease TextDecrease Text
  • GrayscaleGrayscale
  • High ContrastHigh Contrast
  • Negative ContrastNegative Contrast
  • Light BackgroundLight Background
  • Links UnderlineLinks Underline
  • Readable FontReadable Font
  • Reset Reset
  • SitemapSitemap
  • FeedbackFeedback