Netmera Developer Guide
Netmera Docs
  • Netmera Developer Guide
  • Platforms
    • iOS
      • New iOS (Swift)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Widget and In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
        • Live Activities
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Advertising ID
        • Changelog
      • Former iOS (Objective-C)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Push Payload Receivers
          • Widget and In-App Messages
          • Customizing In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
          • Custom Web View Presentation
          • Push Icon
        • Live Activities
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Data Transfer
        • Advertising ID
        • SSL Pinning
        • Changelog
    • Android
      • SDK Integration
        • Huawei Integration
        • Huawei Message Receipt
        • Custom FCM and HMS Implementations
        • Android Integration FAQs
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
        • Custom Web View Presentation
        • Push Icon
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
        • Background Location Permission
      • User & Attributes
      • Data Transfer
      • Advertising ID
      • App Tracking
      • SSL Pinning
      • Changelog
    • Web
      • SDK Setup
        • Self-Hosted SDK Setup
      • Mobile Web Push for iOS
      • Deep Linking
        • Custom Deep Links
      • Events
      • User & Attributes
    • React Native
      • SDK Integration
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • Changelog
    • Flutter
      • SDK Integration
        • Custom FCM and HMS Implementations
      • Push Notifications
        • Push Notification Permissions
        • Widget and In-App Messages
        • Flutter iOS Media Push
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • SSL Pinning
      • Changelog
    • Cordova
      • SDK Integration
      • Push Notifications
      • Sound & Vibration
      • Push Inbox
      • Events
      • User & Attributes
    • Unity
      • SDK Integration
      • Sound & Vibration
      • Events
      • User & Attributes
      • Changelog
  • Integrated Modules
    • Optimove
    • Adjust
    • Mixpanel
    • IYS Integration
    • VIA Integration
      • Short URL Consent Requests
      • OTP Consent Requests
        • OTP Confirmation Completion
      • VIA Email Rejection Link Generation
      • ETK Rejection via SMS
  • API Documentation
    • REST API
      • Setup
      • Notifications
      • Events
      • User & Device Management
      • Inbox Feature
      • GDPR
      • Error Responses
  • FAQs
    • Push Notifications FAQs
Powered by GitBook
On this page
  • Step 1: Implement a Receiver Class
  • Step 2: Add Receiver Class to AndroidManifest.xml
  • Step 3: Let Netmera Handle the Received Web Content

Was this helpful?

  1. Platforms
  2. Android
  3. Push Notifications

Custom Web View Presentation

Step 1: Implement a Receiver Class

Create a class that extends NetmeraWebContentBroadcastReceiver and override its onShow() and onClose() methods. These methods will handle the actions triggered when web content is shown or closed.

public class SampleWebContentBroadcastReceiver extends NetmeraWebContentBroadcastReceiver {

    @Override
    public void onShow(Context context, Bundle bundle) {
        // Trigger your web view flow here
    }

    @Override
    public void onClose(Context context, Bundle bundle) {
        // Handle web view closure here
    }
}

Step 2: Add Receiver Class to AndroidManifest.xml

In the AndroidManifest.xml file, register the receiver class and specify the actions com.netmera.web.content.SHOW and com.netmera.web.content.CLOSE

<application>
    ...
    <receiver
        android:name="com.sample.SampleWebContentBroadcastReceiver"
        android:exported="false">
        <intent-filter>
            <action android:name="com.netmera.web.content.SHOW" />
            <action android:name="com.netmera.web.content.CLOSE" />
        </intent-filter>
    </receiver>
</application>

Step 3: Let Netmera Handle the Received Web Content

Use Netmera.handleWebContent() to display the content in your custom WebView:

// Pass your WebView as a parameter. The content will be shown in it.
Netmera.handleWebContent(webView);

If you want to listen for URL loading actions inside the WebView, use NetmeraWebViewCallback

Netmera.handleWebContent(webView, new NetmeraWebViewCallback() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        // Implement your logic here
        // Return true if you handle the URL yourself, otherwise return false
        return false;
    }
});
PreviousPush CallbacksNextPush Icon

Last updated 3 months ago

Was this helpful?