The Netmera Developer Hub

Welcome to the Netmera developer hub. You'll find comprehensive guides and documentation to help you start working with Netmera as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Quick Start

This section provides information about the basic steps required in order to be able to receive push notifications sent from Netmera Dashboard on your devices.

Enable Push Notifications for Your Project

  1. If you have not generated a valid push notification certificate yet, generate one and then export by following the steps explained in Configuring Push Notifications section of App Distribution Guide
  2. Enable Remote notifications background mode for your application as explained in Configuring Background Modes guide.
  3. Export the generated push certificate in .p12 format as explained in Installing a Client SSL Signing Identity on the Server step.
  4. Upload exported .p12 file to Netmera Dashboard.

Integrate SDK into Your Project

CocoaPods is the recommended way to integrate Netmera into your project. If you do not use it, we strongly suggest you to use it in order to facilitate dependency management for your project.

If you don't want to use CocoaPods, you can also integrate Netmera manually.

CocoaPods

Simply add the following in your Podfile:

pod 'Netmera'

Manual

Download the framework from here

After that, you should add the following frameworks to your application which Netmera SDK requires.

Foundation, UIKit, CoreGraphics, SystemConfiguration, MobileCoreServices, CoreTelephony, CoreLocation and optionally UserNotifications

Setup Netmera

Initialize Netmera

Add the following two lines of code in your application delegate class:

#import "AppDelegate.h"

// Import Netmera framework
#import <Netmera/Netmera.h> 

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application 
  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  // Start Netmera instance
  // This must be called before -application:didFinishLaunchingWithOptions: method returns
  [Netmera start];
  // Set Client API Key
  // This can be called later, see documentation for details
  [Netmera setAPIKey:@"YOUR_CLIENT_API_KEY"];
  [Netmera setLogLevel:(NetmeraLogLevelDebug)];

  return YES;
}
import UIKit

// Import Netmera framework
import Netmera

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
				
        //Start Netmera instance
        //This must be called before -application:didFinishLaunchingWithOptions: method returns
        Netmera.start()
        // Set Client API Key
        // This can be called later, see documentation for details
        Netmera.setAPIKey("YOUR_CLIENT_API_KEY")
        Netmera.setLogLevel(NetmeraLogLevel.debug)
        return true
}

YOUR_CLIENT_API_KEY : You can get that api key from Developers -> API -> Sdk Api Key from your web panel.

Request Push Notification Authorization

Request push notification authorization from user by calling the following method in an appropriate place:

// Call this method with needed notification types
[Netmera requestPushNotificationAuthorizationForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound];
// Call this method with needed notification types
Netmera.requestPushNotificationAuthorization(forTypes: [.alert, .badge, .sound])

Calling this method will immediately prompt push notification permission dialog to user, therefore it's important for you to call this method after you informed user about how your application will utilize push notifications.

Enable Push Notifications

Enable Push Notifications from Targets -> Capabilities -> Push Notifications

Done!

Now your devices will receive the following push notification types sent via Netmera Dashboard:

  • Standard push notifications
  • Interactive push notifications (If you set up and publish them using the Dashboard)
  • Push notifications with web view content
  • Push notifications with deeplinks (If your application supports URL Scheme based deeplinks and you have set the application's URL Scheme to the Dashboard)
  • Popup style notifications

Troubleshooting

If you are sending push notifications from Netmera Dashboard, not getting any errors, but push notifications are not receiving to your devices, please follow steps described in Apple's Technical Note about Troubleshooting Push Notifications to verify if your device is successfully registering and receiving push notifications.

Quick Start