Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Release Date

## Release Version

- [minor] MOEN-46338: Added support for the MoEngage iOS SDK 11.0.0 major release (Swift concurrency migration)
- [major] Updated MoEngage-iOS-SDK to 11.00.0

# 01-07-2026

## 6.10.0
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/moengage/apple-sdk.git", exact: "10.14.0")
.package(url: "https://github.com/moengage/apple-sdk.git", exact: "11.00.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
28 changes: 20 additions & 8 deletions Sources/MoEngagePluginBase/MoEngagePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ import MoEngageInApps
}

guard
let sdkConfig = try? MoEngageInitialization.fetchSDKConfigurationFromInfoPlist(),
!sdkConfig.appId.isEmpty
let sdkConfigData = try? MoEngageConfig.FileBased.fetchSDKConfigurationFromInfoPlist(),
Comment thread
AnirudhaSM-engg-sdk marked this conversation as resolved.
!sdkConfigData.workspaceId.isEmpty
else {
MoEngageLogger.logDefault(message: "App ID is empty. Please provide a valid App ID to setup the SDK.")
return nil
}
return sdkConfig
return sdkConfigData.asSdkConfig
}

// MARK: Initialization of default instance
Expand Down Expand Up @@ -126,28 +126,40 @@ import MoEngageInApps
extension MoEngagePlugin: MoEngageModule.Item {
static let context: MoEngageSynchronizationContext = "com.moengage.pluginBase"

public static func getInfo(sdkInstance: MoEngageSDKInstance) -> MoEngageModule.Info {
return .init(name: "pluginBase", version: MoEngagePluginConstants.version)
public static func getInfo(sdkInstance: isolated MoEngageSDKInstance) -> MoEngageModule.Info? {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's return nil identity here to keep production behaviour of not sending the this module in integratedModules

return MoEngageModule.Info(identity: .init(name: "pluginBase", version: MoEngagePluginConstants.version))
}

public static func process(event: MoEngageModule.Event, sdkInstance: MoEngageSDKInstance) {
public static func process(event: MoEngageModule.Event, sdkInstance: isolated MoEngageSDKInstance) {
context.execute {
switch event {
case .`init`:
Self.setDelegates(identifier: sdkInstance.sdkConfig.appId)
Self.setDelegates(identifier: sdkInstance.config.workspaceId)
Comment thread
AnirudhaSM-engg-sdk marked this conversation as resolved.
default:
break
}
}
}

public static func process(event: MoEngageModule.AsyncEvent, sdkInstance: isolated MoEngageSDKInstance) async {
// MoEngagePluginBase has no asynchronous lifecycle work.
}

public static func listensToAdditionalNotifications() -> [Notification.Name] {
return []
}

private static func setDelegates(identifier: String) {
_ = MoEngagePluginInAppDelegateHandler(identifier: identifier)
#if os(tvOS)
MoEngageLogger.logDefault(message: "MoEngagePluginMessageDelegateHandler is unavailable for tvOS 🛑")
#else
_ = MoEngagePluginMessageDelegateHandler(identifier: identifier)
_ = MoEngagePluginAuthenticationListenerHandler(identifier: identifier)
// `MoEngageAuthenticationError.Listener` is `@MainActor` isolated in SDK 11, so the
// conforming handler must be instantiated on the main actor.
Task { @MainActor in
Comment thread
AnirudhaSM-engg-sdk marked this conversation as resolved.
_ = MoEngagePluginAuthenticationListenerHandler(identifier: identifier)
}
#endif
MoEngagePluginBaseHandler.initializePluginBridge(className: MoEngagePluginConstants.ExternalPluginBase.cardsBridge)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import MoEngageSDK


@available(iOSApplicationExtension, unavailable)
@MainActor
final class MoEngagePluginAuthenticationListenerHandler: NSObject, MoEngageAuthenticationError.Listener {

private let identifier: String
Expand Down
16 changes: 8 additions & 8 deletions Sources/MoEngagePluginBase/MoEngagePluginUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,26 @@ public class MoEngagePluginUtils {
if let dataPayload = payload[MoEngagePluginConstants.General.data] as? [String: Any], let position = dataPayload[MoEngagePluginConstants.InApp.position] as? String {
switch position {
case MoEngagePluginConstants.InApp.NudgePosition.top.rawValue:
return NudgePositionTop
return .top
Comment thread
AnirudhaSM-engg-sdk marked this conversation as resolved.
case MoEngagePluginConstants.InApp.NudgePosition.bottom.rawValue:
return NudgePositionBottom
return .bottom
case MoEngagePluginConstants.InApp.NudgePosition.bottomLeft.rawValue:
return NudgePositionBottomLeft
return .bottomLeft
case MoEngagePluginConstants.InApp.NudgePosition.bottomRight.rawValue:
return NudgePositionBottomRight
return .bottomRight
default:
return NudgePositionAny
return .any
}
}
return NudgePositionNone
return .none
}

static func getInAppActionType(inappAction: MoEngageInAppAction) -> String? {
var actionType: String? = nil

if inappAction.actionType == CustomAction {
if inappAction.actionType == .customAction {
actionType = MoEngagePluginConstants.InApp.customAction
} else if inappAction.actionType == NavigationAction {
} else if inappAction.actionType == .navigationAction {
actionType = MoEngagePluginConstants.General.navigation
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "MoEngagePluginBase",
"postBuild": "Utilities/post_build.rb",
"sdkVerMin": "10.14.0",
"sdkVerMin": "11.00.0",
"packages": [
{
"name": "MoEngagePluginBase",
Expand Down
Loading