Launching an overlay placement
For Rokt partners, the Rokt SDK for React Native can be used to display overlay placements on top of your app’s content.
Before you begin
Ensure that the Rokt Android SDK has already been integrated into your application following the steps listed here.
Importing the Rokt SDK
Import the Rokt SDK into your application's JavaScript file:
import { Rokt, RoktEmbeddedView } from "@rokt/react-native-sdk";
Executing the Rokt React Native SDK
Execute the SDK at the desired point by adding the appropriate consumer attributes. The Rokt placement will then display after a short delay that is configurable via the Rokt platform.
You can dictate what customer attributes are shared with Rokt. More information on available data fields can be found on the attributes page. If you want to share more attributes, you can add additional lines of code for each new attribute to the sample below.
attributes = {
"email": "j.smith@example.com",
"firstname": "Jenny",
"lastname": "Smith",
"mobile": "(323) 867-5309",
"postcode": "90210",
"country": "US"
}
Rokt.execute("RoktExperience", attributes, null, () => console.log("Placement Loaded"));
Note: The ViewName
(“RoktExperience”) can be modified when executing the SDK in multiple locations to display a different experience according to the context of where in the app the SDK is being executed. If modifying the ViewName, work with the Rokt team to ensure matching adjustments are made within the Rokt system.