setUserLanguage
method. Allows users to manually set the language instead of relying on auto-detection.st_open_browser=true
is opened in the WebView, the URL is launched in the browser.sendDismissedClick
to send clicks when inapp is dismissed.PrivacyInfo.xcprivacy
and XCFramework signature.setCurrencyCode
method is removed. currencyCode
is selected in EMMA Dashboard. All prices sent in the order will not be converted by EMMA to a specific currency, they will be interpreted as a unit value.currencyCode
other than EUR not being sent in the trackOrder
request.updatePostbackConversionValue
with lockWindow
parameter.closeStrip
method has also been added to give you the freedom to close the strip whenever you want.iAd.framework
. Only for iOS < 14.3, from version 4.10.2 AdService.framework
is used.://startview/close
.AdServices.framework
. On iOS 14.3 to 14.8.1 it could produced a hang.rootViewController
and minor bugs.customerId
in purchases added in version 4.9.0.EMMAEventRequest
as optional when instantiating.+(void)startSession:(NSString*)appKey withOptions:(NSDictionary*)launchOptions __attribute__((deprecated("Use startSession without options")));
.+(void) startPushSystem: (NSDictionary*) launchOptions __attribute__((deprecated("Use startPushSystem without parameters")));
.+(void)startOrder:(NSString*)orderId customerId:(NSString*)customerId totalPrice:(float)totalPrice coupon:(NSString*)coupon;
.+(void)registerUser:(NSString*)userId forMail: (NSString*)mail;
and replaced by optionals.+(void)loginUser:(NSString*)userId forMail:(NSString*)mail;
and replaced by optionals.+(void)addProduct:(NSString*)productId name:(NSString*)name qty:(float)qty price:(float)price;
.+(void)addRateAlertForAppStoreURL:(NSString*)appStoreURL;
.+(void) setRateAlertFreq: (int) hours;
.+(void) setRateAlertTitle: (NSString*) title;
.+(void) setRateAlertMessage: (NSString*) message;
.+(void) setRateAlertCancelButton: (NSString*)>cancelButtonText;
.+(void) setRateAlertRateItButton: (NSString*) rateItButtonText;
.+(void) setRateAlertLaterButton: (NSString*) laterButtonText;
.+(void) setRateAlertShowAfterUpdate:(BOOL) showAlert;
.EMMA.add(inAppDelegate: self)
to EMMA.addInAppDelegate(delegate: self)
.EMMA.trackEvent(eventRequest)
to EMMA.trackEvent(request: eventRequest)
.EMMA.handleLink(url)
to EMMA.handleLink(url: url)
.EMMA.handlePush(userInfo)
to EMMA.handleLink(userInfo: userInfo)
.EMMA.openNativeAd(nativeAdCampaignId: campaignId)
to EMMA.opeNativeAd(campaignId: campaignId)
. if #available(iOS 14.0, *) {
EMMA.requestTrackingWithIdfa()
}
EMMA.setCustomerId("198284343")
In SDK version 4.6.2 or higher the extension code has been added inside an SDK method. It replaces the entire contents of the file with the code below:
import UIKit
import UserNotifications
import EMMA_iOS
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
EMMA.didReceive(request, with: bestAttemptContent) { (content) in
contentHandler(bestAttemptContent)
}
}
}
override func serviceExtensionTimeWillExpire() {
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
contentHandler(bestAttemptContent)
}
}
}
To add the SDK to the extension it is necessary to modify the Podfile file by adding the pod eMMa to the extension target:
target 'ProjectName' do
pod 'eMMa', '~> 4.6.2'
end
target 'EMMANotificationServiceExtension' do
pod 'eMMa', '~> 4.6.2'
end
The pushMessage and pushTag methods have been removed from the EMMAPushDelegate and the onPushOpen method has been added. This method is passed the currently opened push campaign. This campaign has attributes such as tag or message, which would replace the deleted methods.
-(void)onPushOpen:(EMMAPush*)push
Previous versions upgrading to 4.5 will need to make the following changes.
The following methods that were deprecated in version 4.4 have been removed in 4.5:
+(void) trackEvent:(NSString*)token
+(void) trackEvent:(NSString *)token withAttributes: (NSDictionary*) attributtes
+(void) trackEventWithRequest:(EMMAEventRequest *) request
Both are replaced by the following method:
+(void) trackEvent:(EMMAEventRequest *) request
Example of use:
let eventRequest = EMMAEventRequest.init(token: "<token>")
// Optional: You can add your custom event attributes
eventRequest?.attributes = ["test_attribute":"test_value"]
// Optional. You can capture emma requests with this delegate
eventRequest?.requestDelegate = self
// Optional. Append your request ID to capture it later
eventRequest?.customId = "MY_EVENT_REQUEST"
EMMA.trackEvent(eventRequest)
The following methods that were deprecated in 4.4 have been removed in 4.5:
+(void)inAppMessage:(InAppType)type andRequest:(EMMAInAppRequest*) request
+(void)inAppMessage:(InAppType)type andRequest:(EMMAInAppRequest*) request withDelegate:(id) delegate
Both are replaced by the following methods:
+(void)inAppMessage:(EMMAInAppRequest*) request
+(void)inAppMessage:(EMMAInAppRequest*) request withDelegate (id) delegate
Example of use:
import UIKit
import EMMA_iOS
class InAppExampleViewController: UIViewController, EMMAInAppMessageDelegate {
override func viewDidLoad() {
super.viewDidLoad()
getStartView()
// You can add as many request delegates as you want
EMMA.add(inAppDelegate: self)
//Check if any adball is showing
if EMMA.isAdBallShowing() {
print("There is an adball floating arround")
}
}
// MARK: - EMMA InApp Messages Requests
func getStartView() {
let startViewinAppRequest = EMMAInAppRequest(type: .Startview)
// Optional. You can filter by label
startViewinAppRequest?.label = "<LABEL>"
/*
By default Startview presents on UIApplication.shared.delegate?.window?.rootViewController
You can customize this behavior uncommenting following line
*/
//EMMA.setRootViewController(UIViewController!)
EMMA.inAppMessage(startViewinAppRequest)
}
func getBanner() {
let bannerRequest = EMMAInAppRequest(type: .Banner)
EMMA.inAppMessage(bannerRequest)
}
func getAdBall() {
let adballRequest = EMMAInAppRequest(type: .Adball)
EMMA.inAppMessage(adballRequest)
}
func getDynamicTabBar() {
// You must define your UITabBarController
// Uncomment following line!
// EMMA.setPromoTabBarController(UITabBarController!)
// Sets default promo tab index if not defined in EMMA Platform
EMMA.setPromoTabBarIndex(5)
// Sets a tab bar item to be shown if not defined in EMMA Platform
// EMMA.setPromoTabBarItem(UITabBarItem!)
let dynamicTabBarRequest = EMMAInAppRequest(type: .PromoTab)
EMMA.inAppMessage(dynamicTabBarRequest)
}
func getStrip() {
let stripRequest = EMMAInAppRequest(type: .Strip)
EMMA.inAppMessage(stripRequest)
}
// MARK: - EMMA InApp Message Delegate
func onShown(_ campaign: EMMACampaign!) {
guard let c = campaign else {
print("Error getting campaign info")
return
}
print("Shown campaign \(c)")
}
func onHide(_ campaign: EMMACampaign!) {
guard let c = campaign else {
print("Error getting campaign info")
return
}
print("Hide campaign \(c)")
}
func onClose(_ campaign: EMMACampaign!) {
guard let c = campaign else {
print("Error getting campaign info")
return
}
print("Closed campaign \(c)")
}
}
If the message is to request a Native Ad it is mandatory to use EMMANativeAdRequest (subclass of EMMAInAppRequest) to add the templateId and its specific delegate.
In this new version, improvements have been made to push notifications management.
The following methods are deprecated:
+(void) startPushSystem: (NSDictionary*) launchOptions
+(void) startSession:(NSString*)appKey withOptions:(NSDictionary*)launchOptions
Due to improvements in the SDK by simply adding the Push delegate layout, there is no need to notify the launchOptions
to the SDK.