Hello,
We have upgraded our Capacitor to version 6 and I was getting error "Adobe" plugin is not implemented. so I am trying to migrate ACPCore imports to AEPCore in our AdobePlugin.swift file for push notifications. Not sure if it will resolve the error.
I am getting this error while migrating:
import Foundation
import Capacitor
import AEPCore
import AEPLifecycle
import AEPIdentity
import AEPSignal
import UserNotifications
@objc(AdobePlugin)
public class AdobePlugin: CAPPlugin {
@objc(trackAction:data:)
public static func track(action: String?, data: [String: Any]?) {
let deliveryId = data["deliveryId"] as? String ?? ""
let broadlogId = data["broadlogId"] as? String ?? ""
if (deliveryId == "" || broadlogId == "") {
print("trackAction failure")
return
} else {
let piiContextData: [String: String] = [
"deliveryId": deliveryId,
"broadlogId": broadlogId,
"action": action] //1-open 2-click, 7-impression.
AEPMobileCore.trackAction("tracking", data: piiContextData);
print(["trackAction result": "success"])
}
}
}
// old code
import Foundation
import Capacitor
import ACPCore
import UserNotifications
@objc(AdobePlugin)
public class AdobePlugin: CAPPlugin {
@objc func trackAction(_ call: CAPPluginCall) {
let action = call.getString("action") ?? "";
let deliveryId = call.getString("deliveryId") ?? "";
let broadlogId = call.getString("broadlogId") ?? "";
if (deliveryId == "" || broadlogId == "") {
call.reject("trackAction failure")
} else {
let piiContextData: [String: String] = [
"deliveryId": deliveryId,
"broadlogId": broadlogId,
"action": action] //1-open 2-click, 7-impression.
ACPCore.trackAction("tracking", data: piiContextData);
call.resolve(["trackAction result": "success"])
}
}
}
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @arpita_p I would suggest you to look at this test app code using the same AEPCore import: https://github.com/adobe/aepsdk-core-ios/blob/main/TestApps/TestApp_Swift/AppDelegate.swift
Views
Replies
Total Likes
Hello @arpita_p I would suggest you to look at this test app code using the same AEPCore import: https://github.com/adobe/aepsdk-core-ios/blob/main/TestApps/TestApp_Swift/AppDelegate.swift
Views
Replies
Total Likes
Hi @_Manoj_Kumar_
Thank you for the quick response. I was able to pass the ios build and from the file you have shared, things looks good on my swift file but I am still getting error when I allow notifications in my phone. Now it says "Error: "Adobe" plugin is not implemented on ios"
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies