First of all let me point out I am not a native iOS developer so I am sorry if I confuse some terms regarding native iOS development. I have built an APP using React Native framework. Now I need to integrate a native SDK(SightCall SDK). I've got a sample APP from them and successfully integrated into the project.
I made a function in react native that calls a native module I implemented in AppDelegate.m
_callSightcall = () => { CustomModule.namee('Success');};
This function is called on button press
<TouchableHighlight style={styles.buttonHomePage} onPress={this._callSightcall}>
In AppDelegate.m I created a module CustomScreen:
On button Click this method is successfully called and I get a response in the console.
Now the problem is I need to make that on button click I call this method and open the SightCall interface.If I replace the AppDelegate existing code from AppDelegate.m and place the AppDelegate code from the SIghtCall code sample and build the APP It will be successful and the SightCall interface will build (not the interface I built with react native). But it actually needs to open SightCall interface when I click on a button from the existing react native app.
If I place this:AppDelegate Sightcall Codeinto the existing AppDelegate and build the APP It will be built with the SIghtcall Interface.
How can I make that on button click from the actual React Native APP call the CustomScreen module I made and then show the SIghtCall interface.Custom module called on button click in React NAtive APP
This is the code for calling the SightCall interface (placing this AppDelegate code into AppDelegate of existing APP build the SIghtCall interface) But placing this code into the Custom Module I made doesn't work
@interface AppDelegate () @property (nonatomic) LSApplicationModel *model;@end@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {if ([[NSProcessInfo processInfo] arguments].count == 2) { NSLog(@"App launched with parameters: %@", [[NSProcessInfo processInfo] arguments]); dispatch_async(dispatch_get_main_queue(), ^{ [self application:application openURL:[NSURL URLWithString:[[NSProcessInfo processInfo] arguments][1]] sourceApplication:nil annotation:@(0)]; });}return YES;}- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions {// init SDK Modelself.model = [[LSApplicationModel alloc] init];if (@available(iOS 13.0, *)) { self.window.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;}return YES;}- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0L), ^{ [self.model openURL:[url absoluteString]];});return YES;}- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {if ([userActivity.activityType isEqualToString: NSUserActivityTypeBrowsingWeb]) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0L), ^{ [self.model openURL:[[userActivity webpageURL] absoluteString]]; }); return YES;}return NO;}- (void)applicationDidEnterBackground:(UIApplication *)application {[self.model resetUI];[self.model cancelACDRequest];}@end