
The California Consumer Privacy Act (CCPA) governs how companies can capture and use data of their consumers. This act establishes new rights for every citizen living in the U.S. state of California. It is similar to GDPR in European Union (EU) region in terms of privacy rights. The CCPA is something that business owners have to consider because it applies to product or services databases, websites, and mobile apps.
To comply with the legislation, developers have to make sure that they are following all rules under CCPA when building a mobile app. In this post, let's discuss how you can build CCPA-compliant mobile applications with the Crowdbotics App Builder.
The CCPA grants any consumer based in California control over their personal information that businesses collect about them. This also includes a list of all third-party sources that the data is shared with. The main agenda of this new act is to allow an app user to:
Personal information constitutes several things. Here are relevant forms of data when it comes to using and collecting a user's personal information in your mobile apps:
CCPA was passed in the state of California on January 1st, 2020. Any business based in California is subject to CCPA. Moreover, a company does not have to be physically located in California for CCPA to apply; if their online services are operational in the state of California, CCPA applies.
CCPA has a strict set of rules that apply to only a certain set of businesses and applications. The majority of apps won't meet all of the following criteria. However, if your business matches any instance of these criteria, the CCPA is applicable.
If any of the instances are applicable to the type of application you are developing, you have to make sure that the mobile application is CCPA compliant. Do note that this is only applicable to for-profit businesses and not to non-profit organizations or government agencies.
The CCPA contains clear and precise requirements with which your app must comply. To meet these requirements, here are the steps you can take to ensure compliance:
The essential steps you can take as an app developer when building a CCPA-compliant mobile app is to implement a privacy policy and properly handle the app user's permissions for personal or sensitive data. In this section, we are going to cover an example when adding a particular module in your app with the Crowdbotics App Builder.
Before we proceed, please make sure to have an account registered with the Crowdbotics App Builder and have access to the dashboard and other screens such as Storyboard. If necessary, brush up on how to Scaffold a new Custom Mobile App with Crowdbotics and create a new demo app with the App Builder.
Once the scaffolding process is done, you are going to be welcomed by the Storyboard screen. This editing tool provides a logical flow to maintain a collection of your app's screens.
The first module we are going to cover is called Maps and is used to capture and use a user's geolocation data. Geolocation data consists of a user device's coordinates in the form of longitude and latitude. The Crowdbotics App Builder provides a built-in Maps module that you can drag-and-drop directly into your app to add Maps functionality.
At the Storyboard screen, from the right panel, select Modules and then add the Maps module by drag-and-drop on the Storyboard. Click the save button.
This screen module is now added to your RAD stack app. To add the necessary permission to access the location on the user’s device, you have to take care of both iOS and Android platforms. This requires some manual coding, so click over to your source code from within the Settings page.
On Android devices, to prompt for any type of permission, you need to add the code to request access to the location. Open the file [Your Project Name]/android/app/src/main/AndroidManifest.xml
add the following <uses-permission>
tag in the manifest file.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
The last step is to install and add the react-native-permissions
in the Maps/screens/MapsHome/index.js
file in your React Native app. The module react-native-permissions
requires that to specify the wanted permission for each platform to request user's access.
// after other import statements
import { PERMISSIONS, request } from 'react-native-permissions';
request(
Platform.select({
android: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION
})
);
On an Android device, this is how permission is prompted to the user. They now have the option to either grant or deny permission.
To access the similar features on an iOS device running the latest version, you have to add the following permissions in the file ios/[Your Project Name]/Info.plist
:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow "geoWeatherApp to access your location while using the app?</string>
On the iOS platform, the module react-native-permissions
requires you to include the appropriate permission handler. In our case, we want the app to access the user's location when the app is in use. Thus, add the following to the ios/Podfile
:
source 'https://cdn.cocoapods.org/'
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
// ADD THE FOLLOWING
permissions_path = '../node_modules/react-native-permissions/ios'
target 'ccpa_demo_21860' do
// ADD THE FOLLOWING
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/
// REST OF THE FILE REMAINS SAME
Then, from a terminal window, make sure to execute the following series of commands to install the cocoapods for permission.
# at the root of your project directory
cd ios/
pod install
# after the pod is successfully installed, navigate back to the root directory of the project
cd ..
The last step is to add the ios
platform when requesting permission to use the device's location in the file Maps/screens/MapsHome/index.js
.
request(
Platform.select({
android: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,
// Add the line below
ios: PERMISSIONS.IOS.LOCATION_WHEN_IN_USE
})
);
Here is an example of how the app prompts permission for geolocation access on an iOS device:
This set of permissions is an example of how you can build a mobile app that complies with the CCPA. Other CCPA considerations, such as the right to erase data or asking for consent and the inclusion of a Privacy Policy (which is a highly customized screen to add to an app) are organizational and technical priorities that fall outside the scope of the Crowdbotics App Builder.
Now you know how to build CCPA-compliant apps with the Crowdbotics App Builder, and, more generally, what the main requirements are to build a CCPA-compliant mobile app. CCPA compliance is made possible via Crowdbotics' full-code approach to build mobile apps, in which users have total control over the way their data is processed in their Crowdbotics app.
An app generated with the Crowdbotics App Builder tool comes with default permissions, specifically the ones we have discussed in the previous section. To build an app, Crowdbotics offers both the low-code Crowdbotics App Builder and managed app development by expert PMs and engineers.
For further reading on CCPA, check out this resource. To learn how to build mobile apps with Crowdbotics App Builder, please read our guide to building a custom mobile app with Crowdbotics.
Originally published:
October 27, 2020