Widget and In App Messages

Disable/Enable Popups and In App Messages

When a popup notification or an in app message is received by the SDK, it immediately presents the corresponding web view content if the application is in foreground state. If application is in background state when popup is received, SDK presents the web view content whenever application comes to foreground state.

You may want to disable this immediate presentation behavior for cases like when your users watch a video, when they are in the middle of their favorite game level, or when they are about to finish purchasing their order. You can use the following two methods to manage this process:

// Call this method to disable immediate popup presentation
Netmera.disablePopupPresentation();

// Call this method to re-enable immediate popup presentation
Netmera.enablePopupPresentation();

Widget Callbacks

Integration of Widget URL Callbacks in React Native for iOS

In React Native, this only needs to be done for iOS. To handle widget URL callbacks in React Native for iOS, the following code must be added to your AppDelegate.m file between @implementation AppDelegate and @end.

// Required code block to handle widget URLs in React Native

- (BOOL)shouldHandleOpenURL:(NSURL *)url forPushObject:(NetmeraPushObject *)object {

  return NO;

}

- (void)handleOpenURL:(NSURL *)url forPushObject:(NetmeraPushObject *)object {

  [RNNetmeraRCTEventEmitter handleOpenURL:url forPushObject:object];

}

onWidgetUrlTriggered for React Native

Also, utilize the onWidgetUrlTriggered method in your React Native code to handle the widget URL callback. Here's how:

Netmera.onWidgetUrlTriggered(url => {

console.log('Netmera triggered widget url: ', url);

});

By doing this, you'll be able to incorporate widget URL callback functionality into your iOS React Native app. It's important to note that this information is iOS-specific and pertains to React Native implementation.

Last updated