-
This package gives wrapper methods for deepwall sdks. iOS - Android
-
Before implementing this package, you need to have api_key and list of actions.
-
You can get api_key and actions from DeepWall Dashboard
$ npm install deepwall-react-native-sdk --save
React Native 0.59 and below
Run react-native link deepwall-react-native-sdk
to link the library.
-
IOS
- Set minimum ios version to 10.0 in
ios/Podfile
like:platform :ios, '10.0'
- Add
use_frameworks!
intoios/Podfile
if not exists. - Remove
flipper
fromios/Podfile
if exists. - Run
$ cd ios && pod install
- Set minimum ios version to 10.0 in
-
ANDROID
- Set
minSdkVersion
to 21 inandroid/build.gradle
- Add
maven { url 'https://raw.githubusercontent.com/Teknasyon-Teknoloji/deepwall-android-sdk/master/' }
intoandroid/build.gradle
(Add into repositories under allprojects)
- Set
- On application start you need to initialize sdk with api key and environment.
import DeepWall, { DeepWallEnvironments } from 'deepwall-react-native-sdk';
DeepWall.getInstance().initialize('API_KEY', DeepWallEnvironments.PRODUCTION);
- Before requesting any landing page you need to set UserProperties (device uuid, country, language). See all parameters
import DeepWall, { DeepWallUserProperties } from 'deepwall-react-native-sdk';
DeepWall.getInstance().setUserProperties(
new DeepWallUserProperties({
uuid: 'UNIQUE_DEVICE_ID_HERE (UUID)',
country: 'us',
language: 'en-us',
}),
);
- After setting userProperties, you are ready for requesting landing page with an action name. You can find action name in DeepWall dashboard.
DeepWall.getInstance().requestLanding('AppLaunch');
- You can also close landing.
DeepWall.getInstance().closeLanding();
- If any of userProperties is changed you need to call updateUserProperties method. (For example if user changed application language)
DeepWall.getInstance().updateUserProperties({
language: 'fr-fr',
});
- There is also bunch of events triggering before and after DeepWall Actions. You may listen any action like below.
import DeepWall, { DeepWallEventBus, DeepWallEvents } from 'deepwall-react-native-sdk';
DeepWallEventBus.getInstance().listen(DeepWallEvents.LANDING_OPENED, function (data) {
console.log(
'DeepWallEvents.LANDING_OPENED',
data
);
});
- For example you may listen all events from sdk like below.
import { DeepWallEventBus, DeepWallEvents } from 'deepwall-react-native-sdk';
Object.values(DeepWallEvents).map((item) => {
DeepWallEventBus.getInstance().listen(item, function (data) {
console.log(item, data);
});
});
- You may found complete list of events in Enums/Events.js or Native Sdk Page
- UserProperties are:
- uuid
- country
- language
- environmentStyle
- debugAdvertiseAttributions