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
ios/Podfile
like: platform :ios, '10.0'
use_frameworks!
into ios/Podfile
if not exists.flipper
from ios/Podfile
if exists.$ cd ios && pod install
ANDROID
minSdkVersion
to 21 in android/build.gradle
maven { url 'https://raw.githubusercontent.com/Teknasyon-Teknoloji/deepwall-android-sdk/master/' }
into android/build.gradle
(Add into repositories under allprojects)import DeepWall, { DeepWallEnvironments } from 'deepwall-react-native-sdk';
DeepWall.getInstance().initialize('API_KEY', DeepWallEnvironments.PRODUCTION);
import DeepWall, { DeepWallUserProperties } from 'deepwall-react-native-sdk';
DeepWall.getInstance().setUserProperties(
new DeepWallUserProperties({
uuid: 'UNIQUE_DEVICE_ID_HERE (UUID)',
country: 'us',
language: 'en-us',
}),
);
DeepWall.getInstance().requestLanding('AppLaunch');
DeepWall.getInstance().closeLanding();
DeepWall.getInstance().updateUserProperties({
language: 'fr-fr',
});
import DeepWall, { DeepWallEventBus, DeepWallEvents } from 'deepwall-react-native-sdk';
DeepWallEventBus.getInstance().listen(DeepWallEvents.LANDING_OPENED, function (data) {
console.log(
'DeepWallEvents.LANDING_OPENED',
data
);
});
import { DeepWallEventBus, DeepWallEvents } from 'deepwall-react-native-sdk';
Object.values(DeepWallEvents).map((item) => {
DeepWallEventBus.getInstance().listen(item, function (data) {
console.log(item, data);
});
});
src/main/java/com/YOUR-APP-NAME/MainApplication.java
// MainApplication.java
...
import com.deepwall.RNDeepWallPackage;// <-- Add this line.
...
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNDeepWallPackage()); // <-- Add this line.
return packages;
}
Author: Teknasyon-Teknoloji
Source Code: https://github.com/Teknasyon-Teknoloji/deepwall-react-native-sdk
#react-native #react #mobile-apps