Initializing the SDK
Step 13: Invoke DR SDK from Application Class on Android
DR SDK needs to be initialized from the Android Application class. Please add the following lines of code to the Application class.
ReactInstanceManager mReactInstanceManager = getReactNativeHost().getReactInstanceManager();
ReactApplicationContext context = (ReactApplicationContext) mReactInstanceManager.getCurrentReactContext();
new IuLibraryModule(this, context);
Note
If the application class is not created, please create a class by extending from
android.app.Application
. Add the above lines of code intoonCreate
method of the application class. Also, add the Application class name inside<application >
tag inAndroidManifest.xml
file.
Step 14 : Configure DR Server for the Host APP
DR Server needs to do minimal configuration corresponding to Host app to connect to host app via FCM, Please provide package name of the Host app to DR team to update the same on Server.
Step 15: Invoke DR SDK from AppDelegate on iOS
Please open the Xcode xcworkspace
of the iOS app and add the following code to your AppDelegate.m
:
#import "AppDelegate.h"
#import <DigitalReefSDK/DigitalReefSDK.h>
@interface AppDelegate ()
@property (nonatomic, strong) DigitalReef *digitalReef;
@end
@implementation AppDelegate
- (instancetype)init{
self = [super init];
if(self){
self.digitalReef = DigitalReef.shared;
}
return self;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// for push notification permission
[DigitalReef requestPushPermission];
// Host app code continues from here...
}
Updated over 2 years ago