Former iOS SDK Integration
Last updated
Last updated
Important Note :
We strongly recommend referring to the updated integration guide on Swift SDK Integration for incorporating Netmera into your projects. The previous iOS SDK integration method, which you can find here, is being phased out and will not be supported in the long term. Transitioning to the new SDK will ensure that you have access to the latest features, improvements, and technical support.
Quick Steps Guidelines
Step 1: Create an Apple Push Notification Certificate
Obtain your Apple Push Notification Certificate from developer.apple.com and add it to your Netmera panel on Developer > Push Backend.
Step 2: Integrate SDK into Your Project
Integrate Netmera SDK with CocoaPods or choose the manual integration guide.
Step 3: Setup Netmera
Initialize Netmera by adding the two lines of code below in your application delegate class.
Step 4: Request Push Notification Authorization
Request push notification authorization from the users by calling the methods below.
Step 5: Configure your Xcode Settings for Enabling Push Notifications
Enable push notifications for your app by navigating to Signing & Capabilities > Capability > Push Notifications on Xcode.
iOS SDK integration completed
Onboarding Checklist: iOS and Android
Please find the Onboarding Checklist for iOS and Android below. Follow the titles in the checklist to ensure you have completed each essential step in your onboarding process with Netmera.
To get a visual guide on how to integrate Netmera into your iOS app, you may watch our iOS integration video below.
Below you may also see the written steps of creating an Apple Push Notification Certificate.
We send push notifications using APNS (Apple Push Notification Service). Therefore, you need to obtain an Apple Push Notification Certificate from www.developer.apple.com using your account. Once you have the certificate, you should export it using Keychain Access and add it to the iOS page in the panel's left menu under Developer > Push Backend.
Important Notes on Bundle ID:
Make sure to add the certificate generated with the bundle ID of your project to the panel, and set the bundle ID of your project in the panel as well. The bundle ID of your project, the bundle ID of the certificate, and the bundle ID set in the panel should all match.
In case of having problems sending push notifications when you build from Xcode:
Check the certificate type on the Developer > Backend Transfer > iOS page in the menu on the left. If you downloaded the app from the store or are testing it via TestFlight, the certificate type must be "prod". If you are compiling from Xcode, the certificate type must be selected as "dev".
CocoaPods is the preferred method for incorporating Netmera into your project. We recommend using CocoaPods for integrating Netmera into your project.
CocoaPods simplifies dependency management and streamlines the integration process. However, if you prefer not to use CocoaPods, you can manually integrate Netmera into your project.
Add the following line to your Podfile.
Without AdId Support:
Follow the steps outlined in our iOS Manual Integration document to manually integrate Netmera into your project.
Initialize Netmera by adding the following two lines of code in your application delegate class.
Purpose of Netmera.setLogLevel(NetmeraLogLevel.debug):
This method is designed to control the level of logging for Netmera. It offers three different usage options, and adding this method is optional:
debug: This setting enables you to view Netmera logs. It is useful when you want to monitor detailed logs for debugging purposes.
error: With this option, only error logs are displayed. It is helpful when you specifically need to focus on identifying and addressing issues or errors.
none: Use this setting when you don't want any Netmera-related logs to appear. It is suitable for situations where you prefer a clean log output without Netmera logs.
You can choose the appropriate log level based on your needs, and adding this method to your code is optional, depending on whether you want to monitor and control Netmera's logging behavior.
Warning: Please make sure you get the API key value from the relevant panel.
YOUR_SDK_API_KEY: You can get that API key from Developers > API > SDK API Key from your web panel.
If there is an on-premise installation:
Call the method Netmera.setBaseURL("YOUR PANEL DOMAIN URL")
on the previous line before Netmera.setAPIKey
method.
Request push notification authorization from the user by calling the following method.
Calling this method will immediately prompt the push notification permission dialog to the user. Make sure to call this method after informing the user about how your application will utilize push notifications.
If push permission requested from Apple or another push provider, you should call this method under that request. Otherwise, interactive push buttons will not be handled by Netmera SDK.
isEnable Method:
With this method, you can determine whether your users have granted permission for notifications.
Enable push notifications for your app by navigating to Signing & Capabilities > Capability > Push Notifications.
The following methods in iOS are used for managing email subscription preferences within the Netmera mobile SDK. Here's an explanation of each method:
This method is used to check whether the user has allowed email subscriptions through the Netmera SDK. It returns a Boolean value.
This method is used to set the user's preference for email subscriptions within the Netmera SDK.
iOS SDK integration has been successfully completed, and your devices are now ready to receive the following types of push notifications sent via the Netmera Dashboard:
Standard Push Notifications
Interactive Push Notifications
Widgets ( Enable/Disable Widget and In App Messages)
Push Notifications with Deeplinks ( Former iOS Deeplink)
If you are sending push notifications from the Netmera Dashboard but not receiving them on your devices, please follow the steps described in Apple's Technical Note about Troubleshooting Push Notifications. This will help you verify if your device is successfully registering and receiving push notifications.